Belle II Software development
ModuleParamBase.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <string>
12
13namespace boost {
14 namespace python {
15 namespace api {
16 class object;
17 }
18 using api::object;
19 }
20}
21
22namespace Belle2 {
32
33 public:
41 ModuleParamBase(std::string typeInfo, std::string description, bool force);
42
47
55 const std::string& getTypeInfo() const;
56
62 const std::string& getDescription() const;
63
70 void setDescription(const std::string& description);
71
80 bool isSetInSteering() const;
81
87 bool isForcedInSteering() const;
88
97 virtual void setValueFromPythonObject(const boost::python::object& pyObject) = 0;
98
110 virtual void
111 setValueToPythonObject(boost::python::object& pyObject, bool defaultValues = false) const = 0;
112
114 virtual void setValueFromParam(const ModuleParamBase& param) = 0;
115
116 protected:
118 std::string m_typeInfo;
119
121 std::string m_description;
122
125
128 };
129
130} // end of Belle2 namespace
void setDescription(const std::string &description)
Sets description to new value.
virtual void setValueFromPythonObject(const boost::python::object &pyObject)=0
Pure virtual function.
virtual void setValueToPythonObject(boost::python::object &pyObject, bool defaultValues=false) const =0
Pure virtual function.
ModuleParamBase(std::string typeInfo, std::string description, bool force)
Constructor.
const std::string & getDescription() const
Returns the description of the parameter.
virtual ~ModuleParamBase()
Destructor.
const std::string & getTypeInfo() const
Returns the type identifier of the parameter as string.
bool isForcedInSteering() const
Returns true if the parameter has to be set by the user in the steering file.
bool m_forceInSteering
If true the parameter has to be set by the user in the steering file.
std::string m_typeInfo
The type of the parameter stored as string.
bool m_setInSteering
True, if the parameter value was changed in the steering file.
std::string m_description
The (optional) description of the parameter.
virtual void setValueFromParam(const ModuleParamBase &param)=0
Set value from other ModuleParam of same type.
bool isSetInSteering() const
Returns true if the parameter was set in the steering file.
Abstract base class for different kinds of events.