6 const std::string& instanceName,
7 const std::string& jsonFilePath,
8 std::shared_ptr<IParamMappingSource> loader
11 return std::make_shared<MappingDatabaseProxy>(std::move(adapter));
15 : adapter_(
std::move(adapter)) {
16 if (!adapter_)
throw std::runtime_error(
"MappingDatabaseProxy: adapter is null");
19std::unordered_map<std::string, InterpretedParam>
21 return adapter_->getParams();
24std::optional<InterpretedParam>
26 return adapter_->getParam(name);
30 return adapter_->instanceName();
Declares a proxy implementation of IMappingDatabasePort.
Factory interface for building IMappingDatabaseAdapter instances.
virtual std::shared_ptr< IMappingDatabaseAdapter > create(const std::string &instanceName, const std::string &jsonFilePath, std::shared_ptr< IParamMappingSource > loader) const =0
Creates a mapping database adapter from an underlying JSON-like file.
static std::shared_ptr< MappingDatabaseProxy > fromFactory(const IMappingAdapterFactory &factory, const std::string &instanceName, const std::string &jsonFilePath, std::shared_ptr< IParamMappingSource > loader=nullptr)
Factory helper to create a proxy with a given adapter factory.
MappingDatabaseProxy(std::shared_ptr< IMappingDatabaseAdapter > adapter)
Constructs a new proxy from an existing adapter.
std::optional< InterpretedParam > getParam(const std::string &name) const override
Retrieves a parameter mapping by name.
std::unordered_map< std::string, InterpretedParam > getParams() const override
Returns all parameters stored in the database.
std::string instanceName() const override
Returns a logical name for this database instance.
Hash specialization for SymbolId<Tag>.