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

Factory/cache for Parameters instances. More...

#include <Parameters.h>

Static Public Member Functions

static std::shared_ptr< ParametersGetParameters (ParameterType id)
 Returns the cached repository for one parameter type.
 
static std::shared_ptr< ParametersCreateUncached (ParameterType id)
 Creates a fresh uncached repository for a runtime context.
 
static std::shared_ptr< ParametersCreateUncachedRegistered (ParameterType id, const std::function< void(const std::shared_ptr< Parameters > &)> &register_before_postinit)
 Creates a fresh uncached repository and registers it before post-initialization.
 
static void removeParameters (ParameterType id)
 Removes one cached repository.
 
static void clear ()
 

Detailed Description

Factory/cache for Parameters instances.

This class ensures that at most one repository exists per ParameterType. It is responsible for:

  • creating the matching ModelStrategy,
  • constructing the repository,
  • calling strategy post-initialization,
  • caching the result for later reuse.

Definition at line 703 of file Parameters.h.

Member Function Documentation

◆ clear()

void ParametersFactory::clear ( )
static

Definition at line 590 of file Parameters.cpp.

◆ CreateUncached()

std::shared_ptr< Parameters > ParametersFactory::CreateUncached ( ParameterType  id)
static

Creates a fresh uncached repository for a runtime context.

The returned repository is initialized and post-initialized exactly like the global singleton repository, but it is not stored in the process-wide factory cache.

Definition at line 541 of file Parameters.cpp.

◆ CreateUncachedRegistered()

std::shared_ptr< Parameters > ParametersFactory::CreateUncachedRegistered ( ParameterType  id,
const std::function< void(const std::shared_ptr< Parameters > &)> &  register_before_postinit 
)
static

Creates a fresh uncached repository and registers it before post-initialization.

Some post-initialization steps create dependent blocks through DependentBlockManager, which can recursively call Parameters::GetInstance for the repository currently being built. Runtime-local contexts need the partially constructed repository to be visible before those dependent blocks are attached. The callback is invoked after the base repository is initialized but before ModelStrategy::postInitialization runs.

Definition at line 545 of file Parameters.cpp.

◆ GetParameters()

std::shared_ptr< Parameters > ParametersFactory::GetParameters ( ParameterType  id)
static

Returns the cached repository for one parameter type.

If it does not exist yet:

  • creates the appropriate strategy,
  • constructs the repository,
  • runs post-initialization,
  • stores it in the static cache.
Parameters
idParameter namespace to retrieve.
Returns
Shared pointer to the corresponding repository.

Definition at line 522 of file Parameters.cpp.

◆ removeParameters()

void ParametersFactory::removeParameters ( ParameterType  id)
static

Removes one cached repository.

Parameters
idParameter namespace to remove.
Exceptions
Vialogging/error handling if the repository does not exist.

Definition at line 560 of file Parameters.cpp.


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