ATLAS Offline Software
IdentifierHash.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 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"
26 public:
27  using value_type = unsigned int;
29  IdentifierHash () = default;
34  operator unsigned int() const;
35  unsigned int value() const;
38  bool is_valid () const;
43 
44 private:
46  static constexpr value_type m_max_value = 0xFFFFFFFF;
47  //
49 };
50 
51 
52 // Define a hash functional
53 namespace std {
54  template<>
56  size_t operator()(const IdentifierHash& id) const{
57  return static_cast<size_t>(id.value());
58  }
59  };
60 }
61 
63 #endif // IDENTIFIER_IDENTIFIERHASH_H
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
IdentifierHash::value
unsigned int value() const
std::hash< IdentifierHash >::operator()
size_t operator()(const IdentifierHash &id) const
Definition: IdentifierHash.h:56
IdentifierHash::operator-=
IdentifierHash & operator-=(unsigned int value)
IdentifierHash::m_value
value_type m_value
Definition: IdentifierHash.h:48
IdentifierHash.icc
IdentifierHash::m_max_value
static constexpr value_type m_max_value
default value, and indicator of invalid state
Definition: IdentifierHash.h:46
IdentifierHash::is_valid
bool is_valid() const
Check if id is in a valid state.
IdentifierHash::IdentifierHash
IdentifierHash()=default
Default methods.
IdentifierHash::operator+=
IdentifierHash & operator+=(unsigned int value)
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
value_type
Definition: EDM_MasterSearch.h:11
IdentifierHash::operator=
IdentifierHash & operator=(value_type value)
Assignment operators.
IdentifierHash::IdentifierHash
IdentifierHash(value_type value)
Initialization with value.