Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
ParameterRuntimeContext.h
Go to the documentation of this file.
1#ifndef PARAMETER_RUNTIME_CONTEXT_H
2#define PARAMETER_RUNTIME_CONTEXT_H
3
4#include <map>
5#include <memory>
6#include <unordered_set>
7#include <vector>
8
9#include "BlockAccessor.h"
10#include "config.hpp"
11
12class Parameters;
13
23public:
25
26 std::shared_ptr<Parameters> get_parameters(ParameterType id);
27 std::shared_ptr<BlockAccessor> extract_blocks(const std::unordered_set<BlockName>& block_names) const;
28 std::unordered_set<BlockName> available_input_blocks() const;
29 const std::vector<ParameterType>& parameter_types() const;
30
32
33private:
34 std::shared_ptr<BlockAccessor> local_input_cache_;
35 std::map<ParameterType, std::shared_ptr<Parameters>> local_instances_;
36 std::vector<ParameterType> parameter_types_;
37
38 static thread_local ParameterRuntimeContext* current_;
39
41};
42
57
58#endif // PARAMETER_RUNTIME_CONTEXT_H
Alias-aware façade for accessing and manipulating multiple parameter blocks.
ParameterType
Per-thread parameter runtime used to isolate Monte-Carlo workers.
std::shared_ptr< Parameters > get_parameters(ParameterType id)
std::unordered_set< BlockName > available_input_blocks() const
const std::vector< ParameterType > & parameter_types() const
static ParameterRuntimeContext * current()
std::shared_ptr< BlockAccessor > extract_blocks(const std::unordered_set< BlockName > &block_names) const
Block-based parameter repository for one ParameterType namespace.
Definition Parameters.h:351
RAII installer for a ParameterRuntimeContext on the current thread.
ScopedParameterRuntimeContext(const ScopedParameterRuntimeContext &)=delete
ScopedParameterRuntimeContext & operator=(const ScopedParameterRuntimeContext &)=delete