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 120 of file CondPyInterface.cc.

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

Definition at line 129 of file CondPyInterface.cc.

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

Definition at line 123 of file CondPyInterface.cc.

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

Definition at line 139 of file CondPyInterface.cc.

139  {
140  }

Member Function Documentation

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

Definition at line 143 of file CondPyInterface.cc.

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

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 202 of file CondPyInterface.cc.

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

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 198 of file CondPyInterface.cc.

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

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 164 of file CondPyInterface.cc.

References iovToken(), and me.

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

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

Definition at line 157 of file CondPyInterface.cc.

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

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

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

Definition at line 168 of file CondPyInterface.cc.

References iovToken(), and me.

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 178 of file CondPyInterface.cc.

References logger.

Referenced by BOOST_PYTHON_MODULE().

178  {
180  if (logger)
181  logger->LookupLastEntryByTag(tag,entry,false);
182  return entry;
183  }
boost::shared_ptr< cond::Logger > logger
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
cond::LogDBEntry cond::CondDB::lastLogEntryOK ( std::string const &  tag) const

Definition at line 185 of file CondPyInterface.cc.

References logger.

Referenced by BOOST_PYTHON_MODULE().

185  {
187  if (logger)
188  logger->LookupLastEntryByTag(tag,entry,true);
189  return entry;
190  }
boost::shared_ptr< cond::Logger > logger
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
CondDB & cond::CondDB::operator= ( const CondDB other)

Definition at line 132 of file CondPyInterface.cc.

References logger, and me.

132  {
133  if (this==&other) return *this; // unless =0 this is an error condition!
134  me = other.me;
135  logger = other.logger;
136  return *this;
137  }
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 172 of file CondPyInterface.cc.

Referenced by BOOST_PYTHON_MODULE().

172  {
174  return IOVElementProxy(0,0,token);
175  }
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 195 of file CondPyInterface.cc.

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

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 192 of file CondPyInterface.cc.

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

Referenced by BOOST_PYTHON_MODULE().

192  {
193  me.transaction().start();
194  }
DbTransaction & transaction()
Definition: DbSession.cc:189
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