Go to the documentation of this file.
11 #ifndef GAUDIALG_GAUDIHISTOID_H
12 #define GAUDIALG_GAUDIHISTOID_H 1
74 inline bool numeric() const noexcept {
return -1 != m_nID; }
76 inline bool literal() const noexcept {
return !m_aID.empty(); }
78 inline bool undefined() const noexcept {
return !numeric() && !literal(); }
92 return hash() !=
id.hash() ? false
93 : numeric() &&
id.numeric() ?
id.numericID() == numericID()
94 : literal() &&
id.literal() ?
id.literalID() == literalID()
95 : idAsString() ==
id.idAsString();
98 inline bool operator!=(
const ID&
id )
const {
return !( *
this == id ); }
107 numeric() &&
id.numeric() ? numericID() <
id.numericID()
108 : literal() &&
id.literal() ? literalID() <
id.literalID()
109 : idAsString() <
id.idAsString();
122 inline size_t hash() const noexcept {
return m_hash; }
124 inline size_t __hash__() const noexcept {
return hash(); }
157 #endif // GAUDIALG_GAUDIHISTOID_H
ID(const NumericID id=-1)
Implicit constructor from a numeric ID.
size_t __hash__() const noexcept
return hash value (for python)
bool operator<(const ID &id) const noexcept
Implement the operator < Implementation depends on type of ID.
std::string LiteralID
type for internal literal ID
size_t hash() const noexcept
return hash value (for python)
bool operator!=(const ID &id) const
Implement the != operator, using the == operator.
NumericID numericID() const noexcept
Returns the numerical ID.
bool operator==(const ID &id) const noexcept
Implement the operator == Implementation depends on type of ID.
std::ostream & operator<<(std::ostream &str, const GaudiAlg::ID &id)
Operator overloading for ostream.
ID(const LiteralID &id)
Implicit 'copy' constructor from a literal ID.
std::size_t operator()(const T &key) const
the hash-function
bool undefined() const noexcept
Is this ID undefined.
bool operator!() const noexcept
good ID?
ID(LiteralID &&id)
Implicit 'move' constructor from a literal ID.
int NumericID
type for internal numeric ID
LiteralID m_aID
Internal alpha-numeric ID.
ID(const char *id)
Implicit constructor from a literal ID.
const LiteralID & literalID() const noexcept
Returns the ID as a LiteralID.
bool numeric() const noexcept
Is this ID numeric.
std::size_t hash_value(TupleID const &b)
bool literal() const noexcept
Is this ID numeric.