ATLAS Offline Software
IdDictLabel.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef IDDICT_IdDictLabel_H
6 #define IDDICT_IdDictLabel_H
7 
8 #include <string>
9 
10 class IdDictLabel {
11 public:
12  IdDictLabel (const std::string& name);
13  IdDictLabel (const std::string& name, int value);
14 
15  const std::string& name() const;
16  int value() const;
17  bool valued() const;
18 
19 private:
20  std::string m_name;
21  bool m_valued{};
22  int m_value{};
23 };
24 
25 
26 inline
27 IdDictLabel::IdDictLabel (const std::string& name)
28  : m_name (name),
29  m_valued (false)
30 {
31 }
32 
33 
34 inline
35 IdDictLabel::IdDictLabel (const std::string& name, int value)
36  : m_name (name),
37  m_valued (true),
38  m_value (value)
39 {
40 }
41 
42 
43 inline
44 const std::string& IdDictLabel::name() const
45 {
46  return m_name;
47 }
48 
49 
50 inline
51 int IdDictLabel::value() const
52 {
53  return m_valued ? m_value : 0;
54 }
55 
56 
57 inline
58 bool IdDictLabel::valued() const
59 {
60  return m_valued;
61 }
62 
63 
64 #endif
65 
IdDictLabel::value
int value() const
Definition: IdDictLabel.h:51
IdDictLabel::m_value
int m_value
Definition: IdDictLabel.h:22
athena.value
value
Definition: athena.py:124
IdDictLabel::valued
bool valued() const
Definition: IdDictLabel.h:58
m_name
std::string m_name
Definition: ColumnarPhysliteTest.cxx:63
IdDictLabel
Definition: IdDictLabel.h:10
IdDictLabel::name
const std::string & name() const
Definition: IdDictLabel.h:44
IdDictLabel::m_valued
bool m_valued
Definition: IdDictLabel.h:21
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
IdDictLabel::IdDictLabel
IdDictLabel(const std::string &name)
Definition: IdDictLabel.h:27
IdDictLabel::m_name
std::string m_name
Definition: IdDictLabel.h:20