ifw-daq  3.0.0-pre2
IFW Data Acquisition modules
Classes | Enumerations | Functions
daq::config Namespace Reference

Classes

struct  Formatter
 Extension point to allow adaptations from non-formattable configurations types. More...
 
struct  Converter
 
struct  Converter< std::filesystem::path >
 
struct  Converter< std::chrono::seconds >
 
struct  Converter< std::chrono::hours >
 
struct  OriginInfo
 Mutable metadata about a configuration attribute that describes where a value comes from. More...
 
class  Manager
 Maintains the associativity of configuration attributes with metadata and value origin/priority. More...
 
struct  Formatter< std::filesystem::path >
 

Enumerations

enum class  Origin {
  Runtime = 0 , CommandLine , Configuration , EnvironmentVariable ,
  Default
}
 Configuration origins in descending priority. More...
 

Functions

std::ostream & operator<< (std::ostream &os, Origin origin)
 Format Origin. More...
 
std::ostream & operator<< (std::ostream &os, OriginInfo const &info)
 Format OriginInfo. More...
 
std::optional< std::reference_wrapper< elt::configng::CiiConfigInstanceNode const > > GetParam (std::string const &selector, elt::configng::CiiConfigInstanceNode const &node)
 Performs lookup of parameters in the form root/node/leaf relative to the provided node. More...
 
template<class T >
std::optional< T > GetParamAs (std::string const &query, elt::configng::CiiConfigInstanceNode const &node)
 Performs lookup of parameters in the form root/node/leaf relative to the provided node. More...
 

Class Documentation

◆ daq::config::Metadata

struct daq::config::Metadata

Immutable information about a configuration attribute.

Definition at line 70 of file manager.hpp.

Class Members
string canonical_name
string description

◆ daq::config::OriginInfo

struct daq::config::OriginInfo

Mutable metadata about a configuration attribute that describes where a value comes from.

Definition at line 116 of file manager.hpp.

Class Members
string description May include additional information like which configuration file was used.
Origin origin

Enumeration Type Documentation

◆ Origin

enum daq::config::Origin
strong

Configuration origins in descending priority.

This is used to indicate from where a configuration parameter originates as well as its configuration priority. Higher or equal priority (lower number) replace lower or equal priority origins.

Enumerator
Runtime 

Runtime change via e.g.

request/reply command.

CommandLine 

Command line argument.

Configuration 

Configuration file.

EnvironmentVariable 

Environment variable.

Default 

Built-in default value.

Definition at line 36 of file manager.hpp.

Function Documentation

◆ GetParam()

std::optional< std::reference_wrapper< elt::configng::CiiConfigInstanceNode const > > daq::config::GetParam ( std::string const &  selector,
elt::configng::CiiConfigInstanceNode const &  node 
)

Performs lookup of parameters in the form root/node/leaf relative to the provided node.

Parameters
selectorConfiguration selector in the format node/node/param
nodeThe configuration node to select from.

Definition at line 46 of file manager.cpp.

◆ GetParamAs()

template<class T >
std::optional<T> daq::config::GetParamAs ( std::string const &  query,
elt::configng::CiiConfigInstanceNode const &  node 
)

Performs lookup of parameters in the form root/node/leaf relative to the provided node.

Parameters
selectorConfiguration selector in the format node/node/param
nodeThe configuration node to select from.
Template Parameters
TType convertion to perform.

Definition at line 337 of file manager.hpp.

◆ operator<<() [1/2]

std::ostream & daq::config::operator<< ( std::ostream &  os,
Origin  origin 
)

Format Origin.

Parameters
osoutput stream.
originOrigin to format.

Definition at line 16 of file manager.cpp.

◆ operator<<() [2/2]

std::ostream & daq::config::operator<< ( std::ostream &  os,
OriginInfo const &  info 
)

Format OriginInfo.

Parameters
osoutput stream.
infoOriginInfo to format.

Definition at line 40 of file manager.cpp.