ATLAS Offline Software
Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
HWIdentifier32 Class Reference

#include <HWIdentifier32.h>

Inheritance diagram for HWIdentifier32:
Collaboration diagram for HWIdentifier32:

Public Types

typedef Identifier32 id_type
 
typedef unsigned int value_type
 
typedef unsigned int size_type
 

Public Member Functions

 HWIdentifier32 ()
 Default constructor. More...
 
 HWIdentifier32 (value_type value)
 Constructor from value_type. More...
 
 HWIdentifier32 (const Identifier32 &old)
 Constructor from Identifier32. More...
 
 HWIdentifier32 (unsigned long long value)
 Constructor from a long value. More...
 
 HWIdentifier32 (const Identifier &old)
 Constructor from Identifier. More...
 
Identifier32operator|= (value_type value)
 Bitwise operations. More...
 
Identifier32operator&= (value_type value)
 
void clear ()
 Reset to invalid state. More...
 
value_type get_compact (void) const
 Get the compact id. More...
 
bool operator== (const Identifier32 &other) const
 
bool operator!= (const Identifier32 &other) const
 
bool operator< (const Identifier32 &other) const
 
bool operator> (const Identifier32 &other) const
 
bool operator<= (const Identifier32 &other) const
 
bool operator>= (const Identifier32 &other) const
 
bool is_valid () const
 Check if id is in a valid state. More...
 
std::string getString () const
 Provide a string form of the identifier - hexadecimal. More...
 
void show () const
 Print out in hex form. More...
 

Private Types

enum  max_value_type { max_value = 0xFFFFFFFF }
 

Private Attributes

value_type m_id
 

Detailed Description

Definition at line 14 of file HWIdentifier32.h.

Member Typedef Documentation

◆ id_type


Define public typedefs

Definition at line 32 of file Identifier32.h.

◆ size_type

typedef unsigned int Identifier32::size_type
inherited

Definition at line 34 of file Identifier32.h.

◆ value_type

typedef unsigned int Identifier32::value_type
inherited

Definition at line 33 of file Identifier32.h.

Member Enumeration Documentation

◆ max_value_type

enum Identifier32::max_value_type
privateinherited
Enumerator
max_value 

Definition at line 103 of file Identifier32.h.

103  {
104  max_value = 0xFFFFFFFF
105  } max_value_type;

Constructor & Destructor Documentation

◆ HWIdentifier32() [1/5]

HWIdentifier32::HWIdentifier32 ( )
inline

Default constructor.

Definition at line 35 of file HWIdentifier32.h.

37 {}

◆ HWIdentifier32() [2/5]

HWIdentifier32::HWIdentifier32 ( value_type  value)
inlineexplicit

Constructor from value_type.

Definition at line 39 of file HWIdentifier32.h.

◆ HWIdentifier32() [3/5]

HWIdentifier32::HWIdentifier32 ( const Identifier32 old)
inlineexplicit

Constructor from Identifier32.

Definition at line 43 of file HWIdentifier32.h.

◆ HWIdentifier32() [4/5]

HWIdentifier32::HWIdentifier32 ( unsigned long long  value)
inlineexplicit

Constructor from a long value.

Definition at line 47 of file HWIdentifier32.h.

49 {
50  bool hi = (value >> 32);
51  bool lo = (value << 32);
52  if (hi && lo) return; // full 64-bit identifier, so return invalid
53  //if (hi) m_id = (static_cast<value_type>(value >> 32));
54  //else if (lo) m_id = (static_cast<value_type>(value));
55  if (hi) {
56  const HWIdentifier32 myid(value >> 32);
57  this->operator=(myid);
58  } else if (lo) {
59  const HWIdentifier32 myid(value);
60  this->operator=(myid);
61  } else {
62  const HWIdentifier32 myid(static_cast<value_type>(0));
63  this->operator=(myid);
64  }
65 }

◆ HWIdentifier32() [5/5]

HWIdentifier32::HWIdentifier32 ( const Identifier old)
inlineexplicit

