Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
MappingDatabaseProxy Class Referencefinal

Concrete IMappingDatabasePort that delegates to an adapter. More...

#include <MappingDatabaseProxy.h>

Inheritance diagram for MappingDatabaseProxy:
Collaboration diagram for MappingDatabaseProxy:

Public Member Functions

 MappingDatabaseProxy (std::shared_ptr< IMappingDatabaseAdapter > adapter)
 Constructs a new proxy from an existing adapter.
 
std::unordered_map< std::string, InterpretedParamgetParams () const override
 Returns all parameters stored in the database.
 
std::optional< InterpretedParamgetParam (const std::string &name) const override
 Retrieves a parameter mapping by name.
 
std::string instanceName () const override
 Returns a logical name for this database instance.
 
- Public Member Functions inherited from IMappingDatabasePort
virtual ~IMappingDatabasePort ()=default
 

Static Public Member Functions

static std::shared_ptr< MappingDatabaseProxyfromFactory (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.
 

Detailed Description

Concrete IMappingDatabasePort that delegates to an adapter.

This class:

Definition at line 32 of file MappingDatabaseProxy.h.

Constructor & Destructor Documentation

◆ MappingDatabaseProxy()

MappingDatabaseProxy::MappingDatabaseProxy ( std::shared_ptr< IMappingDatabaseAdapter adapter)
explicit

Constructs a new proxy from an existing adapter.

Parameters
adapterConcrete mapping database adapter (must be non-null).
Exceptions
std::runtime_errorIf adapter is null.

Definition at line 14 of file MappingDatabaseProxy.cpp.

Member Function Documentation

◆ fromFactory()

std::shared_ptr< MappingDatabaseProxy > MappingDatabaseProxy::fromFactory ( const IMappingAdapterFactory factory,
const std::string &  instanceName,
const std::string &  jsonFilePath,
std::shared_ptr< IParamMappingSource loader = nullptr 
)
static

Factory helper to create a proxy with a given adapter factory.

Parameters
factoryAdapter factory that knows how to read the mapping file.
instanceNameLogical name of this database instance (e.g. model name).
jsonFilePathPath to the mapping JSON file.
loaderOptional mapping source loader (may be null).
Returns
Shared pointer to the newly constructed proxy.

Definition at line 4 of file MappingDatabaseProxy.cpp.

◆ getParam()

std::optional< InterpretedParam > MappingDatabaseProxy::getParam ( const std::string &  name) const
overridevirtual

Retrieves a parameter mapping by name.

Parameters
nameSymbolic parameter name as used in the generated code.
Returns
The corresponding InterpretedParam if found, std::nullopt otherwise.

Implements IMappingDatabasePort.

Definition at line 25 of file MappingDatabaseProxy.cpp.

◆ getParams()

std::unordered_map< std::string, InterpretedParam > MappingDatabaseProxy::getParams ( ) const
overridevirtual

Returns all parameters stored in the database.

Returns
Map from parameter name to InterpretedParam.

Implements IMappingDatabasePort.

Definition at line 20 of file MappingDatabaseProxy.cpp.

◆ instanceName()

std::string MappingDatabaseProxy::instanceName ( ) const
overridevirtual

Returns a logical name for this database instance.

Typically this is the model name, e.g. "SM" or "THDM".

Returns
Instance name as a string.

Implements IMappingDatabasePort.

Definition at line 29 of file MappingDatabaseProxy.cpp.


The documentation for this class was generated from the following files: