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

Unified proxy for block queries and diagnostics. More...

#include <BlockProxy.h>

Inheritance diagram for BlockProxy:
Collaboration diagram for BlockProxy:

Public Member Functions

 BlockProxy ()
 Default constructor.
 
bool exists (const std::string &blockname, ParameterType pt) override
 Checks whether a block exists for the given ParameterType.
 
void log_all_blocks (ParameterType pt) override
 Logs all blocks for a given ParameterType.
 
void log_block (ParameterType pt, const std::string &blockname) override
 Logs a single block for a given ParameterType.
 
std::unordered_set< BlockNameget_block_list (ParameterType pt) override
 Retrieves the set of block names for a given ParameterType.
 
std::map< LhaID, scalar_tget_block (ParameterType pt, const std::string &blockname) override
 Retrieves the content of a block for a given ParameterType.
 
- Public Member Functions inherited from IBlockProxy
virtual ~IBlockProxy ()=default
 

Detailed Description

Unified proxy for block queries and diagnostics.

BlockProxy exposes a single entry point to:

  • test whether a block exists for a given ParameterType,
  • print either all blocks of a model or a specific block,
  • retrieve the list of block names for a model.

Internally:

  • existence + logs are delegated to BlockProvider,
  • listing is delegated to APIAdapter (which uses the monitoring layer).

Definition at line 51 of file BlockProxy.h.

Constructor & Destructor Documentation

◆ BlockProxy()

BlockProxy::BlockProxy ( )
inline

Default constructor.

Initializes the internal BlockProvider and APIAdapter members.

Definition at line 58 of file BlockProxy.h.

Member Function Documentation

◆ exists()

bool BlockProxy::exists ( const std::string &  blockname,
ParameterType  pt 
)
overridevirtual

Checks whether a block exists for the given ParameterType.

Delegates to BlockProvider::exists().

Parameters
blocknameName of the block to check.
ptParameterType for which to check the block.
Returns
true if the block exists, false otherwise.

Implements IBlockProxy.

Definition at line 3 of file BlockProxy.cpp.

◆ get_block()

std::map< LhaID, scalar_t > BlockProxy::get_block ( ParameterType  pt,
const std::string &  blockname 
)
overridevirtual

Retrieves the content of a block for a given ParameterType.

Delegates to ::BlockProvider::get_block(pt), which provides the monitoring-layer implementation for retrieving block contents.

Parameters
ptParameterType to query.
blocknameName of the block.
Returns
map of theblock content owned by pt.

Implements IBlockProxy.

Definition at line 19 of file BlockProxy.cpp.

◆ get_block_list()

std::unordered_set< BlockName > BlockProxy::get_block_list ( ParameterType  pt)
overridevirtual

Retrieves the set of block names for a given ParameterType.

Delegates to ::APIAdapter::get_blocks_list(pt), which provides the monitoring-layer implementation for retrieving block names.

Parameters
ptParameterType to query.
Returns
Unordered set of block names owned by pt.

Implements IBlockProxy.

Definition at line 15 of file BlockProxy.cpp.

◆ log_all_blocks()

void BlockProxy::log_all_blocks ( ParameterType  pt)
overridevirtual

Logs all blocks for a given ParameterType.

Delegates to BlockProvider::log_all_blocks().

Depending on the logging backend, this typically prints the content of the associated Parameters instance (which includes its BlockAccessor).

Parameters
ptParameterType whose blocks should be logged.

Implements IBlockProxy.

Definition at line 7 of file BlockProxy.cpp.

◆ log_block()

void BlockProxy::log_block ( ParameterType  pt,
const std::string &  blockname 
)
overridevirtual

Logs a single block for a given ParameterType.

Delegates to BlockProvider::log_block(), which itself calls ::Parameters::print_block(blockname).

Since print_block() streams this->blockAccessor->at(blockname), the output is produced using the operator<< overload for std::shared_ptr<BlockAccessor>.

Parameters
ptParameterType owning the block.
blocknameName of the block to log.

Implements IBlockProxy.

Definition at line 11 of file BlockProxy.cpp.


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