// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include "i_gid_to_lid_change_listener.h" #include #include #include namespace proton { /* * Class for listening to changes in mapping from gid to lid and updating * reference attribute appropriately. */ class GidToLidChangeListener : public IGidToLidChangeListener { vespalib::ISequencedTaskExecutor &_executor; vespalib::ISequencedTaskExecutor::ExecutorId _executorId; std::shared_ptr _attr; vespalib::RetainGuard _retainGuard; vespalib::string _name; vespalib::string _docTypeName; public: GidToLidChangeListener(vespalib::ISequencedTaskExecutor &attributeFieldWriter, std::shared_ptr attr, vespalib::RetainGuard refCount, const vespalib::string &name, const vespalib::string &docTypeName); ~GidToLidChangeListener() override; void notifyPutDone(IDestructorCallbackSP context, document::GlobalId gid, uint32_t lid) override; void notifyRemove(IDestructorCallbackSP context, document::GlobalId gid) override; void notifyRegistered(const std::vector& removes) override; const vespalib::string &getName() const override; const vespalib::string &getDocTypeName() const override; const std::shared_ptr &getReferenceAttribute() const { return _attr; } }; } // namespace proton