ATLAS Offline Software
Identifier32.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef __Identifier32_h__
6 #define __Identifier32_h__
7 
8 #include <vector>
9 #include <string>
10 
25 {
26 public:
27 
28 
33  typedef unsigned int value_type;
34  typedef unsigned int size_type;
35 
39 
41  Identifier32 ();
42 
44  explicit Identifier32 (value_type value);
45 
47  Identifier32 (const Identifier32& other) = default;
48 
51 
55 
58 
62 
64  void clear ();
65 
69 
71  value_type get_compact (void) const;
72 
76 
77  bool operator == (const Identifier32& other) const;
78  bool operator != (const Identifier32& other) const;
79  bool operator < (const Identifier32& other) const;
80  bool operator > (const Identifier32& other) const;
81  bool operator <= (const Identifier32& other) const;
82  bool operator >= (const Identifier32& other) const;
83 
87 
89  bool is_valid () const;
90 
94 
96  std::string getString() const;
97 
99  void show () const;
100 
101 private:
102 
103  typedef enum {
104  max_value = 0xFFFFFFFF
106 
107  //----------------------------------------------------------------
108  // The compact identifier data.
109  //----------------------------------------------------------------
111 
112 };
113 //-----------------------------------------------
114 
115 
116 
117 
118 
119 
120 
121 
122 
123 
124 //<<<<<< INLINE MEMBER FUNCTIONS >>>>>>
125 
126 
127 // Constructors
128 //-----------------------------------------------
130  : m_id(max_value)
131 {}
132 
133 
134 //-----------------------------------------------
136  : m_id(value)
137 {}
138 
139 // Modifications
140 //-----------------------------------------------
141 
142 inline Identifier32&
144 {
145  m_id = value;
146  return (*this);
147 }
148 
149 inline Identifier32&
151 {
152  m_id |= value;
153  return (*this);
154 }
155 
156 inline Identifier32&
158 {
159  m_id &= value;
160  return (*this);
161 }
162 
163 inline void
165 {
166  m_id = max_value;
167 }
168 
169 // Accessors
170 
172 {
173  return (m_id);
174 }
175 
176 // Comparison operators
177 //----------------------------------------------------------------
178 inline bool
180 {
181  return (m_id == other.m_id);
182 }
183 
184 //----------------------------------------------------------------
185 inline bool
187 {
188  return (m_id != other.m_id);
189 }
190 
191 //-----------------------------------------------
192 inline bool
194 {
195  return (m_id < other.m_id);
196 }
197 
198 //-----------------------------------------------
199 inline bool
201 {
202  return (m_id > other.m_id);
203 }
204 
205 //-----------------------------------------------
206 inline bool
208 {
209  return (m_id <= other.m_id);
210 }
211 
212 //-----------------------------------------------
213 inline bool
215 {
216  return (m_id >= other.m_id);
217 }
218 
219 inline bool
221 {
222  return (!(max_value == m_id));
223 }
224 
225 #endif
Identifier32::show
void show() const
Print out in hex form.
Definition: Identifier32.cxx:27
Identifier32::operator<=
bool operator<=(const Identifier32 &other) const
Definition: Identifier32.h:207
Identifier32::is_valid
bool is_valid() const
Check if id is in a valid state.
Definition: Identifier32.h:220
Identifier32
Definition: Identifier32.h:25
Identifier32::max_value_type
max_value_type
Definition: Identifier32.h:103
Identifier32::value_type
unsigned int value_type
Definition: Identifier32.h:33
Identifier32::operator=
Identifier32 & operator=(const Identifier32 &other)=default
Assignment.
Identifier32::operator>
bool operator>(const Identifier32 &other) const
Definition: Identifier32.h:200
athena.value
value
Definition: athena.py:122
Identifier32::Identifier32
Identifier32(const Identifier32 &other)=default
Copy constructor.
Identifier32::max_value
@ max_value
Definition: Identifier32.h:104
Identifier32::size_type
unsigned int size_type
Definition: Identifier32.h:34
Identifier32::operator==
bool operator==(const Identifier32 &other) const
Definition: Identifier32.h:179
Identifier32::operator<
bool operator<(const Identifier32 &other) const
Definition: Identifier32.h:193
Identifier32::operator|=
Identifier32 & operator|=(value_type value)
Bitwise operations.
Definition: Identifier32.h:150
Identifier32::get_compact
value_type get_compact(void) const
Get the compact id.
Definition: Identifier32.h:171
Identifier32::operator&=
Identifier32 & operator&=(value_type value)
Definition: Identifier32.h:157
Identifier32::operator>=
bool operator>=(const Identifier32 &other) const
Definition: Identifier32.h:214
Identifier32::operator!=
bool operator!=(const Identifier32 &other) const
Definition: Identifier32.h:186
Identifier32::Identifier32
Identifier32()
Default constructor.
Definition: Identifier32.h:129
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
Identifier32::clear
void clear()
Reset to invalid state.
Definition: Identifier32.h:164
Identifier32::id_type
Identifier32 id_type
Definition: Identifier32.h:32
value_type
Definition: EDM_MasterSearch.h:11
Identifier32::m_id
value_type m_id
Definition: Identifier32.h:110
Identifier32::getString
std::string getString() const
Provide a string form of the identifier - hexadecimal.
Definition: Identifier32.cxx:16