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::CondDB Class Reference

#include <CondPyInterface.h>

Public Member Functions

std::string allTags () const
 
void closeSession () const
 
void commitTransaction () const
 
 CondDB ()
 
 CondDB (const CondDB &other)
 
 CondDB (DbSession &session, boost::shared_ptr< cond::Logger > ilog)
 
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)
 
IOVElementProxy payLoad (std::string const &token) const
 
DbSessionsession () const
 
void startReadOnlyTransaction () const
 
void startTransaction () const
 
 ~CondDB ()
 

Private Attributes

boost::shared_ptr< cond::Loggerlogger
 
DbSession me
 

Detailed Description

Definition at line 41 of file CondPyInterface.h.

Constructor & Destructor Documentation

cond::CondDB::CondDB ( )

Definition at line 119 of file CondPyInterface.cc.

119  : me(){
120  //topinit();
121  }
DbSession me
cond::CondDB::CondDB ( const CondDB other)

Definition at line 128 of file CondPyInterface.cc.

128  : me(other.me), logger(other.logger) {
129  }
DbSession me
boost::shared_ptr< cond::Logger > logger
cond::CondDB::CondDB ( cond::DbSession session,
boost::shared_ptr< cond::Logger ilog 
)

Definition at line 122 of file CondPyInterface.cc.

122  :
123  me(session), logger(ilog) {
124  //topinit();
125  }
DbSession me
boost::shared_ptr< cond::Logger > logger
cond::CondDB::~CondDB ( )

Definition at line 138 of file CondPyInterface.cc.

138  {
139  }

Member Function Documentation

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

Definition at line 142 of file CondPyInterface.cc.

References lumiTag::alltags, filterCSVwithJSON::copy, cond::MetaData::listAllTags(), me, and contentValuesCheck::ss.

Referenced by BOOST_PYTHON_MODULE().

142  {
143  std::ostringstream ss;
144 
145  cond::MetaData metadata_svc(me);
146  std::vector<std::string> alltags;
147  metadata_svc.listAllTags(alltags);
148 
149  std::copy (alltags.begin(),
150  alltags.end(),
151  std::ostream_iterator<std::string>(ss," ")
152  );
153  return ss.str();
154  }
DbSession me
tuple alltags
Definition: lumiTag.py:77
void cond::CondDB::closeSession ( ) const

Definition at line 201 of file CondPyInterface.cc.

References cond::DbSession::close(), and me.

Referenced by BOOST_PYTHON_MODULE().

201  {
202  //FIXME: does the session disconnection fix the socket failure in FroNTier (bug #84265)?
203  me.close();
204  }
DbSession me
void cond::CondDB::commitTransaction ( ) const

Definition at line 197 of file CondPyInterface.cc.

References cond::DbTransaction::commit(), me, and cond::DbSession::transaction().

Referenced by BOOST_PYTHON_MODULE().

197  {
198  me.transaction().commit();
199  }
DbTransaction & transaction()
Definition: DbSession.cc:208
int commit()
commit transaction.
DbSession me
IOVProxy cond::CondDB::iov ( std::string const &  tag) const

Definition at line 163 of file CondPyInterface.cc.

References iovToken(), and me.

Referenced by BOOST_PYTHON_MODULE(), and CondBasicIter::create().

163  {
164  return IOVProxy(me,iovToken(tag));
165  }
DbSession me
std::string iovToken(std::string const &tag) const
std::string cond::CondDB::iovToken ( std::string const &  tag) const

Definition at line 156 of file CondPyInterface.cc.

References cond::MetaData::getToken(), me, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by BOOST_PYTHON_MODULE(), iov(), and iovWithLib().

156  {
157  cond::MetaData metadata_svc(me);
158  std::string token=metadata_svc.getToken(tag);
159  return token;
160  }
DbSession me
IOVProxy cond::CondDB::iovWithLib ( std::string const &  tag) const

Definition at line 167 of file CondPyInterface.cc.

References iovToken(), and me.

Referenced by BOOST_PYTHON_MODULE().

167  {
168  return IOVProxy(me,iovToken(tag));
169  }
DbSession me
std::string iovToken(std::string const &tag) const
cond::LogDBEntry cond::CondDB::lastLogEntry ( std::string const &  tag) const

Definition at line 177 of file CondPyInterface.cc.

References logger.

Referenced by BOOST_PYTHON_MODULE().

177  {
178  cond::LogDBEntry entry;
179  if (logger)
180  logger->LookupLastEntryByTag(tag,entry,false);
181  return entry;
182  }
boost::shared_ptr< cond::Logger > logger
cond::LogDBEntry cond::CondDB::lastLogEntryOK ( std::string const &  tag) const

Definition at line 184 of file CondPyInterface.cc.

References logger.

Referenced by BOOST_PYTHON_MODULE().

184  {
185  cond::LogDBEntry entry;
186  if (logger)
187  logger->LookupLastEntryByTag(tag,entry,true);
188  return entry;
189  }
boost::shared_ptr< cond::Logger > logger
CondDB & cond::CondDB::operator= ( const CondDB other)

Definition at line 131 of file CondPyInterface.cc.

References logger, and me.

131  {
132  if (this==&other) return *this; // unless =0 this is an error condition!
133  me = other.me;
134  logger = other.logger;
135  return *this;
136  }
DbSession me
boost::shared_ptr< cond::Logger > logger
IOVElementProxy cond::CondDB::payLoad ( std::string const &  token) const

FIXME: must be IOVElementProxy(since, till, token)

Definition at line 171 of file CondPyInterface.cc.

Referenced by BOOST_PYTHON_MODULE().

171  {
173  return IOVElementProxy(0,0,token);
174  }
DbSession& cond::CondDB::session ( ) const
inline

Definition at line 66 of file CondPyInterface.h.

References me.

Referenced by CondBasicIter::make().

66 { return me;}
DbSession me
void cond::CondDB::startReadOnlyTransaction ( ) const

Definition at line 194 of file CondPyInterface.cc.

References me, cond::DbTransaction::start(), and cond::DbSession::transaction().

Referenced by BOOST_PYTHON_MODULE().

194  {
195  me.transaction().start(true);
196  }
DbTransaction & transaction()
Definition: DbSession.cc:208
DbSession me
int start(bool readOnly=false)
start transaction
void cond::CondDB::startTransaction ( ) const

Definition at line 191 of file CondPyInterface.cc.

References me, cond::DbTransaction::start(), and cond::DbSession::transaction().

Referenced by BOOST_PYTHON_MODULE().

191  {
192  me.transaction().start();
193  }
DbTransaction & transaction()
Definition: DbSession.cc:208
DbSession me
int start(bool readOnly=false)
start transaction

Member Data Documentation

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

Definition at line 70 of file CondPyInterface.h.

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

DbSession cond::CondDB::me
mutableprivate