Belle II Software  release-08-01-10
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 
13 namespace boost {
14  namespace python {
15  namespace api {
16  class object;
17  }
18  using api::object;
19  }
20 }
21 
22 namespace Belle2 {
32 
33  public:
41  ModuleParamBase(std::string typeInfo, std::string description, bool force);
42 
46  virtual ~ModuleParamBase();
47 
55  const std::string& getTypeInfo() const;
56 
62  const std::string& getDescription() const;
63 
72  bool isSetInSteering() const;
73 
79  bool isForcedInSteering() const;
80 
89  virtual void setValueFromPythonObject(const boost::python::object& pyObject) = 0;
90 
102  virtual void
103  setValueToPythonObject(boost::python::object& pyObject, bool defaultValues = false) const = 0;
104 
106  virtual void setValueFromParam(const ModuleParamBase& param) = 0;
107 
108  protected:
110  std::string m_typeInfo;
111 
113  std::string m_description;
114 
117 
120  };
122 } // end of Belle2 namespace
Base class for module parameter.
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.