ATLAS Offline Software
Loading...
Searching...
No Matches
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
11public:
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
19private:
20 std::string m_name;
21 bool m_valued{};
22 int m_value{};
23};
24
25
26inline
27IdDictLabel::IdDictLabel (const std::string& name)
28 : m_name (name),
29 m_valued (false)
30{
31}
32
33
34inline
35IdDictLabel::IdDictLabel (const std::string& name, int value)
36 : m_name (name),
37 m_valued (true),
39{
40}
41
42
43inline
44const std::string& IdDictLabel::name() const
45{
46 return m_name;
47}
48
49
50inline
52{
53 return m_valued ? m_value : 0;
54}
55
56
57inline
59{
60 return m_valued;
61}
62
63
64#endif
65
IdDictLabel(const std::string &name)
Definition IdDictLabel.h:27
int value() const
Definition IdDictLabel.h:51
std::string m_name
Definition IdDictLabel.h:20
bool valued() const
Definition IdDictLabel.h:58
const std::string & name() const
Definition IdDictLabel.h:44