CMS 3D CMS Logo

Public Member Functions | Private Attributes

cond::CondDB Class Reference

#include <CondPyInterface.h>

List of all members.

Public Member Functions

std::string allTags () const
 CondDB (const CondDB &other)
 CondDB (DbSession &session, boost::shared_ptr< cond::Logger > ilog)
 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)
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.

                 : me(){
    //topinit();    
  }
cond::CondDB::CondDB ( const CondDB other)

Definition at line 126 of file CondPyInterface.cc.

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

Definition at line 120 of file CondPyInterface.cc.

                                                                         :
    me(session), logger(ilog) {
    //topinit();
  }
cond::CondDB::~CondDB ( )

Definition at line 136 of file CondPyInterface.cc.

                  {
  }

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().

                                  {
    std::ostringstream ss;

    cond::MetaData metadata_svc(me);
    std::vector<std::string> alltags;
    me.transaction().start(true);
    metadata_svc.listAllTags(alltags);
    me.transaction().commit();
    
    std::copy (alltags.begin(),
               alltags.end(),
               std::ostream_iterator<std::string>(ss," ")
               );
    return ss.str();
  }
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().

                                                  {
    return IOVProxy(me,iovToken(tag),true,true);
  }
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().

                                                        {
    cond::MetaData metadata_svc(me);
    me.transaction().start(true);
    std::string token=metadata_svc.getToken(tag);
    me.transaction().commit();
    return token;
  }
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().

                                                         {
    return IOVProxy(me,iovToken(tag),false,true);
  }
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().

                                                                 {
    cond::LogDBEntry entry;
    if (logger)
      logger->LookupLastEntryByTag(tag,entry,false);
    return entry;
  }
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().

                                                                  {
    cond::LogDBEntry entry;
    if (logger)
      logger->LookupLastEntryByTag(tag,entry,true);
    return entry;
  }
CondDB & cond::CondDB::operator= ( const CondDB other)

Definition at line 129 of file CondPyInterface.cc.

References logger, and me.

                                                 {
    if (this==&other) return *this; // unless =0 this is an error condition!
    me = other.me;
    logger = other.logger;
    return *this;
  }
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().

                                                               {
    return IOVElementProxy(0,0,token,me);
  }
DbSession& cond::CondDB::session ( ) [inline]

Definition at line 60 of file CondPyInterface.h.

References me.

{ return 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 [mutable, private]

Definition at line 63 of file CondPyInterface.h.

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