CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
cond::PoolTokenParser Class Reference

#include <DbSession.h>

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

Public Member Functions

std::string className (const std::string &poolToken)
 
ora::OId parse (const std::string &poolToken)
 
 PoolTokenParser (ora::Database &db)
 
 ~PoolTokenParser ()
 
- Public Member Functions inherited from ora::ITokenParser
virtual ~ITokenParser ()
 

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 292 of file DbSession.cc.

292  :
293  m_db( db ){
294 }
ora::Database & m_db
Definition: DbSession.h:112
cond::PoolTokenParser::~PoolTokenParser ( )
inline

Definition at line 106 of file DbSession.h.

106  {
107  }

Member Function Documentation

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

Implements ora::ITokenParser.

Definition at line 305 of file DbSession.cc.

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

305  {
306  ora::OId oid;
307  oid.fromString( oraToken );
309  return cont.className();
310 }
Definition: OId.h:8
ora::Database & m_db
Definition: DbSession.h:112
const std::string & className()
Definition: Container.cc:75
Container containerHandle(const std::string &name)
Definition: Database.cc:272
int containerId() const
Definition: OId.cc:50
int cont
bool fromString(const std::string &s)
Definition: OId.cc:64
ora::OId cond::PoolTokenParser::parse ( const std::string &  poolToken)
virtual

Implements ora::ITokenParser.

Definition at line 296 of file DbSession.cc.

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

296  {
297  std::pair<std::string,int> oidData = parseToken( poolToken );
298  if( oidData.first.empty() ){
299  throwException("Could not resolve Container name from token=\""+poolToken+"\".","PoolTokenParser::parse");
300  }
301  ora::Container cont = m_db.containerHandle( oidData.first );
302  return ora::OId( cont.id(), oidData.second );
303 }
std::pair< std::string, int > parseToken(const std::string &objectId)
Definition: PoolToken.cc:15
Definition: OId.h:8
ora::Database & m_db
Definition: DbSession.h:112
Container containerHandle(const std::string &name)
Definition: Database.cc:272
void throwException(std::string const &message, std::string const &methodName)
Definition: Exception.cc:17
int cont

Member Data Documentation

ora::Database& cond::PoolTokenParser::m_db
private

Definition at line 112 of file DbSession.h.