Constructor from Identifier.

Definition at line 67 of file HWIdentifier32.h.

68  : Identifier32::Identifier32(old.get_identifier32().get_compact())
69 { }

Member Function Documentation

◆ clear()

void Identifier32::clear ( )
inlineinherited

Reset to invalid state.

Definition at line 164 of file Identifier32.h.

165 {
166  m_id = max_value;
167 }

◆ get_compact()

Identifier32::value_type Identifier32::get_compact ( void  ) const
inlineinherited

Get the compact id.


Accessors

Definition at line 171 of file Identifier32.h.

172 {
173  return (m_id);
174 }

◆ getString()

std::string Identifier32::getString ( ) const
inherited

Provide a string form of the identifier - hexadecimal.


Utilities

Definition at line 16 of file Identifier32.cxx.

17 {
18  std::string result;
19  char temp[20];
20 
21  sprintf (temp, "0x%x", (unsigned int)m_id);
22  result += temp;
23  return (result);
24 }

◆ is_valid()

bool Identifier32::is_valid ( ) const
inlineinherited

Check if id is in a valid state.


Error management

Definition at line 220 of file Identifier32.h.

221 {
222  return (!(max_value == m_id));
223 }

◆ operator!=()

bool Identifier32::operator!= ( const Identifier32 other) const
inlineinherited

Definition at line 186 of file Identifier32.h.

187 {
188  return (m_id != other.m_id);
189 }

◆ operator&=()

Identifier32 & Identifier32::operator&= ( value_type  value)
inlineinherited

Definition at line 157 of file Identifier32.h.

158 {
159  m_id &= value;
160  return (*this);
161 }

◆ operator<()

bool Identifier32::operator< ( const Identifier32 other) const
inlineinherited

Definition at line 192 of file Identifier32.h.

194 {
195  return (m_id < other.m_id);
196 }

◆ operator<=()

bool Identifier32::operator<= ( const Identifier32 other) const
inlineinherited

Definition at line 206 of file Identifier32.h.

208 {
209  return (m_id <= other.m_id);
210 }

◆ operator==()

bool Identifier32::operator== ( const Identifier32 other) const
inlineinherited

Comparison operators

Definition at line 179 of file Identifier32.h.

180 {
181  return (m_id == other.m_id);
182 }

◆ operator>()

bool Identifier32::operator> ( const Identifier32 other) const
inlineinherited

Definition at line 200 of file Identifier32.h.

201 {
202  return (m_id > other.m_id);
203 }

◆ operator>=()

bool Identifier32::operator>= ( const Identifier32 other) const
inlineinherited

Definition at line 214 of file Identifier32.h.

215 {
216  return (m_id >= other.m_id);
217 }

◆ operator|=()

Identifier32 & Identifier32::operator|= ( value_type  value)
inlineinherited

Bitwise operations.

Definition at line 150 of file Identifier32.h.

151 {
152  m_id |= value;
153  return (*this);
154 }

◆ show()

void Identifier32::show ( ) const
inherited

Print out in hex form.

Definition at line 27 of file Identifier32.cxx.

28 {
31  const Identifier32& me = *this;
32  std::cout << me.getString();
33 }

Member Data Documentation

◆ m_id

value_type Identifier32::m_id
privateinherited

Definition at line 110 of file Identifier32.h.


The documentation for this class was generated from the following file:
Identifier32
Definition: Identifier32.h:25
get_generator_info.result
result
Definition: get_generator_info.py:21
Identifier32::max_value_type
max_value_type
Definition: Identifier32.h:103
Identifier32::operator=
Identifier32 & operator=(const Identifier32 &other)=default
Assignment.
athena.value
value
Definition: athena.py:122
HWIdentifier32
Definition: HWIdentifier32.h:14
Identifier32::max_value
@ max_value
Definition: Identifier32.h:104
Identifier32::Identifier32
Identifier32()
Default constructor.
Definition: Identifier32.h:129
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
CSV_InDetExporter.old
old
Definition: CSV_InDetExporter.py:145
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