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

Lightweight container for InterpretedParam mappings. More...

#include <MappingDatabase.h>

Public Member Functions

 MappingDatabase (const std::string &instanceName, const std::string &jsonFilePath, std::shared_ptr< IParamMappingSource > loader)
 Constructs a MappingDatabase and immediately loads mappings.
 
std::unordered_map< std::string, InterpretedParamgetParams () const
 Returns the current parameter mapping.
 

Detailed Description

Lightweight container for InterpretedParam mappings.

A MappingDatabase is essentially a cache of the parameter mapping file. It is responsible for:

  • invoking an IParamMappingSource to parse the mapping file,
  • storing the resulting associations in an in-memory map,
  • providing read-only access to the resulting map.

It does not deal with higher-level concepts such as database instances or multiple mapping sets; that logic is handled by IMappingDatabaseAdapter implementations and factories.

Definition at line 32 of file MappingDatabase.h.

Constructor & Destructor Documentation

◆ MappingDatabase()

MappingDatabase::MappingDatabase ( const std::string &  instanceName,
const std::string &  jsonFilePath,
std::shared_ptr< IParamMappingSource loader 
)

Constructs a MappingDatabase and immediately loads mappings.

If loader is null, a default JSON-based loader (JsonParamMappingAdapter

  • JSONParser) is instantiated. Any error during loading is reported to stderr and results in an empty mapping.
Parameters
instanceNameHuman-readable name of this mapping instance (used for logging only).
jsonFilePathPath to the mapping file to be loaded.
loaderSource object responsible for reading and interpreting the mapping file.

Definition at line 7 of file MappingDatabase.cpp.

Member Function Documentation

◆ getParams()

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

Returns the current parameter mapping.

The returned map is a copy of the internal storage to keep the class logically immutable from the caller’s perspective.

Returns
Map of parameter name → InterpretedParam.

Definition at line 33 of file MappingDatabase.cpp.


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