CMS 3D CMS Logo

TokenInterpreter.cc

Go to the documentation of this file.
00001 #include "CondCore/DBCommon/interface/TokenInterpreter.h"
00002 #include "POOLCore/Token.h"
00003 #include "StorageSvc/DbReflex.h"
00004 namespace cond{
00005   
00006   bool validToken(const std::string& tokenString) {
00007     // well a bit simplistic...
00008     return tokenString.find('[')==0;
00009   }
00010 
00011 
00012   TokenInterpreter::TokenInterpreter(const std::string& tokenString): m_tokenstr(tokenString){
00013     if (!isValid() ) return;
00014     pool::Token* mytoken=new pool::Token;
00015     m_containerName=mytoken->fromString(tokenString).contID();
00016     const pool::Guid& classID=mytoken->fromString(tokenString).classID();
00017     ROOT::Reflex::Type myclass=pool::DbReflex::forGuid(classID);
00018     m_className=myclass.Name(); 
00019     //for the moment default name. Should decide FINAL,SCOPED or QUALIFIED
00020     mytoken->release();
00021   }
00022   TokenInterpreter::~TokenInterpreter(){
00023   }
00024   bool TokenInterpreter::isValid() const {
00025     return validToken(m_tokenstr);
00026   }
00027   std::string TokenInterpreter::containerName()const{
00028     return m_containerName;
00029   }
00030   std::string TokenInterpreter::className()const{
00031     return m_className;
00032   }
00033 }//ns cond

Generated on Tue Jun 9 17:26:06 2009 for CMSSW by  doxygen 1.5.4