Belle II Software
release-08-01-10
|
The Module parameter list class. More...
#include <ModuleParamList.h>
Public Member Functions | |
ModuleParamList () | |
Constructor. | |
~ModuleParamList () | |
Destructor. | |
template<typename T > | |
void | addParameter (const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue) |
Adds a new parameter to the module list. More... | |
template<typename T > | |
void | addParameter (const std::string &name, T ¶mVariable, const std::string &description) |
Adds a new enforced parameter to the module list. More... | |
template<typename T > | |
void | setParameter (const std::string &name, const T &value) |
Sets the value of a parameter given by its name. More... | |
void | setParameters (const ModuleParamList ¶ms) |
Set values for parameters from other parameter list. | |
std::vector< std::string > | getParameterNames () const |
Returns the names of all parameters in this parameter list. More... | |
std::string | getParameterDescription (const std::string &name) const |
Returns the description of a parameter given by its name. More... | |
std::string | getParameterTypeInfo (const std::string &name) const |
Returns the type info of a parameter given by its name. More... | |
template<typename T > | |
ModuleParam< T > & | getParameter (const std::string &name) const |
Returns a reference to a parameter. More... | |
std::vector< std::string > | getUnsetForcedParams () const |
Returns list of unset parameters (if they are required to have a value. | |
std::shared_ptr< boost::python::list > | getParamInfoListPython () const |
Returns a python list of all parameters. More... | |
template<typename PythonObject > | |
void | setParamPython (const std::string &name, const PythonObject &pyObj) |
Implements a method for setting boost::python objects. More... | |
template<typename PythonObject > | |
void | getParamValuesPython (const std::string &name, PythonObject &pyOutput, bool defaultValues) const |
Returns a python object containing the value or default value of the given parameter. More... | |
Private Member Functions | |
ModuleParamPtr | getParameterPtr (const std::string &name) const |
Returns a ModuleParamPtr to a parameter. More... | |
Static Private Member Functions | |
static void | throwNotFoundError (const std::string &name) |
Throws an error for a requested parameter that does not exist. More... | |
static void | throwTypeError (const std::string &name, const std::string &expectedTypeInfo, const std::string &typeInfo) |
Throws an error for a requested parameter that exists but was request with the wrong type. More... | |
Private Attributes | |
std::map< std::string, ModuleParamPtr > | m_paramMap |
Stores the module parameters together with a string name as key. | |
The Module parameter list class.
Stores and manages all parameters of a module.
Definition at line 44 of file ModuleParamList.h.
std::string getParameterDescription | ( | const std::string & | name | ) | const |
Returns the description of a parameter given by its name.
Throws an exception of type ModuleParameterNotFoundError if a parameter with the given name does not exist.
name | The unique name of the parameter. |
Definition at line 105 of file ModuleParamList.cc.
std::vector< std::string > getParameterNames | ( | ) | const |
Returns the names of all parameters in this parameter list.
Definition at line 95 of file ModuleParamList.cc.
|
private |
Returns a ModuleParamPtr to a parameter.
Throws an exception of type ModuleParameterNotFoundError if a parameter with the given name does not exist.
name | The unique name of the parameter. |
Definition at line 124 of file ModuleParamList.cc.
std::string getParameterTypeInfo | ( | const std::string & | name | ) | const |
Returns the type info of a parameter given by its name.
Throws an exception of type ModuleParameterNotFoundError if a parameter with the given name does not exist.
name | The unique name of the parameter. |
Definition at line 110 of file ModuleParamList.cc.
std::shared_ptr< boost::python::list > getParamInfoListPython | ( | ) | const |
Returns a python list of all parameters.
Each item in the list consists of the name of the parameter, a string describing its type, a python list of all values, a python list of all default values, the information of the parameter was set in the steering file and the description of the parameter.
Definition at line 64 of file ModuleParamList.cc.
|
staticprivate |
Throws an error for a requested parameter that does not exist.
name | The name of the parameter. |
Definition at line 33 of file ModuleParamList.cc.
|
staticprivate |
Throws an error for a requested parameter that exists but was request with the wrong type.
name | The name of the parameter. |
expectedTypeInfo | Type information which the parameter actually has. |
typeInfo | Type information with which the parameter was looked up. |
Definition at line 38 of file ModuleParamList.cc.