ATLAS Offline Software
Loading...
Searching...
No Matches
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"
26public:
27 using value_type = unsigned int;
29 constexpr IdentifierHash () = default;
34 constexpr operator value_type() const;
35 constexpr value_type value() const;
37 constexpr bool is_valid() const;
38
40
42
44
45private:
47 static constexpr value_type m_max_value = 0xFFFFFFFF;
48 //
50};
51
52
53// Define a hash functional
54namespace 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
64#endif // IDENTIFIER_IDENTIFIERHASH_H
This is a "hash" representation of an Identifier.
constexpr value_type value() const
constexpr IdentifierHash & operator+=(value_type value)
constexpr IdentifierHash(value_type value)
Initialization with value.
constexpr bool is_valid() const
constexpr IdentifierHash & operator=(value_type value)
static constexpr value_type m_max_value
default value, and indicator of invalid state
constexpr IdentifierHash()=default
Default methods.
value_type m_value
constexpr IdentifierHash & operator-=(value_type value)
unsigned int value_type
STL namespace.
size_t operator()(const IdentifierHash &id) const