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

Concrete adapter combining monitoring and path providing functionalities. More...

#include <APIAdapter.h>

Inheritance diagram for APIAdapter:
Collaboration diagram for APIAdapter:

Public Member Functions

bool check_flag (ExternalFlag flag)
 Checks the status of a specific external flag.
 
fs::path get_path (APIPath path_name) override
 Retrieves a specific filesystem path exposed by APIPath.
 
std::unordered_set< BlockNameget_all_blocks ()
 Retrieves all block names across all available model types.
 
std::unordered_set< BlockNameget_blocks_list (ParameterType param_type=ParameterType::SM)
 Retrieves block names for a specific parameter type.
 
std::map< LhaID, scalar_tget_block_infos (const BlockName &block, ParameterType param_type=ParameterType::SM)
 Retrieves all parameter values inside a given block.
 
std::vector< ParameterTypeget_type_of_block (const BlockName &block)
 Retrieves the list of parameter types that own a specific block.
 
- Public Member Functions inherited from IMonitor< ExternalFlag >
virtual ~IMonitor ()=default
 Virtual destructor for proper polymorphic use.
 
- Public Member Functions inherited from IPathProvider< APIPath >
virtual ~IPathProvider ()=default
 Virtual destructor for polymorphic use.
 
- Public Member Functions inherited from IDataMonitor
virtual ~IDataMonitor ()=default
 
virtual ~IDataMonitor ()=default
 Virtual destructor for polymorphic use.
 

Detailed Description

Concrete adapter combining monitoring and path providing functionalities.

This class provides a unified, high-level API to:

It is intended for external tools (CLI, GUI, REST API) that need a read-only view over the internal parameter state managed by Hyperiso.

Typical usage:

auto all_blocks = api.get_all_blocks();
auto sm_mass_blocks = api.get_blocks_list(ParameterType::SM);
auto mass_values = api.get_block_infos("MASS", ParameterType::SM);
auto lha_path = api.get_path(APIPath::LHA_PATH);
auto sm_yaml = api.get_path(APIPath::USER_SM_PARAMS);
@ USER_SM_PARAMS
YAML/YML file containing user SM parameter overrides.
@ LHA_PATH
Path to the active LHA file.
Concrete adapter combining monitoring and path providing functionalities.
Definition APIAdapter.h:54
fs::path get_path(APIPath path_name) override
Retrieves a specific filesystem path exposed by APIPath.
std::unordered_set< BlockName > get_blocks_list(ParameterType param_type=ParameterType::SM)
Retrieves block names for a specific parameter type.
Definition APIAdapter.cpp:7
std::unordered_set< BlockName > get_all_blocks()
Retrieves all block names across all available model types.
std::map< LhaID, scalar_t > get_block_infos(const BlockName &block, ParameterType param_type=ParameterType::SM)
Retrieves all parameter values inside a given block.
Definition APIAdapter.cpp:3
See also
IDataMonitor
IMonitor
IPathProvider
Examples
examples/monitoring_system_example.cpp, and examples/path_provider_example.cpp.

Definition at line 52 of file APIAdapter.h.

Member Function Documentation

◆ check_flag()

bool APIAdapter::check_flag ( ExternalFlag  flag)
virtual

Checks the status of a specific external flag.

Delegates to MemoryManager::getMemoryCache().config.flags.

Parameters
flagThe flag to check.
Returns
True if the flag is active, false otherwise.

Implements IMonitor< ExternalFlag >.

Definition at line 11 of file APIAdapter.cpp.

◆ get_all_blocks()

std::unordered_set< BlockName > APIAdapter::get_all_blocks ( )
virtual

Retrieves all block names across all available model types.

This may iterate over all ParameterType instances allowed by MemoryManager and collect their block names.

Returns
A set of all block names.

Implements IDataMonitor.

Examples
examples/monitoring_system_example.cpp.

Definition at line 19 of file APIAdapter.cpp.

◆ get_block_infos()

std::map< LhaID, scalar_t > APIAdapter::get_block_infos ( const BlockName block,
ParameterType  param_type = ParameterType::SM 
)
virtual

Retrieves all parameter values inside a given block.

Delegates to Parameters::GetInstance(param_type)->get_block_infos(block).

Parameters
blockName of the block.
param_typeType of the model (default: SM).
Returns
A map from LHA IDs to parameter values.

Implements IDataMonitor.

Definition at line 3 of file APIAdapter.cpp.

◆ get_blocks_list()

std::unordered_set< BlockName > APIAdapter::get_blocks_list ( ParameterType  param_type = ParameterType::SM)
virtual

Retrieves block names for a specific parameter type.

Delegates to Parameters::GetInstance(param_type)->get_blocks_list().

Parameters
param_typeThe parameter type (default: SM).
Returns
A set of block names for the given type.

Implements IDataMonitor.

Definition at line 7 of file APIAdapter.cpp.

◆ get_path()

fs::path APIAdapter::get_path ( APIPath  path_name)
overridevirtual

Retrieves a specific filesystem path exposed by APIPath.

APIPath::LHA_PATH returns the LHA or spectrum path stored in MemoryManager::getMemoryCache().lha_path. Provider-backed entries return the active IPathsProvider values, including pre-init overrides.

Parameters
path_nameThe requested path.
Returns
The filesystem path corresponding to the enum.

Implements IPathProvider< APIPath >.

Examples
examples/path_provider_example.cpp.

Definition at line 15 of file APIAdapter.cpp.

◆ get_type_of_block()

std::vector< ParameterType > APIAdapter::get_type_of_block ( const BlockName block)
virtual

Retrieves the list of parameter types that own a specific block.

Internally relies on ParamRouter::GetType(block) to list all ParameterType values for which the block is registered.

Parameters
blockThe name of the block.
Returns
A vector of parameter types that own this block.

Implements IDataMonitor.

Definition at line 29 of file APIAdapter.cpp.


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