| # Gaudi Framework, version v22r4 |

Home |  | Generated: Fri Sep 2 2011

Public Types | Public Member Functions | Private Attributes

# GaudiAlg::ID Class Reference

ID class for Histogram and Ntuples. More...

`#include <GaudiAlg/GaudiHistoID.h>`

Collaboration diagram for GaudiAlg::ID:
[legend]

List of all members.

## Public Types
typedef int | NumericID
| type for internal numeric ID
typedef std::string | LiteralID
| type for internal literal ID
## Public Member Functions
| ID (const NumericID id=-1)
| Implicit constructor from a numeric ID.
| ID (const LiteralID &id)
| Implicit constructor from a literal ID.
| ID (const char *id)
| Implicit constructor from a literal ID.
| ~ID ()
| Destructor.
bool | numeric () const
| Is this ID numeric.
bool | literal () const
| Is this ID numeric.
bool | undefined () const
| Is this ID undefined.
const LiteralID & | literalID () const
| Returns the ID as a LiteralID.
NumericID | numericID () const
| Returns the numerical ID.
GAUDI_API LiteralID | idAsString () const
| Return ID as string, for both numeric and literal IDs.
| operator std::string () const
| cast operator to std::string
bool | operator== (const ID &id) const
| Implement the operator == Implementation depends on type of ID.
bool | operator!= (const ID &id) const
| Implement the != operator, using the == operator.
bool | operator< (const ID &id) const
| Implement the operator < Implementation depends on type of ID.
GAUDI_API std::ostream & | fillStream (std::ostream &s) const
bool | operator! () const
| good ID?
size_t | hash () const
| return hash value (for python)
size_t | __hash__ () const
| return hash value (for python)
## Private Attributes
NumericID | m_nID
| Internal numeric ID.
LiteralID | m_aID
| Internal alpha-numeric ID.
size_t | m_hash
| the hash value of ID

## Detailed Description

ID class for Histogram and Ntuples.

Internally handles both numeric and string like IDs

Author:
  Chris Jones Christopher.Rob.Jones@cern.ch

Date:
  2005-08-12

Definition at line 46 of file GaudiHistoID.h.

## Member Typedef Documentation

typedef std::string GaudiAlg::ID::LiteralID

type for internal literal ID

Definition at line 53 of file GaudiHistoID.h.

typedef int GaudiAlg::ID::NumericID

type for internal numeric ID

Definition at line 51 of file GaudiHistoID.h.

## Constructor & Destructor Documentation

GaudiAlg::ID::ID | ( | const NumericID | id = `-1` ) |

Implicit constructor from a numeric ID.

Definition at line 29 of file GaudiHistoID.cpp.

      : m_nID  ( id )
      , m_aID  ( "" )
      , m_hash ( boost::hash_value ( id ) )
    {}

GaudiAlg::ID::ID | ( | const LiteralID & | id ) |

Implicit constructor from a literal ID.

GaudiAlg::ID::ID | ( | const char * | id ) |

Implicit constructor from a literal ID.

Definition at line 45 of file GaudiHistoID.cpp.

      : m_nID  ( -1 )
      , m_aID  ( id )
      , m_hash ( 0 )
    { m_hash = boost::hash_value ( m_aID ) ; }

GaudiAlg::ID::~ID | ( | ) | `[inline]`

Destructor.

Definition at line 64 of file GaudiHistoID.h.

    {} ;

## Member Function Documentation

size_t GaudiAlg::ID::__hash__ | ( | ) | const`[inline]`

return hash value (for python)

Definition at line 119 of file GaudiHistoID.h.

    { return   hash () ; }

std::ostream & GaudiAlg::ID::fillStream | ( | std::ostream & | s ) | const

Definition at line 60 of file GaudiHistoID.cpp.

    {
      if      ( numeric() ) { s << numericID() ; }
      else if ( literal() ) { s << literalID() ; }
      else                  { s << "UNDEFINED" ; }
      return s ;
    }

size_t GaudiAlg::ID::hash | ( | ) | const`[inline]`

return hash value (for python)

Definition at line 117 of file GaudiHistoID.h.

    { return m_hash    ; }

GaudiAlg::ID::LiteralID GaudiAlg::ID::idAsString | ( | ) | const

Return ID as string, for both numeric and literal IDs.

Definition at line 51 of file GaudiHistoID.cpp.

    {
      std::ostringstream s ;
      fillStream ( s ) ;
      return s.str() ;
    }

bool GaudiAlg::ID::literal | ( | ) | const`[inline]`

Is this ID numeric.

Definition at line 68 of file GaudiHistoID.h.

    { return !m_aID.empty() ; }

const LiteralID& GaudiAlg::ID::literalID | ( | ) | const`[inline]`

Returns the ID as a LiteralID.

Definition at line 72 of file GaudiHistoID.h.

    { return m_aID; }

bool GaudiAlg::ID::numeric | ( | ) | const`[inline]`

Is this ID numeric.

Definition at line 66 of file GaudiHistoID.h.

    { return -1 != m_nID ;    }

NumericID GaudiAlg::ID::numericID | ( | ) | const`[inline]`

Returns the numerical ID.

Definition at line 74 of file GaudiHistoID.h.

    { return m_nID; }

GaudiAlg::ID::operator std::string | ( | ) | const`[inline]`

cast operator to std::string

Definition at line 78 of file GaudiHistoID.h.

    { return idAsString () ; }

bool GaudiAlg::ID::operator! | ( | ) | const`[inline]`

good ID?

Definition at line 112 of file GaudiHistoID.h.

    { return undefined() ; }

bool GaudiAlg::ID::operator!= | ( | const ID & | id ) | const`[inline]`

Implement the != operator, using the == operator.

Definition at line 92 of file GaudiHistoID.h.

    { return ! ( *this == id ) ; }

bool GaudiAlg::ID::operator< | ( | const ID & | id ) | const`[inline]`

Implement the operator < Implementation depends on type of ID.

Returns:
  boolean indicating the order of the IDs

Definition at line 97 of file GaudiHistoID.h.

        {
          return
            //hash () < id.hash () ? true  :
            //hash () > id.hash () ? false :
            numeric    () && id.numeric() ? numericID() < id.numericID() :
            literal    () && id.literal() ? literalID() < id.literalID() :
            idAsString () < id.idAsString() ;
        }

bool GaudiAlg::ID::operator== | ( | const ID & | id ) | const`[inline]`

Implement the operator == Implementation depends on type of ID.

Returns:
  boolean indicating if the IDs are equal

Definition at line 83 of file GaudiHistoID.h.

        {
          return
            hash    () != id.hash    () ? false                           :
            numeric () && id.numeric () ? id.numericID () == numericID () :
            literal () && id.literal () ? id.literalID () == literalID () :
            idAsString () == id.idAsString() ;
        }

bool GaudiAlg::ID::undefined | ( | ) | const`[inline]`

Is this ID undefined.

Definition at line 70 of file GaudiHistoID.h.

    { return !numeric() && !literal(); }

## Member Data Documentation

LiteralID GaudiAlg::ID::m_aID`[private]`

Internal alpha-numeric ID.

Definition at line 126 of file GaudiHistoID.h.

size_t GaudiAlg::ID::m_hash`[private]`

the hash value of ID

Definition at line 131 of file GaudiHistoID.h.

NumericID GaudiAlg::ID::m_nID`[private]`

Internal numeric ID.

Definition at line 124 of file GaudiHistoID.h.

The documentation for this class was generated from the following files:

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r4/GaudiAlg/GaudiAlg/GaudiHistoID.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r4/GaudiAlg/src/lib/GaudiHistoID.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines