CMS 3D CMS Logo

Public Member Functions | Private Attributes

ora::OId Class Reference

#include <OId.h>

List of all members.

Public Member Functions

int containerId () const
void fromString (const std::string &s)
int itemId () const
 OId (int contId, int itemId)
 OId (const OId &rhs)
 OId ()
bool operator!= (const OId &rhs) const
OIdoperator= (const OId &rhs)
bool operator== (const OId &rhs) const
std::string toString ()

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 9 of file OId.cc.

           :
  m_containerId(-1),
  m_itemId(-1){
}
ora::OId::OId ( int  contId,
int  itemId 
)

Definition at line 14 of file OId.cc.

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

Definition at line 19 of file OId.cc.

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

Member Function Documentation

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

Definition at line 58 of file OId.cc.

References fmtContId, fmtItemId, p1, p2, p3, LaserTracksInput_cfi::source, and tmp.

                                                {
  std::string tmp = source;
  for(char* p1 = (char*)tmp.c_str(); p1; p1 = ::strchr(++p1,'[')) {
    char* p2 = ::strchr(p1, '=');
    char* p3 = ::strchr(p1, ']');
    if ( p2 && p3 )   {
      if ( ::strncmp(fmtContId, p1, 4) == 0 )  {
        ::sscanf(p1, fmtContId, &m_containerId );
      }
      else if ( ::strncmp(fmtItemId, p1, 4) == 0 )  {
        ::sscanf(p1, fmtItemId, &m_itemId );
      }
      else    {
        *p3 = *p2 = 0;
      }
      *p3 = ']';
      *p2 = '=';
    }
  }
}
int ora::OId::itemId ( ) const
bool ora::OId::operator!= ( const OId rhs) const

Definition at line 36 of file OId.cc.

References operator==().

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

Definition at line 24 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 30 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;
}
std::string ora::OId::toString ( )

Definition at line 48 of file OId.cc.

References fmtContId, fmtItemId, and runonSM::text.

                          {
  std::string str("");
  char text[128];
  ::sprintf(text, fmtContId, m_containerId);
  str += text;
  ::sprintf(text, fmtItemId, m_itemId);
  str += text;
  return str;
}

Member Data Documentation

int ora::OId::m_containerId [private]

Definition at line 21 of file OId.h.

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

int ora::OId::m_itemId [private]

Definition at line 22 of file OId.h.

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