9 #ifndef IWF_CTD_PARAM_PARAMETER_SET_HPP_
10 #define IWF_CTD_PARAM_PARAMETER_SET_HPP_
32 static std::string
ToString(std::vector<ctd::param::Parameter>& par_list);
35 void Store(
const std::string& par_name,
36 const std::string& value,
37 const std::string& comment =
"");
40 std::string
GetValue(
const std::string& par_name,
41 const bool exception =
false)
const;
47 const bool exception =
false)
const {
51 if (
HasPar(name, tmpPar)) {
55 throw rad::Exception(
"Undefined parameter name: %s", name.c_str());
67 bool HasPar(
const std::string& par_name)
const;
70 bool HasPar(
const std::string& par_name,
75 bool HasPar(
const std::string& par_name,
80 if (
HasPar(par_name, tmpPar)) {
89 uint32_t
Scan(
const std::string& filter_reg_exp,
90 std::vector<ctd::param::Parameter>& matches)
const;
93 std::string
ToString(
const std::string& filter_reg_exp =
"")
const;
96 std::vector<std::string>
ParNames()
const;
99 const std::map<std::string, ctd::param::Parameter>&
GetParameterMap()
const;
117 #endif // !IWF_CTD_PARAM_PARAMETER_SET_HPP_
bool GetValue(const std::string &name, TYPE &value, const bool exception=false) const
Return value for the referenced parameter as its native data type.
Definition: ParameterSet.hpp:45
ParameterSet & operator=(const ParameterSet &source)
Assignment operator.
Definition: ParameterSet.cpp:29
std::vector< std::string > ParNames() const
Returns list of parameter names.
Definition: ParameterSet.cpp:38
Class to handle a set of parameters.
Definition: ParameterSet.hpp:21
ParameterSet()
Definition: ParameterSet.cpp:11
std::string GetValue() const
Get parameter value as a string.
Definition: Parameter.cpp:102
bool HasPar(const std::string &par_name) const
Returns true if parameter is defined.
Definition: ParameterSet.cpp:62
static std::string ToString(std::vector< ctd::param::Parameter > &par_list)
Create an ASCII print out of the parameters in the list.
Definition: ParameterSet.cpp:125
const ctd::param::Parameter & GetPar(const std::string &par_name) const
Get reference to parameter object, referenced by its name.
Definition: ParameterSet.cpp:85
std::map< std::string, ctd::param::Parameter > m_par_map
Definition: ParameterSet.hpp:106
std::string GetValue(const std::string &par_name, const bool exception=false) const
Return value for the referenced parameter as a string.
Definition: ParameterSet.cpp:96
void _Copy(const ParameterSet &source)
Definition: ParameterSet.cpp:161
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.
Definition: ParameterSet.cpp:49
const std::map< std::string, ctd::param::Parameter > & GetParameterMap() const
Return reference to the internal map with the names/parameter objects.
Definition: ParameterSet.cpp:168
~ParameterSet()
Definition: ParameterSet.cpp:23
Class to handle information for one parameter.
Definition: Parameter.hpp:24
Tools to handle parameter files.
uint32_t Scan(const std::string &filter_reg_exp, std::vector< ctd::param::Parameter > &matches) const
Scans through the parameter object namespace and creates list of matching parameters.
Definition: ParameterSet.cpp:111
bool HasPar(const std::string &par_name, TYPE &value) const
Return true if parameter defined, sets the value as the native value.
Definition: ParameterSet.hpp:75