Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
MappingDatabaseProxy.h
Go to the documentation of this file.
1#ifndef MAPPING_DATABASE_PROXY_H
2#define MAPPING_DATABASE_PROXY_H
3
4#include <memory>
5#include <string>
6#include <unordered_map>
7#include <optional>
8
12
33public:
43 static std::shared_ptr<MappingDatabaseProxy> fromFactory(
44 const IMappingAdapterFactory& factory,
45 const std::string& instanceName,
46 const std::string& jsonFilePath,
47 std::shared_ptr<IParamMappingSource> loader = nullptr
48 );
49
56 explicit MappingDatabaseProxy(std::shared_ptr<IMappingDatabaseAdapter> adapter);
57
59 std::unordered_map<std::string, InterpretedParam> getParams() const override;
60
62 std::optional<InterpretedParam> getParam(const std::string& name) const override;
63
65 std::string instanceName() const override;
66
67private:
69 std::shared_ptr<IMappingDatabaseAdapter> adapter_;
70};
71
72#endif // MAPPING_DATABASE_PROXY_H
Interface for factories creating mapping database adapters.
Interface for read-only access to a mapping database of parameters.
Declares an abstract port for parameter-mapping databases.
Factory interface for building IMappingDatabaseAdapter instances.
Interface for accessing a parameter-mapping database.
Concrete IMappingDatabasePort that delegates to an adapter.
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.
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.