ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DetectorDescription
Identifier
Identifier
Identifier32.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef __Identifier32_h__
6
#define __Identifier32_h__
7
8
9
#include <vector>
10
#include <string>
11
#include <iosfwd>
12
13
class
MsgStream;
14
28
class
Identifier32
{
29
public
:
30
using
id_type
=
Identifier32
;
31
using
value_type
=
unsigned
int;
32
using
size_type
=
unsigned
int;
33
34
Identifier32
() =
default
;
35
37
inline
explicit
Identifier32
(
value_type
value):
m_id
(value){}
38
40
Identifier32
&
operator |=
(
value_type
value);
41
Identifier32
&
operator &=
(
value_type
value);
42
44
inline
void
clear
() {
m_id
=
m_maxValue
;}
45
47
inline
value_type
get_compact
()
const
{
return
m_id
;}
48
49
//All comparisons, since C++20
50
auto
operator<=>
(
const
Identifier32
&)
const
=
default
;
51
53
inline
bool
is_valid
()
const
{
return
m_id
!=
m_maxValue
;}
54
56
std::string
getString
()
const
;
57
59
void
show
(std::ostream & out)
const
;
60
void
show
(MsgStream & out)
const
;
61
62
//convert to string representation
63
explicit
operator
std::string()
const
{
return
getString
();}
64
65
private
:
66
static
constexpr
value_type
m_maxValue
{0xFFFFFFFF};
67
value_type
m_id
{
m_maxValue
};
68
};
69
70
71
inline
Identifier32
&
72
Identifier32::operator |=
(
unsigned
int
value){
73
m_id
|= value;
74
return
(*
this
);
75
}
76
77
inline
Identifier32
&
78
Identifier32::operator &=
(
unsigned
int
value){
79
m_id
&= value;
80
return
(*
this
);
81
}
82
83
//stream insertion
84
std::ostream &
operator <<
(std::ostream &out,
const
Identifier32
&c);
85
86
87
88
#endif
operator<<
std::ostream & operator<<(std::ostream &out, const Identifier32 &c)
Definition
Identifier32.cxx:31
Identifier32
Definition
Identifier32.h:28
Identifier32::clear
void clear()
Reset to invalid state.
Definition
Identifier32.h:44
Identifier32::is_valid
bool is_valid() const
Check if id is in a valid state.
Definition
Identifier32.h:53
Identifier32::Identifier32
Identifier32(value_type value)
Constructor from value_type (unsigned int).
Definition
Identifier32.h:37
Identifier32::operator<=>
auto operator<=>(const Identifier32 &) const =default
Identifier32::operator&=
Identifier32 & operator&=(value_type value)
Definition
Identifier32.h:78
Identifier32::get_compact
value_type get_compact() const
Get the compact id.
Definition
Identifier32.h:47
Identifier32::id_type
Identifier32 id_type
Definition
Identifier32.h:30
Identifier32::Identifier32
Identifier32()=default
Identifier32::operator|=
Identifier32 & operator|=(value_type value)
Bitwise operations.
Definition
Identifier32.h:72
Identifier32::getString
std::string getString() const
Provide a string form of the identifier - hexadecimal.
Definition
Identifier32.cxx:14
Identifier32::m_maxValue
static constexpr value_type m_maxValue
Definition
Identifier32.h:66
Identifier32::value_type
unsigned int value_type
Definition
Identifier32.h:31
Identifier32::size_type
unsigned int size_type
Definition
Identifier32.h:32
Identifier32::m_id
value_type m_id
Definition
Identifier32.h:67
Identifier32::show
void show(std::ostream &out) const
Print out in hex form.
Definition
Identifier32.cxx:20
Generated on
for ATLAS Offline Software by
1.17.0