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 104 of file DbSession.h.

Constructor & Destructor Documentation

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

Definition at line 307 of file DbSession.cc.

307  :
308  m_db( db ){
309 }
ora::Database & m_db
Definition: DbSession.h:113
cond::PoolTokenParser::~PoolTokenParser ( )
inline

Definition at line 107 of file DbSession.h.

107  {
108  }

Member Function Documentation

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

Implements ora::ITokenParser.

Definition at line 320 of file DbSession.cc.

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

320  {
321  ora::OId oid;
322  oid.fromString( oraToken );
324  return cont.className();
325 }
tuple cont
load Luminosity info ##
Definition: generateEDF.py:622
Definition: OId.h:8
ora::Database & m_db
Definition: DbSession.h:113
const std::string & className()
Definition: Container.cc:75
Container containerHandle(const std::string &name)
Definition: Database.cc:275
int containerId() const
Definition: OId.cc:50
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 311 of file DbSession.cc.

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

311  {
312  std::pair<std::string,int> oidData = parseToken( poolToken );
313  if( oidData.first.empty() ){
314  throwException("Could not resolve Container name from token=\""+poolToken+"\".","PoolTokenParser::parse");
315  }
316  ora::Container cont = m_db.containerHandle( oidData.first );
317  return ora::OId( cont.id(), oidData.second );
318 }
tuple cont
load Luminosity info ##
Definition: generateEDF.py:622
std::pair< std::string, int > parseToken(const std::string &objectId)
Definition: PoolToken.cc:16
Definition: OId.h:8
ora::Database & m_db
Definition: DbSession.h:113
Container containerHandle(const std::string &name)
Definition: Database.cc:275
void throwException(std::string const &message, std::string const &methodName)
Definition: Exception.cc:17

Member Data Documentation

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

Definition at line 113 of file DbSession.h.