3 #ifndef GAUDIALG_GAUDIHISTOID_H
4 #define GAUDIALG_GAUDIHISTOID_H 1
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(); }
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 ) ; }
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 ;
117 inline size_t hash ()
const {
return m_hash ; }
119 inline size_t __hash__ ()
const {
return hash () ; }
137 {
return id.fillStream ( str ) ; }
153 #endif // GAUDIALG_GAUDIHISTOID_H
size_t m_hash
the hash value of ID
int NumericID
type for internal numeric ID
size_t hash() const
return hash value (for python)
bool operator!=(const ID &id) const
Implement the != operator, using the == operator.
NumericID m_nID
Internal numeric ID.
bool operator==(const ID &id) const
Implement the operator == Implementation depends on type of ID.
NumericID numericID() const
Returns the numerical ID.
bool operator!() const
good ID?
const LiteralID & literalID() const
Returns the ID as a LiteralID.
std::string LiteralID
type for internal literal ID
size_t __hash__() const
return hash value (for python)
bool undefined() const
Is this ID undefined.
bool operator<(const ID &id) const
Implement the operator < Implementation depends on type of ID.
LiteralID m_aID
Internal alpha-numeric ID.
bool literal() const
Is this ID numeric.
ID class for Histogram and Ntuples.
bool numeric() const
Is this ID numeric.
std::ostream & operator<<(std::ostream &str, const GaudiAlg::ID &id)
Operator overloading for ostream.