ifw-daq  3.0.0-pre2
IFW Data Acquisition modules
Classes | Public Member Functions | List of all members
daq::config::Manager Class Reference

Maintains the associativity of configuration attributes with metadata and value origin/priority. More...

#include <manager.hpp>

Classes

struct  CiiValue
 CII representation of real value. More...
 
struct  CurrentValue
 Describes current value. More...
 

Public Member Functions

 Manager (log4cplus::Logger const &logger)
 Constructor. More...
 
template<class AttrType >
void Register (AttrType *ptr, Metadata const &meta)
 Registers a configuration parameter/attribute. More...
 
template<class AttrType , class Converter >
void Register (AttrType *ptr, Metadata const &meta, Converter &&c)
 
template<class AttrType , class T >
bool Update (AttrType *ptr, T const &value, OriginInfo const &origin)
 Update configuration value taking into account the origin of the change. More...
 
template<class AttrType >
CurrentValue< AttrType > Get (AttrType *ptr) const
 Get current configuration value and associated metadata and origin. More...
 
template<class Func >
void Visit (Func &&func)
 Visit each registered parameter. More...
 
template<class AttrType >
Manager::template CurrentValue< AttrType > Get (AttrType *ptr) const
 

Detailed Description

Maintains the associativity of configuration attributes with metadata and value origin/priority.

Main responsibilities:

Outside the scope:

Manager works on the following assumptions and principles:

Definition at line 148 of file manager.hpp.


Class Documentation

◆ daq::config::Manager::CiiValue

struct daq::config::Manager::CiiValue

CII representation of real value.

Definition at line 196 of file manager.hpp.

Class Members
Metadata const & metadata
OriginInfo const & origin
OldbType value

◆ daq::config::Manager::CurrentValue

struct daq::config::Manager::CurrentValue

template<class AttrType>
struct daq::config::Manager::CurrentValue< AttrType >

Describes current value.

Definition at line 187 of file manager.hpp.

Class Members
Metadata const & metadata
OriginInfo const & origin
AttrType const & value

Constructor & Destructor Documentation

◆ Manager()

daq::config::Manager::Manager ( log4cplus::Logger const &  logger)
inline

Constructor.

Parameters
loggerWhere to log to.

Definition at line 155 of file manager.hpp.

Member Function Documentation

◆ Get() [1/2]

template<class AttrType >
CurrentValue<AttrType> daq::config::Manager::Get ( AttrType *  ptr) const

Get current configuration value and associated metadata and origin.

Parameters
ptrConfiguration member pointer.
Exceptions
std::exceptionif configuration is unknown.

◆ Get() [2/2]

template<class AttrType >
Manager::template CurrentValue<AttrType> daq::config::Manager::Get ( AttrType *  ptr) const

Definition at line 268 of file manager.hpp.

◆ Register() [1/2]

template<class AttrType >
void daq::config::Manager::Register ( AttrType *  ptr,
Metadata const &  meta 
)

Registers a configuration parameter/attribute.

Parameters
ptrConfiguration value pointer.
metaMetadata associated with attribute.
Exceptions
std::exceptionif ptr has already been registered before or if allocation fails.

Definition at line 238 of file manager.hpp.

◆ Register() [2/2]

template<class AttrType , class Converter >
void daq::config::Manager::Register ( AttrType *  ptr,
Metadata const &  meta,
Converter &&  c 
)

Definition at line 255 of file manager.hpp.

◆ Update()

template<class AttrType , class T >
bool daq::config::Manager::Update ( AttrType *  ptr,
T const &  value,
OriginInfo const &  origin 
)

Update configuration value taking into account the origin of the change.

Parameters
ptrConfiguration value pointer.
valuenew configuration value.
originSpecifies origin of configuration value.
Returns
true if configuration was changed false otherwise.
Exceptions
std::exceptionif configuration member has not been registered before.

Definition at line 280 of file manager.hpp.

◆ Visit()

template<class Func >
void daq::config::Manager::Visit ( Func &&  func)
inline

Visit each registered parameter.

Template Parameters
FuncCallable invocable with func(cii_value) where cii_value is const-reference CiiValue.

Definition at line 217 of file manager.hpp.


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