1 #ifndef GAUDIALG_GAUDIHISTOID_H
2 #define GAUDIALG_GAUDIHISTOID_H 1
12 #include "GaudiKernel/Kernel.h"
13 #include "GaudiKernel/Hash.h"
49 typedef int NumericID;
51 typedef std::string LiteralID;
56 ID (
const NumericID
id = -1 ) ;
58 ID (
const LiteralID&
id ) ;
60 ID (
const char*
id ) ;
64 inline bool numeric ()
const {
return -1 != m_nID ; }
66 inline bool literal ()
const {
return !m_aID.empty() ; }
68 inline bool undefined ()
const {
return !numeric() && !literal(); }
70 inline const LiteralID& literalID()
const {
return m_aID; }
72 inline NumericID numericID()
const {
return m_nID; }
76 operator std::string ()
const {
return idAsString () ; }
84 hash () !=
id.hash () ?
false :
85 numeric () &&
id.numeric () ?
id.numericID () == numericID () :
86 literal () && id.literal () ? id.literalID () == literalID () :
87 idAsString () == id.idAsString() ;
90 inline bool operator!=(
const ID&
id )
const {
return ! ( *
this == id ) ; }
95 inline bool operator<(
const ID&
id )
const
100 numeric () &&
id.numeric() ? numericID() <
id.numericID() :
101 literal () &&
id.literal() ? literalID() <
id.literalID() :
102 idAsString () <
id.idAsString() ;
105 GAUDI_API std::ostream& fillStream ( std::ostream&
s )
const ;
110 bool operator!()
const {
return undefined() ; }
115 inline size_t hash ()
const {
return m_hash ; }
117 inline size_t __hash__ ()
const {
return hash () ; }
135 {
return id.fillStream ( str ) ; }
144 inline size_t Hash<GaudiAlg::ID>::operator()
145 (
const GaudiAlg::ID& key )
const {
return key.hash () ; }
151 #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.