CMS 3D CMS Logo

Public Member Functions | Private Attributes

cond::PoolTokenParser Class Reference

#include <DbSession.h>

Inheritance diagram for cond::PoolTokenParser:
ora::ITokenParser

List of all members.

Public Member Functions

std::string className (const std::string &poolToken)
ora::OId parse (const std::string &poolToken)
 PoolTokenParser (ora::Database &db)
 ~PoolTokenParser ()

Private Attributes

ora::Databasem_db

Detailed Description

Definition at line 103 of file DbSession.h.


Constructor & Destructor Documentation

cond::PoolTokenParser::PoolTokenParser ( ora::Database db) [explicit]

Definition at line 264 of file DbSession.cc.

                                                     :
  m_db( db ){
}
cond::PoolTokenParser::~PoolTokenParser ( ) [inline]

Definition at line 106 of file DbSession.h.

                      {
    }

Member Function Documentation

std::string cond::PoolTokenParser::className ( const std::string &  poolToken) [virtual]

Implements ora::ITokenParser.

Definition at line 277 of file DbSession.cc.

References ora::Container::className(), cont, ora::OId::containerId(), and ora::OId::fromString().

                                                                   {
  ora::OId oid;
  oid.fromString( oraToken );
  ora::Container cont = m_db.containerHandle(  oid.containerId() );
  return cont.className();
}
ora::OId cond::PoolTokenParser::parse ( const std::string &  poolToken) [virtual]

Implements ora::ITokenParser.

Definition at line 268 of file DbSession.cc.

References cont, ora::Container::id(), cond::parseToken(), and cond::throwException().

                                                             {
  std::pair<std::string,int> oidData = parseToken( poolToken );
  if( oidData.first.empty() ){
    throwException("Could not resolve Container name from token=\""+poolToken+"\".","PoolTokenParser::parse");
  }
  ora::Container cont = m_db.containerHandle(  oidData.first );
  return ora::OId( cont.id(), oidData.second );
}

Member Data Documentation

Definition at line 112 of file DbSession.h.