3 #ifndef GAUDIALG_GAUDIHISTOID_H
4 #define GAUDIALG_GAUDIHISTOID_H 1
14 #include "GaudiKernel/Kernel.h"
15 #include "GaudiKernel/Hash.h"
51 typedef int NumericID;
53 typedef std::string LiteralID;
58 ID (
const NumericID
id = -1 ) ;
60 ID (
const LiteralID&
id ) ;
62 ID (
const char*
id ) ;
66 inline bool numeric ()
const {
return -1 != m_nID ; }
68 inline bool literal ()
const {
return !m_aID.empty() ; }
70 inline bool undefined ()
const {
return !numeric() && !literal(); }
72 inline const LiteralID& literalID()
const {
return m_aID; }
74 inline NumericID numericID()
const {
return m_nID; }
78 operator std::string ()
const {
return idAsString () ; }
86 hash () !=
id.hash () ?
false :
87 numeric () &&
id.numeric () ?
id.numericID () == numericID () :
88 literal () && id.literal () ? id.literalID () == literalID () :
89 idAsString () == id.idAsString() ;
92 inline bool operator!=(
const ID&
id )
const {
return ! ( *
this == id ) ; }
97 inline bool operator<(
const ID&
id )
const
102 numeric () &&
id.numeric() ? numericID() <
id.numericID() :
103 literal () &&
id.literal() ? literalID() <
id.literalID() :
104 idAsString () <
id.idAsString() ;
107 GAUDI_API std::ostream& fillStream ( std::ostream&
s )
const ;
112 bool operator!()
const {
return undefined() ; }
117 inline size_t hash ()
const {
return m_hash ; }
119 inline size_t __hash__ ()
const {
return hash () ; }
137 {
return id.fillStream ( str ) ; }
146 inline size_t Hash<GaudiAlg::ID>::operator()
147 (
const GaudiAlg::ID& key )
const {
return key.hash () ; }
153 #endif // GAUDIALG_GAUDIHISTOID_H
std::ostream & operator<<(std::ostream &str, const GaudiAlg::ID &id)
Operator overloading for ostream.
bool operator!=(const GaudiUtils::Allocator< T1 > &, const GaudiUtils::Allocator< T2 > &)
bool operator==(const GaudiUtils::Allocator< T1 > &, const GaudiUtils::Allocator< T2 > &)
Forward declarations for the functions in SerializeSTL.h.
bool operator<(const Gaudi::Time &t1, const Gaudi::Time &t2)
bool operator!(const Gaudi::Time &t)
GaudiAlg.h GaudiAlg/GaudiAlg.h Namespace with definition of useful constants, types and function...
ID class for Histogram and Ntuples.