ifw-core 7.0.0
 
Loading...
Searching...
No Matches
ifw::core::utils::param::ParameterSet Class Reference

Class to handle a set of parameters. More...

#include <parameterSet.hpp>

Inheritance diagram for ifw::core::utils::param::ParameterSet:
ifw::core::utils::file::ParameterFile ifw::core::utils::file::Yaml

Public Member Functions

 ParameterSet ()
 
 ParameterSet (const ParameterSet &source)
 Copy constructor.
 
 ~ParameterSet ()
 
ParameterSetClear ()
 Clear the object.
 
void Store (const std::string &par_name, const std::string &value, const std::string &comment="")
 Store a parameter name, value and possibly comment in the object.
 
std::string GetValue (const std::string &par_name, const bool exception=false) const
 Return value for the referenced parameter as a string.
 
template<class TYPE>
bool GetValue (const std::string &name, TYPE &value, const bool exception=false) const
 Return value for the referenced parameter as its native data type.
 
const ifw::core::utils::param::ParameterGetPar (const std::string &par_name) const
 Get reference to parameter object, referenced by its name.
 
bool HasPar (const std::string &par_name) const
 Returns true if parameter is defined.
 
bool HasPar (const std::string &par_name, ifw::core::utils::param::Parameter &parameter) const
 Returns true if parameter defined, copies parameter object to object provided.
 
bool HasPar (const std::string &par_name, std::string &value) const
 Returns true if parameter defined and copies value into "value" parameter.
 
template<class TYPE>
bool HasPar (const std::string &par_name, TYPE &value) const
 Return true if parameter defined, sets the value as the native value.
 
uint32_t Scan (const std::string &filter_reg_exp, std::vector< ifw::core::utils::param::Parameter > &matches) const
 Scans through the parameter object namespace and creates list of matching parameters.
 
std::string ToString (const std::string &filter_reg_exp="") const
 Prints out contents of object, applying regular expression filtering, if specified.
 
std::vector< std::string > ParNames () const
 Returns list of parameter names.
 
const std::map< std::string, ifw::core::utils::param::Parameter > & GetParameterMap () const
 Return reference to the internal map with the names/parameter objects.
 
void Merge (const ParameterSet &source_set)
 Merge the parameters of the source into this instance.
 
ParameterSetoperator= (const ParameterSet &source)
 Assignment operator.
 

Static Public Member Functions

static std::string ToString (std::vector< ifw::core::utils::param::Parameter > &par_list)
 Create an ASCII print out of the parameters in the list.
 

Protected Member Functions

void _Copy (const ParameterSet &source)
 

Protected Attributes

std::map< std::string, ifw::core::utils::param::Parameterm_par_map
 

Detailed Description

Class to handle a set of parameters.

Constructor & Destructor Documentation

◆ ParameterSet() [1/2]

ifw::core::utils::param::ParameterSet::ParameterSet ( )

◆ ParameterSet() [2/2]

ifw::core::utils::param::ParameterSet::ParameterSet ( const ParameterSet & source)

Copy constructor.

◆ ~ParameterSet()

ifw::core::utils::param::ParameterSet::~ParameterSet ( )

Member Function Documentation

◆ _Copy()

void ifw::core::utils::param::ParameterSet::_Copy ( const ParameterSet & source)
protected

◆ Clear()

ParameterSet & ifw::core::utils::param::ParameterSet::Clear ( )

Clear the object.

◆ GetPar()

const Parameter & ifw::core::utils::param::ParameterSet::GetPar ( const std::string & par_name) const

Get reference to parameter object, referenced by its name.

◆ GetParameterMap()

const std::map< std::string, Parameter > & ifw::core::utils::param::ParameterSet::GetParameterMap ( ) const

Return reference to the internal map with the names/parameter objects.

◆ GetValue() [1/2]

template<class TYPE>
bool ifw::core::utils::param::ParameterSet::GetValue ( const std::string & name,
TYPE & value,
const bool exception = false ) const
inline

Return value for the referenced parameter as its native data type.

◆ GetValue() [2/2]

std::string ifw::core::utils::param::ParameterSet::GetValue ( const std::string & par_name,
const bool exception = false ) const

Return value for the referenced parameter as a string.

◆ HasPar() [1/4]

bool ifw::core::utils::param::ParameterSet::HasPar ( const std::string & par_name) const

Returns true if parameter is defined.

◆ HasPar() [2/4]

bool ifw::core::utils::param::ParameterSet::HasPar ( const std::string & par_name,
ifw::core::utils::param::Parameter & parameter ) const

Returns true if parameter defined, copies parameter object to object provided.

◆ HasPar() [3/4]

bool ifw::core::utils::param::ParameterSet::HasPar ( const std::string & par_name,
std::string & value ) const

Returns true if parameter defined and copies value into "value" parameter.

◆ HasPar() [4/4]

template<class TYPE>
bool ifw::core::utils::param::ParameterSet::HasPar ( const std::string & par_name,
TYPE & value ) const
inline

Return true if parameter defined, sets the value as the native value.

◆ Merge()

void ifw::core::utils::param::ParameterSet::Merge ( const ParameterSet & source_set)

Merge the parameters of the source into this instance.

◆ operator=()

ParameterSet & ifw::core::utils::param::ParameterSet::operator= ( const ParameterSet & source)

Assignment operator.

◆ ParNames()

std::vector< std::string > ifw::core::utils::param::ParameterSet::ParNames ( ) const

Returns list of parameter names.

◆ Scan()

uint32_t ifw::core::utils::param::ParameterSet::Scan ( const std::string & filter_reg_exp,
std::vector< ifw::core::utils::param::Parameter > & matches ) const

Scans through the parameter object namespace and creates list of matching parameters.

◆ Store()

void ifw::core::utils::param::ParameterSet::Store ( const std::string & par_name,
const std::string & value,
const std::string & comment = "" )

Store a parameter name, value and possibly comment in the object.

◆ ToString() [1/2]

std::string ifw::core::utils::param::ParameterSet::ToString ( const std::string & filter_reg_exp = "") const

Prints out contents of object, applying regular expression filtering, if specified.

◆ ToString() [2/2]

static std::string ifw::core::utils::param::ParameterSet::ToString ( std::vector< ifw::core::utils::param::Parameter > & par_list)
static

Create an ASCII print out of the parameters in the list.

Member Data Documentation

◆ m_par_map

std::map<std::string, ifw::core::utils::param::Parameter> ifw::core::utils::param::ParameterSet::m_par_map
protected

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