ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DetectorDescription
Identifier
Identifier
IdentifierHash.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
6
#ifndef IDENTIFIER_IDENTIFIERHASH_H
7
#define IDENTIFIER_IDENTIFIERHASH_H
8
9
#include "GaudiKernel/MsgStream.h"
25
class
IdentifierHash
{
26
public
:
27
using
value_type
=
unsigned
int;
29
constexpr
IdentifierHash
() =
default
;
31
constexpr
IdentifierHash
(
value_type
value
);
34
constexpr
operator
value_type
()
const
;
35
constexpr
value_type
value
()
const
;
37
constexpr
bool
is_valid
()
const
;
38
39
constexpr
IdentifierHash
&
operator=
(
value_type
value
);
40
41
constexpr
IdentifierHash
&
operator+=
(
value_type
value
);
42
43
constexpr
IdentifierHash
&
operator-=
(
value_type
value
);
44
45
private
:
47
static
constexpr
value_type
m_max_value
= 0xFFFFFFFF;
48
//
49
value_type
m_value
=
m_max_value
;
50
};
51
52
53
// Define a hash functional
54
namespace
std
{
55
template
<>
56
struct
hash<
IdentifierHash
>{
57
size_t
operator()
(
const
IdentifierHash
&
id
)
const
{
58
return
static_cast<
size_t
>
(
id
.value());
59
}
60
};
61
}
62
63
#include "
Identifier/IdentifierHash.icc
"
64
#endif
// IDENTIFIER_IDENTIFIERHASH_H
IdentifierHash.icc
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
IdentifierHash::value
constexpr value_type value() const
IdentifierHash::operator+=
constexpr IdentifierHash & operator+=(value_type value)
IdentifierHash::IdentifierHash
constexpr IdentifierHash(value_type value)
Initialization with value.
IdentifierHash::is_valid
constexpr bool is_valid() const
IdentifierHash::operator=
constexpr IdentifierHash & operator=(value_type value)
IdentifierHash::m_max_value
static constexpr value_type m_max_value
default value, and indicator of invalid state
Definition
IdentifierHash.h:47
IdentifierHash::IdentifierHash
constexpr IdentifierHash()=default
Default methods.
IdentifierHash::m_value
value_type m_value
Definition
IdentifierHash.h:49
IdentifierHash::operator-=
constexpr IdentifierHash & operator-=(value_type value)
IdentifierHash::value_type
unsigned int value_type
Definition
IdentifierHash.h:27
std
STL namespace.
std::hash< IdentifierHash >::operator()
size_t operator()(const IdentifierHash &id) const
Definition
IdentifierHash.h:57
Generated on
for ATLAS Offline Software by
1.17.0