1 #ifndef GAUDIALG_GAUDIHISTOID_H 2 #define GAUDIALG_GAUDIHISTOID_H 1 56 ID (
const NumericID
id = -1 )
61 : m_aID (
std::move(id) )
64 ID (
const LiteralID&
id )
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(); }
80 inline const LiteralID&
literalID() const noexcept {
return m_aID; }
82 inline NumericID
numericID() const noexcept {
return m_nID; }
94 hash () !=
id.hash () ?
false :
95 numeric () &&
id.numeric () ?
id.numericID () == numericID () :
96 literal () &&
id.literal () ?
id.literalID () == literalID () :
97 idAsString () ==
id.idAsString() ;
100 inline bool operator!=(
const ID&
id )
const {
return ! ( *
this == id ) ; }
110 numeric () &&
id.numeric() ? numericID() <
id.numericID() :
111 literal () &&
id.literal() ? literalID() <
id.literalID() :
112 idAsString () <
id.idAsString() ;
120 bool operator!() const noexcept {
return undefined() ; }
125 inline size_t hash () const noexcept {
return m_hash ; }
127 inline size_t __hash__ () const noexcept {
return hash () ; }
132 NumericID m_nID{-1} ;
145 {
return id.fillStream ( str ) ; }
161 #endif // GAUDIALG_GAUDIHISTOID_H ID(const LiteralID &id)
Implicit 'copy' constructor from a literal ID.
bool operator!() const noexcept
good ID?
bool operator==(const ID &id) const noexcept
Implement the operator == Implementation depends on type of ID.
ID(LiteralID &&id)
Implicit 'move' constructor from a literal ID.
The namespace threadpool contains a thread pool and related utility classes.
NumericID numericID() const noexcept
Returns the numerical ID.
int NumericID
type for internal numeric ID
bool operator!=(const ID &id) const
Implement the != operator, using the == operator.
bool operator<(const ID &id) const noexcept
Implement the operator < Implementation depends on type of ID.
std::size_t hash_value(const Gaudi::StringKey &key)
hash-function: heeded for boost::hash
size_t __hash__() const noexcept
return hash value (for python)
ID(const NumericID id=-1)
Implicit constructor from a numeric ID.
bool literal() const noexcept
Is this ID numeric.
std::string LiteralID
type for internal literal ID
Forward declarations for the functions in SerializeSTL.h.
const LiteralID & literalID() const noexcept
Returns the ID as a LiteralID.
LiteralID m_aID
Internal alpha-numeric ID.
bool numeric() const noexcept
Is this ID numeric.
size_t hash() const noexcept
return hash value (for python)
bool undefined() const noexcept
Is this ID undefined.
GaudiAlg.h GaudiAlg/GaudiAlg.h Namespace with definition of useful constants, types and function...
ID class for Histogram and Ntuples.
std::ostream & operator<<(std::ostream &str, const GaudiAlg::ID &id)
Operator overloading for ostream.
ID(const char *id)
Implicit constructor from a literal ID.