ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | Static Private Attributes | List of all members
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) 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


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){}

Member Function Documentation

◆ clear()

void Identifier32::clear ( )
inline

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

auto Identifier32::operator ( const Identifier32 ) const
default

◆ operator std::string()

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

Definition at line 59 of file Identifier32.h.

59 {return getString();}

◆ operator&=()

Definition at line 74 of file Identifier32.h.

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

◆ operator|=()

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

constexpr value_type Identifier32::m_maxValue {0xFFFFFFFF}
staticconstexprprivate

Definition at line 62 of file Identifier32.h.


The documentation for this class was generated from the following files:
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
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