ATLAS Offline Software
Loading...
Searching...
No Matches
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.
 HWIdentifier32 (value_type value)
 Constructor from value_type.
 HWIdentifier32 (const Identifier32 &old)
 Constructor from Identifier32.
 HWIdentifier32 (unsigned long long value)
 Constructor from a long value.
 HWIdentifier32 (const Identifier &old)
 Constructor from Identifier.
Identifier32operator|= (value_type value)
 Bitwise operations.
Identifier32operator&= (value_type value)
void clear ()
 Reset to invalid state.
value_type get_compact () const
 Get the compact id.
auto operator<=> (const Identifier32 &) const =default
bool is_valid () const
 Check if id is in a valid state.
std::string getString () const
 Provide a string form of the identifier - hexadecimal.
void show () const
 Print out in hex form.
 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{}
Identifier32()=default

◆ HWIdentifier32() [2/5]

HWIdentifier32::HWIdentifier32 ( value_type value)
inlineexplicit

Constructor from value_type.

Definition at line 39 of file HWIdentifier32.h.

41{}

◆ 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()
Default constructor.
unsigned int value_type

◆ 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.

static constexpr value_type m_maxValue
value_type m_id

◆ 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 std::string()

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

Definition at line 59 of file Identifier32.h.

59{return getString();}
std::string getString() const
Provide a string form of the identifier - hexadecimal.

◆ 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<=>()

auto Identifier32::operator<=> ( const Identifier32 & ) const
defaultinherited

◆ 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

value_type Identifier32::m_maxValue {0xFFFFFFFF}
staticconstexprprivateinherited

Definition at line 62 of file Identifier32.h.

62{0xFFFFFFFF};

The documentation for this class was generated from the following file: