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

#include <HWIdentifier32.h>

Inheritance diagram for HWIdentifier32:
Collaboration diagram for HWIdentifier32:

Public Types

using id_type = Identifier32
 
using value_type = unsigned int
 
using size_type = unsigned int
 

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 () const
 Get the compact id. More...
 
auto operator (const Identifier32 &) const =default
 
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...
 
 operator std::string () const
 

Private Attributes

value_type m_id {m_maxValue}
 

Static Private Attributes

static constexpr value_type m_maxValue {0xFFFFFFFF}
 

Detailed Description

Definition at line 14 of file HWIdentifier32.h.

Member Typedef Documentation

◆ id_type

Definition at line 27 of file Identifier32.h.

◆ size_type

using Identifier32::size_type = unsigned int
inherited

Definition at line 29 of file Identifier32.h.

◆ value_type

using Identifier32::value_type = unsigned int
inherited

Definition at line 28 of file Identifier32.h.

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 41 of file Identifier32.h.

41 {m_id = m_maxValue;}

◆ get_compact()

value_type Identifier32::get_compact ( ) const
inlineinherited

Get the compact id.

Definition at line 44 of file Identifier32.h.

44 { return m_id;}

◆ getString()

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

Provide a string form of the identifier - hexadecimal.

Definition at line 12 of file Identifier32.cxx.

12  {
13  std::string s = std::format("0x{:x}", m_id);
14  return s;
15 }

◆ is_valid()

bool Identifier32::is_valid ( ) const
inlineinherited

Check if id is in a valid state.

Definition at line 50 of file Identifier32.h.

50 {return m_id != m_maxValue;}

◆ operator()

auto Identifier32::operator ( const Identifier32 ) const
defaultinherited

◆ operator std::string()

Identifier32::operator std::string ( ) const
inlineexplicitinherited

Definition at line 59 of file Identifier32.h.

59 {return getString();}

◆ operator&=()

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

Definition at line 74 of file Identifier32.h.

74  {
75  m_id &= value;
76  return (*this);
77 }

◆ operator|=()

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

Bitwise operations.

Definition at line 68 of file Identifier32.h.

68  {
69  m_id |= value;
70  return (*this);
71 }

◆ show()

void Identifier32::show ( ) const
inherited

Print out in hex form.

Definition at line 17 of file Identifier32.cxx.

17  {
18  std::cout << *this;
19 }

Member Data Documentation

◆ m_id

value_type Identifier32::m_id {m_maxValue}
privateinherited

Definition at line 63 of file Identifier32.h.

◆ m_maxValue

constexpr value_type Identifier32::m_maxValue {0xFFFFFFFF}
staticconstexprprivateinherited

Definition at line 62 of file Identifier32.h.


The documentation for this class was generated from the following file:
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
vtune_athena.format
format
Definition: vtune_athena.py:14
Identifier32::m_maxValue
static constexpr value_type m_maxValue
Definition: Identifier32.h:62
athena.value
value
Definition: athena.py:124
HWIdentifier32
Definition: HWIdentifier32.h:14
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:63
Identifier32::getString
std::string getString() const
Provide a string form of the identifier - hexadecimal.
Definition: Identifier32.cxx:12
Identifier32::Identifier32
Identifier32()=default