Belle II Software  release-05-02-19
ModuleParamBase Class Referenceabstract

Base class for module parameter. More...

#include <ModuleParamBase.h>

Collaboration diagram for ModuleParamBase:

Public Member Functions

 ModuleParamBase (std::string typeInfo, std::string description, bool force)
 Constructor. More...
 
virtual ~ModuleParamBase ()
 Destructor.
 
const std::string & getTypeInfo () const
 Returns the type identifier of the parameter as string. More...
 
const std::string & getDescription () const
 Returns the description of the parameter. More...
 
bool isSetInSteering () const
 Returns true if the parameter was set in the steering file. More...
 
bool isForcedInSteering () const
 Returns true if the parameter has to be set by the user in the steering file. More...
 
virtual void setValueFromPythonObject (const boost::python::object &pyObject)=0
 Pure virtual function. More...
 
virtual void setValueToPythonObject (boost::python::object &pyObject, bool defaultValues=false) const =0
 Pure virtual function. More...
 
virtual void setValueFromParam (const ModuleParamBase &param)=0
 Set value from other ModuleParam of same 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.
 

Detailed Description

Base class for module parameter.

The base class stores all common information for parameters.

Definition at line 33 of file ModuleParamBase.h.

Constructor & Destructor Documentation

◆ ModuleParamBase()

ModuleParamBase ( std::string  typeInfo,
std::string  description,
bool  force 
)

Constructor.

Parameters
typeInfoThe type string of the parameter.
descriptionThe description of the parameter.
forceIf true the parameter has to be set in the steering file by the user.

Definition at line 17 of file ModuleParamBase.cc.

18  : m_typeInfo(std::move(typeInfo))
19  , m_description(std::move(description))
20  , m_forceInSteering(force)
21  , m_setInSteering(false)
22 {
23 }

Member Function Documentation

◆ getDescription()

const std::string & getDescription ( ) const

Returns the description of the parameter.

Returns
The description of the parameter.

Definition at line 32 of file ModuleParamBase.cc.

◆ getTypeInfo()

const std::string & getTypeInfo ( ) const

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 27 of file ModuleParamBase.cc.

◆ isForcedInSteering()

bool isForcedInSteering ( ) const

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 42 of file ModuleParamBase.cc.

◆ isSetInSteering()

bool isSetInSteering ( ) const

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 37 of file ModuleParamBase.cc.

◆ setValueFromPythonObject()

virtual void setValueFromPythonObject ( const boost::python::object &  pyObject)
pure virtual

Pure virtual function.

Set the value of the parameter from a python object. The derived templated ModuleParam class calls the converter functions in PyObjConvUtils.h with the right template arguments. Hence the compiler can automatically infer the right converter.

Parameters
pyObjectThe python object which holds the parameter value

◆ setValueToPythonObject()

virtual void setValueToPythonObject ( boost::python::object &  pyObject,
bool  defaultValues = false 
) const
pure virtual

Pure virtual function.

Set the value of a python objects to stored parameter value. The derived templated ModuleParam class calls the converter functions in PyObjConvUtils.h with the right template arguments. Hence the compiler can automatically infer the right converters

Parameters
pyObjectThe python object which should be filled with the parameter value
defaultValuesIf true, the python object is set to the default value of this parameter.

The documentation for this class was generated from the following files:
Belle2::ModuleParamBase::m_forceInSteering
bool m_forceInSteering
If true the parameter has to be set by the user in the steering file.
Definition: ModuleParamBase.h:118
Belle2::ModuleParamBase::m_typeInfo
std::string m_typeInfo
The type of the parameter stored as string.
Definition: ModuleParamBase.h:112
Belle2::ModuleParamBase::m_description
std::string m_description
The (optional) description of the parameter.
Definition: ModuleParamBase.h:115
Belle2::ModuleParamBase::m_setInSteering
bool m_setInSteering
True, if the parameter value was changed in the steering file.
Definition: ModuleParamBase.h:121