CMS 3D CMS Logo

cond::CondDB Class Reference

#include <CondCore/Utilities/interface/CondPyInterface.h>

List of all members.

Public Member Functions

std::string allTags () const
 CondDB (Connection *conn, boost::shared_ptr< cond::Logger > ilog)
 CondDB (const CondDB &other)
 CondDB ()
IOVProxy iov (std::string const &tag) const
std::string iovToken (std::string const &tag) const
IOVProxy iovWithLib (std::string const &tag) const
cond::LogDBEntry lastLogEntry (std::string const &tag) const
cond::LogDBEntry lastLogEntryOK (std::string const &tag) const
CondDBoperator= (const CondDB &other)
IOVElement payLoad (std::string const &token) const
 ~CondDB ()

Private Attributes

boost::shared_ptr< cond::Loggerlogger
Connectionme


Detailed Description

Definition at line 37 of file CondPyInterface.h.


Constructor & Destructor Documentation

cond::CondDB::CondDB (  ) 

Definition at line 102 of file CondPyInterface.cc.

00102 : me(0){}

cond::CondDB::CondDB ( const CondDB other  ) 

Definition at line 108 of file CondPyInterface.cc.

References me.

00108                                      : me(other.me), logger(other.logger) {
00109     other.me=0;
00110   }

cond::CondDB::CondDB ( cond::Connection conn,
boost::shared_ptr< cond::Logger ilog 
)

Definition at line 103 of file CondPyInterface.cc.

00103                                                                         :
00104     me(conn), logger(ilog) {
00105   }

cond::CondDB::~CondDB (  ) 

Definition at line 121 of file CondPyInterface.cc.

References cond::Connection::disconnect(), and me.

00121                   {
00122     if (me)
00123       me->disconnect();
00124   }


Member Function Documentation

std::string cond::CondDB::allTags (  )  const

Definition at line 127 of file CondPyInterface.cc.

References cond::CoralTransaction::commit(), edmNew::copy(), cond::Connection::coralTransaction(), cond::MetaData::listAllTags(), me, ss, and cond::CoralTransaction::start().

Referenced by BOOST_PYTHON_MODULE().

00127                                   {
00128     std::ostringstream ss;
00129 
00130     cond::CoralTransaction& coraldb=me->coralTransaction();
00131     cond::MetaData metadata_svc(coraldb);
00132     std::vector<std::string> alltags;
00133     coraldb.start(true);
00134     metadata_svc.listAllTags(alltags);
00135     coraldb.commit();
00136     
00137     std::copy (alltags.begin(),
00138                alltags.end(),
00139                std::ostream_iterator<std::string>(ss," ")
00140                );
00141     return ss.str();
00142   }

IOVProxy cond::CondDB::iov ( std::string const &  tag  )  const

Definition at line 153 of file CondPyInterface.cc.

References iovToken(), me, and cond::Connection::poolTransaction().

Referenced by BOOST_PYTHON_MODULE(), and moduleNameByTag().

00153                                                   {
00154     return IOVProxy(me->poolTransaction(),iovToken(tag),true);
00155   }

std::string cond::CondDB::iovToken ( std::string const &  tag  )  const

Definition at line 144 of file CondPyInterface.cc.

References cond::CoralTransaction::commit(), cond::Connection::coralTransaction(), cond::MetaData::getToken(), me, and cond::CoralTransaction::start().

Referenced by iov(), and iovWithLib().

00144                                                         {
00145     cond::CoralTransaction& coraldb=me->coralTransaction();
00146     cond::MetaData metadata_svc(coraldb);
00147     coraldb.start(true);
00148     std::string token=metadata_svc.getToken(tag);
00149     coraldb.commit();
00150     return token;
00151   }

IOVProxy cond::CondDB::iovWithLib ( std::string const &  tag  )  const

Definition at line 157 of file CondPyInterface.cc.

References iovToken(), me, and cond::Connection::poolTransaction().

Referenced by BOOST_PYTHON_MODULE().

00157                                                          {
00158     return IOVProxy(me->poolTransaction(),iovToken(tag),false);
00159   }

cond::LogDBEntry cond::CondDB::lastLogEntry ( std::string const &  tag  )  const

Definition at line 167 of file CondPyInterface.cc.

References logger.

Referenced by BOOST_PYTHON_MODULE().

00167                                                                  {
00168     cond::LogDBEntry entry;
00169     if (logger)
00170       logger->LookupLastEntryByTag(tag,entry,false);
00171     return entry;
00172   }

cond::LogDBEntry cond::CondDB::lastLogEntryOK ( std::string const &  tag  )  const

Definition at line 174 of file CondPyInterface.cc.

References logger.

Referenced by BOOST_PYTHON_MODULE().

00174                                                                   {
00175     cond::LogDBEntry entry;
00176     if (logger)
00177       logger->LookupLastEntryByTag(tag,entry,true);
00178     return entry;
00179   }

CondDB & cond::CondDB::operator= ( const CondDB other  ) 

Definition at line 112 of file CondPyInterface.cc.

References cond::Connection::disconnect(), logger, and me.

00112                                                  {
00113     if (me==other.me) return *this; // unless =0 this is an error condition!
00114     if (me!=0) me->disconnect();
00115     me = other.me;
00116     logger = other.logger;
00117     other.me=0;
00118     return *this;
00119   }

IOVElement cond::CondDB::payLoad ( std::string const &  token  )  const

Definition at line 161 of file CondPyInterface.cc.

References me, and cond::Connection::poolTransaction().

Referenced by BOOST_PYTHON_MODULE().

00161                                                           {
00162     return IOVElement(0,0,token,&me->poolTransaction());
00163 
00164   }


Member Data Documentation

boost::shared_ptr<cond::Logger> cond::CondDB::logger [private]

Definition at line 58 of file CondPyInterface.h.

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

Connection* cond::CondDB::me [mutable, private]

Definition at line 57 of file CondPyInterface.h.

Referenced by allTags(), CondDB(), iov(), iovToken(), iovWithLib(), operator=(), payLoad(), and ~CondDB().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:36:43 2009 for CMSSW by  doxygen 1.5.4