ATLAS Offline Software
Parameter.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 /* Parameter.h
5  * L1TopoInterfaces
6  *
7  * This class describes Parameters that an algorithm can carry
8  *
9  *
10  *
11  */
12 
13 #ifndef L1TOPOINTERFACES_PARAMETER_H
14 #define L1TOPOINTERFACES_PARAMETER_H
15 
16 #include <iostream>
17 #include <string>
18 #include <stdint.h>
19 
20 namespace TCS {
21 
23 
24  class Parameter {
25  public:
26 
27  Parameter(const std::string & name, TCS::parType_t value);
28  Parameter(const std::string & name, TCS::parType_t value, unsigned int selection);
29 
31 
32  // accessors
33  const std::string & name() const { return m_name; }
34  unsigned int selection() const { return m_selection; }
35  parType_t value() const { return m_value; }
36  unsigned int position() const { return m_position; }
38  bool isDefault() const { return m_isDefault; }
39  bool isExtended() const { return m_isExtended; }
40  parType_t operator()() const { return m_value; }
41 
42  // new accessors
43  const std::string & val() const { return m_val; }
44  const std::string& defaultVal() const { return m_defaultVal; }
45  unsigned int pos() const { return m_pos; }
46  const std::string & sel() const { return m_sel; }
47 
48  // setters
49  void setName(const std::string& name) { m_name = name; }
55 
56  // new setters
57  void setVal(const std::string& val) { m_val = val; }
58  void setPos(unsigned int pos) { m_pos = pos; }
59  void setSel(const std::string& sel) { m_sel = sel; }
60 
61  private:
62 
63  std::string m_name; // parameter name
64  parType_t m_value {0}; // parameter value
65  unsigned int m_position {0}; // parameter position
66  unsigned int m_selection {0}; // parameter selection
67  parType_t m_defaultValue {0}; // default value
68  bool m_isDefault {true}; // indicates if the value has been overwritten, the logic of this is defined by the outside
69  bool m_isExtended {false};
70 
71  // new private vars
72  std::string m_val;
73  unsigned int m_pos{0};
74  std::string m_sel;
75  std::string m_defaultVal;
76  };
77 
78 std::ostream & operator<<(std::ostream &, const TCS::Parameter&);
79 
80 } // end of namespace TCS
81 
82 #endif /* defined(L1TOPOINTERFACES_PARAMETER_H) */
TCS::Parameter::m_defaultValue
parType_t m_defaultValue
Definition: Parameter.h:67
TCS::Parameter
Definition: Parameter.h:24
TCS::Parameter::setVal
void setVal(const std::string &val)
Definition: Parameter.h:57
TCS::Parameter::m_sel
std::string m_sel
Definition: Parameter.h:74
TCS::Parameter::m_position
unsigned int m_position
Definition: Parameter.h:65
TCS::Parameter::m_isExtended
bool m_isExtended
Definition: Parameter.h:69
TCS::parType_t
uint32_t parType_t
Definition: Parameter.h:22
TCS::Parameter::defaultVal
const std::string & defaultVal() const
Definition: Parameter.h:44
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TCS::Parameter::name
const std::string & name() const
Definition: Parameter.h:33
TCS::Parameter::m_defaultVal
std::string m_defaultVal
Definition: Parameter.h:75
TCS::Parameter::m_selection
unsigned int m_selection
Definition: Parameter.h:66
TCS::Parameter::operator()
parType_t operator()() const
Definition: Parameter.h:40
TCS::Parameter::setPos
void setPos(unsigned int pos)
Definition: Parameter.h:58
TCS::Parameter::m_name
std::string m_name
Definition: Parameter.h:63
TCS::Parameter::val
const std::string & val() const
Definition: Parameter.h:43
TCS::Parameter::selection
unsigned int selection() const
Definition: Parameter.h:34
TCS::Parameter::sel
const std::string & sel() const
Definition: Parameter.h:46
TCS::Parameter::setSel
void setSel(const std::string &sel)
Definition: Parameter.h:59
TCS::Parameter::m_value
parType_t m_value
Definition: Parameter.h:64
TCS::Parameter::pos
unsigned int pos() const
Definition: Parameter.h:45
TCS::Parameter::defaultValue
parType_t defaultValue() const
Definition: Parameter.h:37
TCS::Parameter::isDefault
bool isDefault() const
Definition: Parameter.h:38
sel
sel
Definition: SUSYToolsTester.cxx:97
TCS::Parameter::setIsDefault
void setIsDefault(bool isDefault)
Definition: Parameter.h:53
TCS::Parameter::setSelection
void setSelection(parType_t selection)
Definition: Parameter.h:50
TCS::Parameter::m_isDefault
bool m_isDefault
Definition: Parameter.h:68
TCS::Parameter::position
unsigned int position() const
Definition: Parameter.h:36
TCS::Parameter::setName
void setName(const std::string &name)
Definition: Parameter.h:49
TCS::Parameter::setPosition
void setPosition(parType_t position)
Definition: Parameter.h:52
TCS::Parameter::Parameter
Parameter(const std::string &name, TCS::parType_t value, unsigned int selection)
TCS::Parameter::setValue
void setValue(parType_t value)
Definition: Parameter.h:51
TCS::Parameter::setIsExtended
void setIsExtended(bool isExtended)
Definition: Parameter.h:54
TCS::Parameter::Parameter
Parameter(const std::string &name, TCS::parType_t value)
Definition: Parameter.cxx:13
TCS::Parameter::isExtended
bool isExtended() const
Definition: Parameter.h:39
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
TCS::Parameter::m_val
std::string m_val
Definition: Parameter.h:72
TCS::Parameter::m_pos
unsigned int m_pos
Definition: Parameter.h:73
TCS::Parameter::value
parType_t value() const
Definition: Parameter.h:35
TCS::operator<<
std::ostream & operator<<(std::ostream &, const TCS::CountingConnector &)
Definition: CountingConnector.cxx:93
TCS::Parameter::~Parameter
~Parameter()
Definition: Parameter.h:30