// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include "i_document_db_reference_registry.h" #include #include #include namespace proton { /* * Class implementing a registry of named IDocumentDBReferences. */ class DocumentDBReferenceRegistry : public IDocumentDBReferenceRegistry { mutable std::mutex _lock; mutable std::condition_variable _cv; std::map> _handlers; public: DocumentDBReferenceRegistry(); virtual ~DocumentDBReferenceRegistry(); virtual std::shared_ptr get(vespalib::stringref docType) const override; virtual std::shared_ptr tryGet(vespalib::stringref docType) const override; virtual void add(vespalib::stringref name, std::shared_ptr referee) override; virtual void remove(vespalib::stringref name) override; }; } // namespace proton