CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Attributes

ora::OId Class Reference

#include <OId.h>

List of all members.

Public Member Functions

int containerId () const
bool fromString (const std::string &s)
bool isInvalid () const
int itemId () const
 OId ()
 OId (const OId &rhs)
 OId (const std::pair< int, int > &oidPair)
 OId (int contId, int itemId)
bool operator!= (const OId &rhs) const
OIdoperator= (const OId &rhs)
bool operator== (const OId &rhs) const
void reset ()
void toOutputStream (std::ostream &os) const
std::pair< int, int > toPair () const
std::string toString () const

Static Public Member Functions

static bool isOId (const std::string &input)

Private Attributes

int m_containerId
int m_itemId

Detailed Description

Definition at line 8 of file OId.h.


Constructor & Destructor Documentation

ora::OId::OId ( )

Definition at line 14 of file OId.cc.

           :
  m_containerId(-1),
  m_itemId(-1){
}
ora::OId::OId ( const std::pair< int, int > &  oidPair) [explicit]

Definition at line 19 of file OId.cc.

                                            :
  m_containerId( oidPair.first ),
  m_itemId( oidPair.second ){
}
ora::OId::OId ( int  contId,
int  itemId 
)

Definition at line 24 of file OId.cc.

                                   :
  m_containerId( contId),
  m_itemId( itemId ){
}
ora::OId::OId ( const OId rhs)

Definition at line 29 of file OId.cc.

                           :
  m_containerId( rhs.m_containerId),
  m_itemId( rhs.m_itemId ){
}

Member Function Documentation

int ora::OId::containerId ( ) const
bool ora::OId::fromString ( const std::string &  s)
bool ora::OId::isInvalid ( ) const

Definition at line 80 of file OId.cc.

Referenced by cond::DbSession::classNameForItem(), and cond::IOVElement::swapOId().

                             {
  return (m_containerId == -1 || m_itemId == -1);
}
bool ora::OId::isOId ( const std::string &  input) [static]

Definition at line 9 of file OId.cc.

References fromString(), and tmp.

                                          {
  ora::OId tmp;
  return tmp.fromString( input );
}
int ora::OId::itemId ( ) const
bool ora::OId::operator!= ( const OId rhs) const

Definition at line 46 of file OId.cc.

References operator==().

                                              {
  return !operator==(rhs);
}
ora::OId & ora::OId::operator= ( const OId rhs)

Definition at line 34 of file OId.cc.

References m_containerId, and m_itemId.

                                         {
  m_containerId = rhs.m_containerId;
  m_itemId = rhs.m_itemId;
  return *this;
}
bool ora::OId::operator== ( const OId rhs) const

Definition at line 40 of file OId.cc.

References m_containerId, and m_itemId.

                                              {
  if(m_containerId != rhs.m_containerId ) return false;
  if(m_itemId != rhs.m_itemId ) return false;
  return true;
}
void ora::OId::reset ( void  )

Definition at line 75 of file OId.cc.

                   {
  m_containerId = -1;
  m_itemId = -1;
}
void ora::OId::toOutputStream ( std::ostream &  os) const

Definition at line 71 of file OId.cc.

References toString().

Referenced by operator<<().

                                                  {
  os << this->toString();
}
std::pair< int, int > ora::OId::toPair ( ) const

Definition at line 84 of file OId.cc.

                                      {
  return std::make_pair( m_containerId, m_itemId );
}
std::string ora::OId::toString ( ) const

Definition at line 58 of file OId.cc.

References OIDFMT, OIDSIZ, and runonSM::text.

Referenced by cond::MetaData::getToken(), cond::DbSession::storeObject(), and cond::IOVElement::token().

                                 {
  char text[OIDSIZ];
  ::snprintf(text, OIDSIZ, OIDFMT, m_containerId, m_itemId );
  return std::string(text);
}

Member Data Documentation

int ora::OId::m_containerId [private]

Definition at line 46 of file OId.h.

Referenced by operator=(), and operator==().

int ora::OId::m_itemId [private]

Definition at line 47 of file OId.h.

Referenced by operator=(), and operator==().