Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
IBlockComposer.h
Go to the documentation of this file.
1#ifndef IBLOCKCOMPOSER_H
2#define IBLOCKCOMPOSER_H
3
4#include "Include.h"
5#include "Parameter.h"
7#include "Block.h"
8
47public:
48 virtual ~IBlockComposer() = default;
49
57 virtual void compose_block(const std::string&, const std::unordered_map<ParameterType, std::vector<std::string>>&, const DepUpdateFunc&) = 0;
58
66 virtual void compose_parameter(const ParamId&, const std::unordered_set<ParamId>&, const DepParamUpdateFunc&) = 0;
67
73 virtual void remove_block(const std::string&) = 0;
74
80 virtual void update(const std::string&) = 0;
81
87 virtual void remove_all_composed_blocks() = 0;
88
95 bool has_composed_block(const std::string& block_name) const {
96 return composed_blocks.find(block_name) != composed_blocks.end();
97 }
98
99protected:
107 std::unordered_set<std::string> composed_blocks;
108};
109
110#endif // IBLOCKCOMPOSER_H
Defines classes used to store parameters and to build derived/dependent parameter blocks.
std::function< void(const BlockSrc &, std::shared_ptr< DependentBlock >)> DepUpdateFunc
Function type used to recompute a DependentBlock from its sources.
Definition Block.h:56
Defines parameters whose values are lazily computed from other parameters.
std::function< void(const ParamSrc &, std::shared_ptr< DependentParameter >)> DepParamUpdateFunc
Function signature used to recompute a DependentParameter.
ParameterType
Defines the Parameter class used to store individual physical/model parameters.
Abstract interface for composing dependent blocks and parameters.
virtual void compose_parameter(const ParamId &, const std::unordered_set< ParamId > &, const DepParamUpdateFunc &)=0
Compose (create/register) a dependent parameter.
virtual void compose_block(const std::string &, const std::unordered_map< ParameterType, std::vector< std::string > > &, const DepUpdateFunc &)=0
Compose (create/register) a dependent block.
bool has_composed_block(const std::string &block_name) const
Returns whether a block has already been composed by this composer instance.
virtual void remove_all_composed_blocks()=0
Remove all blocks recorded as composed by this composer family.
virtual void update(const std::string &)=0
Manually trigger an update for a previously composed block.
virtual ~IBlockComposer()=default
virtual void remove_block(const std::string &)=0
Remove a previously composed dependent block.
std::unordered_set< std::string > composed_blocks
Registry of blocks composed through this composer instance.
Composite identifier for a single parameter.
Definition ParamID.h:57