Belle II Software light-2406-ragdoll
ModuleParam< T > Class Template Reference

A single parameter of the module. More...

#include <ModuleParam.h>

Inheritance diagram for ModuleParam< T >:
Collaboration diagram for ModuleParam< T >:

Public Member Functions

 ModuleParam (T &paramVariable, const std::string &description="", bool force=false)
 Constructor.
 
virtual ~ModuleParam ()
 Destructor.
 
void setValue (const T &value)
 Sets the value of a parameter.
 
void setDefaultValue (const T &defaultValue)
 Sets the default value of a parameter.
 
T & getValue ()
 Returns the value of the parameter.
 
T & getDefaultValue ()
 Returns the default value of the parameter.
 
virtual void setValueFromPythonObject (const boost::python::object &pyObject) final
 Implements a method for setting boost::python objects.
 
virtual void setValueToPythonObject (boost::python::object &pyObject, bool defaultValues=false) const final
 Returns a python object containing the value or the default value of the given parameter.
 
virtual void setValueFromParam (const ModuleParamBase &param) final
 Set value from other ModuleParam of same type.
 
void resetValue ()
 Resets the parameter value by assigning the default value to the parameter value.
 
const std::string & getTypeInfo () const
 Returns the type identifier of the parameter as string.
 
const std::string & getDescription () const
 Returns the description of the parameter.
 
bool isSetInSteering () const
 Returns true if the parameter was set in the steering file.
 
bool isForcedInSteering () const
 Returns true if the parameter has to be set by the user in the steering file.
 

Static Public Member Functions

static std::string TypeInfo ()
 Static function to generate a string description for the parameter type.
 

Protected Attributes

std::string m_typeInfo
 The type of the parameter stored as string.
 
std::string m_description
 The (optional) description of the parameter.
 
bool m_forceInSteering
 If true the parameter has to be set by the user in the steering file.
 
bool m_setInSteering
 True, if the parameter value was changed in the steering file.
 

Private Attributes

m_defaultValue {}
 The default value of the parameter.
 
T & m_paramVariable
 Reference to the member variable in the module which stores the parameter value.
 

Detailed Description

template<class T>
class Belle2::ModuleParam< T >

A single parameter of the module.

Implements a single parameter of the module as a template class. Inherits from the module parameter base class.

Definition at line 34 of file ModuleParam.h.

Member Function Documentation

◆ getDescription()

const std::string & getDescription ( ) const
inherited

Returns the description of the parameter.

Returns
The description of the parameter.

Definition at line 30 of file ModuleParamBase.cc.

31{
32 return m_description;
33}
std::string m_description
The (optional) description of the parameter.

◆ getTypeInfo()

const std::string & getTypeInfo ( ) const
inherited

Returns the type identifier of the parameter as string.

The type identifier is used to discriminate between problematic parameter types (e.g. double and int).

Returns
The type identifier as string.

Definition at line 25 of file ModuleParamBase.cc.

26{
27 return m_typeInfo;
28}
std::string m_typeInfo
The type of the parameter stored as string.

◆ isForcedInSteering()

bool isForcedInSteering ( ) const
inherited

Returns true if the parameter has to be set by the user in the steering file.

Returns
True if the parameter has to be set in the steering file.

Definition at line 40 of file ModuleParamBase.cc.

41{
42 return m_forceInSteering;
43}
bool m_forceInSteering
If true the parameter has to be set by the user in the steering file.

◆ isSetInSteering()

bool isSetInSteering ( ) const
inherited

Returns true if the parameter was set in the steering file.

If the value was not set in the steering file but is still the default value, this method returns false.

Returns
True if the parameter was set in the steering file.

Definition at line 35 of file ModuleParamBase.cc.

36{
37 return m_setInSteering;
38}
bool m_setInSteering
True, if the parameter value was changed in the steering file.

Member Data Documentation

◆ m_defaultValue

T m_defaultValue {}
private

The default value of the parameter.

Definition at line 121 of file ModuleParam.h.

◆ m_description

std::string m_description
protectedinherited

The (optional) description of the parameter.

Definition at line 113 of file ModuleParamBase.h.

◆ m_forceInSteering

bool m_forceInSteering
protectedinherited

If true the parameter has to be set by the user in the steering file.

Definition at line 116 of file ModuleParamBase.h.

◆ m_paramVariable

T& m_paramVariable
private

Reference to the member variable in the module which stores the parameter value.

Definition at line 124 of file ModuleParam.h.

◆ m_setInSteering

bool m_setInSteering
protectedinherited

True, if the parameter value was changed in the steering file.

Definition at line 119 of file ModuleParamBase.h.

◆ m_typeInfo

std::string m_typeInfo
protectedinherited

The type of the parameter stored as string.

Definition at line 110 of file ModuleParamBase.h.


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