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
 
 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 ()
 
 ~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 117 of file CondPyInterface.cc.

117  : me(){
118  //topinit();
119  }
DbSession me
cond::CondDB::CondDB ( const CondDB other)

Definition at line 126 of file CondPyInterface.cc.

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

Definition at line 120 of file CondPyInterface.cc.

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

Definition at line 136 of file CondPyInterface.cc.

136  {
137  }

Member Function Documentation

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

Definition at line 140 of file CondPyInterface.cc.

References cond::DbTransaction::commit(), filterCSVwithJSON::copy, cond::MetaData::listAllTags(), me, cond::DbTransaction::start(), and cond::DbSession::transaction().

Referenced by BOOST_PYTHON_MODULE().

140  {
141  std::ostringstream ss;
142 
143  cond::MetaData metadata_svc(me);
144  std::vector<std::string> alltags;
145  me.transaction().start(true);
146  metadata_svc.listAllTags(alltags);
147  me.transaction().commit();
148 
149  std::copy (alltags.begin(),
150  alltags.end(),
151  std::ostream_iterator<std::string>(ss," ")
152  );
153  return ss.str();
154  }
DbTransaction & transaction()
Definition: DbSession.cc:153
int commit()
commit transaction.
DbSession me
int start(bool readOnly=false)
start transaction
IOVProxy cond::CondDB::iov ( std::string const &  tag) const

Definition at line 165 of file CondPyInterface.cc.

References iovToken(), and me.

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

165  {
166  return IOVProxy(me,iovToken(tag),true,true);
167  }
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::DbTransaction::commit(), cond::MetaData::getToken(), me, cond::DbTransaction::start(), and cond::DbSession::transaction().

Referenced by iov(), and iovWithLib().

156  {
157  cond::MetaData metadata_svc(me);
158  me.transaction().start(true);
159  std::string token=metadata_svc.getToken(tag);
160  me.transaction().commit();
161  return token;
162  }
DbTransaction & transaction()
Definition: DbSession.cc:153
int commit()
commit transaction.
DbSession me
int start(bool readOnly=false)
start transaction
IOVProxy cond::CondDB::iovWithLib ( std::string const &  tag) const

Definition at line 169 of file CondPyInterface.cc.

References iovToken(), and me.

Referenced by BOOST_PYTHON_MODULE().

169  {
170  return IOVProxy(me,iovToken(tag),false,true);
171  }
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 129 of file CondPyInterface.cc.

References logger, and me.

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

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

Definition at line 172 of file CondPyInterface.cc.

References me.

Referenced by BOOST_PYTHON_MODULE().

172  {
174  return IOVElementProxy(0,0,token,me);
175  }
DbSession me
DbSession& cond::CondDB::session ( )
inline

Definition at line 60 of file CondPyInterface.h.

References me.

60 { return me;}
DbSession me

Member Data Documentation

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

Definition at line 64 of file CondPyInterface.h.

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

DbSession cond::CondDB::me
mutableprivate

Definition at line 63 of file CondPyInterface.h.

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