ATLAS Offline Software
IdentifierHash.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***************************************************************************
6  Identifier package
7  -----------------------------------------
8  ***************************************************************************/
9 
10 //<doc><file> $Id: IdentifierHash.h,v 1.4 2003-11-26 12:28:21 schaffer Exp $
11 //<version> $Name: not supported by cvs2svn $
12 
13 #ifndef IDENTIFIER_IDENTIFIERHASH_H
14 # define IDENTIFIER_IDENTIFIERHASH_H
15 
16 #include "GaudiKernel/MsgStream.h"
17 
18 
38 {
39 public:
40 
41 
45  typedef unsigned int value_type;
46 
50 
52  IdentifierHash () = default;
53  IdentifierHash (const IdentifierHash& other) =default;
54  IdentifierHash (IdentifierHash&& other) =default;
57  ~IdentifierHash () = default;
58 
61 
65 
67  operator unsigned int (void) const;
68  unsigned int value (void) const;
69 
73 
75  bool is_valid () const;
76 
80 
83  IdentifierHash& operator += (unsigned int value);
84  IdentifierHash& operator -= (unsigned int value);
85 
86 private:
87 
88  typedef enum {
89  max_value = 0xFFFFFFFF
91 
92  //----------------------------------------------------------------
93  // The actual identifier data.
94  //----------------------------------------------------------------
96 };
97 //-----------------------------------------------
98 
99 
100 
101 // Define a hash functional
102 
103 namespace std {
104 template<>
106 {
107  size_t operator()(const IdentifierHash& id) const
108  {
109  return static_cast<size_t>(id.value());
110  }
111 };
112 }
113 
115 #endif // IDENTIFIER_IDENTIFIERHASH_H
IdentifierHash::~IdentifierHash
~IdentifierHash()=default
IdentifierHash::value_type
unsigned int value_type
Definition: IdentifierHash.h:48
std::hash< IdentifierHash >::operator()
size_t operator()(const IdentifierHash &id) const
Definition: IdentifierHash.h:107
IdentifierHash::operator-=
IdentifierHash & operator-=(unsigned int value)
IdentifierHash::m_value
value_type m_value
Definition: IdentifierHash.h:98
IdentifierHash::max_value
@ max_value
Definition: IdentifierHash.h:92
IdentifierHash.icc
IdentifierHash::operator=
IdentifierHash & operator=(const IdentifierHash &other)=default
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)
readCCLHist.int
int
Definition: readCCLHist.py:84
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
IdentifierHash::max_value_type
max_value_type
Definition: IdentifierHash.h:91
IdentifierHash::value
unsigned int value(void) const
IdentifierHash
Definition: IdentifierHash.h:38
value_type
Definition: EDM_MasterSearch.h:11