ATLAS Offline Software
Loading...
Searching...
No Matches
Identifier32 Class Reference

#include <Identifier32.h>

Inheritance diagram for Identifier32:
Collaboration diagram for Identifier32:

Public Types

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

Public Member Functions

 Identifier32 ()=default
 Identifier32 (value_type value)
 Constructor from value_type (unsigned int)
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


Identifier32 is a simple type-safe 32 bit unsigned integer. An Identifier32 relies on other classes - IdHelpers - to encode and decode its information.

The default constructor creates an Identifier32 in an invalid state which can be used to check with the "is_valid" method to allow some error checking.


Definition at line 25 of file Identifier32.h.

Member Typedef Documentation

◆ id_type

Definition at line 27 of file Identifier32.h.

◆ size_type

using Identifier32::size_type = unsigned int

Definition at line 29 of file Identifier32.h.

◆ value_type

using Identifier32::value_type = unsigned int

Definition at line 28 of file Identifier32.h.

Constructor & Destructor Documentation

◆ Identifier32() [1/2]

Identifier32::Identifier32 ( )
default

◆ Identifier32() [2/2]

Identifier32::Identifier32 ( value_type value)
inlineexplicit

Constructor from value_type (unsigned int)

Definition at line 34 of file Identifier32.h.

34:m_id(value){}
value_type m_id

Member Function Documentation

◆ clear()

void Identifier32::clear ( )
inline

Reset to invalid state.

Definition at line 41 of file Identifier32.h.

static constexpr value_type m_maxValue

◆ get_compact()

value_type Identifier32::get_compact ( ) const
inline

Get the compact id.

Definition at line 44 of file Identifier32.h.

44{ return m_id;}

◆ getString()

std::string Identifier32::getString ( ) const

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
inline

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
inlineexplicit

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)
inline

Definition at line 74 of file Identifier32.h.

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

◆ operator<=>()

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

◆ operator|=()

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

Bitwise operations.

Definition at line 68 of file Identifier32.h.

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

◆ show()

void Identifier32::show ( ) const

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}
private

Definition at line 63 of file Identifier32.h.

◆ m_maxValue

value_type Identifier32::m_maxValue {0xFFFFFFFF}
staticconstexprprivate

Definition at line 62 of file Identifier32.h.

62{0xFFFFFFFF};

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