Belle II Software  release-05-02-19
ModuleParamBase.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Andreas Moll *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <string>
14 
15 namespace boost {
16  namespace python {
17  namespace api {
18  class object;
19  }
20  using api::object;
21  }
22 }
23 
24 namespace Belle2 {
34 
35  public:
43  ModuleParamBase(std::string typeInfo, std::string description, bool force);
44 
48  virtual ~ModuleParamBase();
49 
57  const std::string& getTypeInfo() const;
58 
64  const std::string& getDescription() const;
65 
74  bool isSetInSteering() const;
75 
81  bool isForcedInSteering() const;
82 
91  virtual void setValueFromPythonObject(const boost::python::object& pyObject) = 0;
92 
104  virtual void
105  setValueToPythonObject(boost::python::object& pyObject, bool defaultValues = false) const = 0;
106 
108  virtual void setValueFromParam(const ModuleParamBase& param) = 0;
109 
110  protected:
112  std::string m_typeInfo;
113 
115  std::string m_description;
116 
119 
122  };
124 } // end of Belle2 namespace
Belle2::ModuleParamBase::setValueToPythonObject
virtual void setValueToPythonObject(boost::python::object &pyObject, bool defaultValues=false) const =0
Pure virtual function.
Belle2::ModuleParamBase::~ModuleParamBase
virtual ~ModuleParamBase()
Destructor.
Belle2::ModuleParamBase::isForcedInSteering
bool isForcedInSteering() const
Returns true if the parameter has to be set by the user in the steering file.
Definition: ModuleParamBase.cc:42
Belle2::ModuleParamBase::isSetInSteering
bool isSetInSteering() const
Returns true if the parameter was set in the steering file.
Definition: ModuleParamBase.cc:37
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ModuleParamBase::getTypeInfo
const std::string & getTypeInfo() const
Returns the type identifier of the parameter as string.
Definition: ModuleParamBase.cc:27
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
Base class for module parameter.
Definition: ModuleParamBase.h:33
Belle2::ModuleParamBase::setValueFromParam
virtual void setValueFromParam(const ModuleParamBase &param)=0
Set value from other ModuleParam of same type.
Belle2::ModuleParamBase::setValueFromPythonObject
virtual void setValueFromPythonObject(const boost::python::object &pyObject)=0
Pure virtual function.
Belle2::ModuleParamBase::m_description
std::string m_description
The (optional) description of the parameter.
Definition: ModuleParamBase.h:115
Belle2::ModuleParamBase::getDescription
const std::string & getDescription() const
Returns the description of the parameter.
Definition: ModuleParamBase.cc:32
Belle2::ModuleParamBase::m_setInSteering
bool m_setInSteering
True, if the parameter value was changed in the steering file.
Definition: ModuleParamBase.h:121
Belle2::ModuleParamBase::ModuleParamBase
ModuleParamBase(std::string typeInfo, std::string description, bool force)
Constructor.
Definition: ModuleParamBase.cc:17