Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
DefaultMappingDatabaseAdapter.h
Go to the documentation of this file.
1#ifndef DEFAULTMAPPINGDATABASEADAPTER_H
2#define DEFAULTMAPPINGDATABASEADAPTER_H
3
4#include <utility>
5
7#include "MappingDatabase.h"
8
27public:
35 std::shared_ptr<MappingDatabase> db)
36 : name_(std::move(instanceName)), db_(std::move(db)) {}
37
41 std::unordered_map<std::string, InterpretedParam>
42 getParams() const override {
43 return db_->getParams();
44 }
45
52 std::optional<InterpretedParam>
53 getParam(const std::string& name) const override {
54 auto m = getParams();
55 if (auto it = m.find(name); it != m.end()) return it->second;
56 return std::nullopt;
57 }
58
62 std::string instanceName() const override { return name_; }
63
64private:
65 std::string name_;
66 std::shared_ptr<MappingDatabase> db_;
67};
68
69#endif
Interface for read-only access to a mapping database of parameters.
In-memory store of parameter mappings loaded from an external file.
Default implementation of IMappingDatabaseAdapter.
std::string instanceName() const override
Returns the logical instance name of this adapter.
std::unordered_map< std::string, InterpretedParam > getParams() const override
Returns the full parameter map from the backing database.
std::optional< InterpretedParam > getParam(const std::string &name) const override
Returns a single parameter mapping by name, if present.
DefaultMappingDatabaseAdapter(std::string instanceName, std::shared_ptr< MappingDatabase > db)
Constructs an adapter around a MappingDatabase instance.
Abstract view of a parameter mapping database.
Hash specialization for SymbolId<Tag>.
Definition BlockName.h:353