CMS 3D CMS Logo

Public Member Functions | Public Attributes

cond::impl::IOVImpl Struct Reference

List of all members.

Public Member Functions

 IOVImpl (cond::DbSession &dbs, const std::string &token, bool, bool keepOpen)
void refresh ()
 ~IOVImpl ()

Public Attributes

boost::shared_ptr
< cond::IOVSequence
iov
bool m_keepOpen
std::string m_token
cond::DbSession poolDb

Detailed Description

Definition at line 14 of file IOVProxy.cc.


Constructor & Destructor Documentation

cond::impl::IOVImpl::IOVImpl ( cond::DbSession dbs,
const std::string &  token,
bool  ,
bool  keepOpen 
) [inline]

Definition at line 15 of file IOVProxy.cc.

References cond::DbTransaction::isActive(), cond::DbTransaction::isReadOnly(), m_keepOpen, poolDb, refresh(), cond::DbTransaction::start(), and cond::DbSession::transaction().

                             : poolDb(dbs), m_token(token), /*m_nolib(nolib),*/ m_keepOpen(keepOpen){
        refresh();
        if (m_keepOpen) {
          if(poolDb.transaction().isActive() && !poolDb.transaction().isReadOnly())
            poolDb.transaction().start(false);
          else poolDb.transaction().start(true);
        }
      }
cond::impl::IOVImpl::~IOVImpl ( ) [inline]

Definition at line 43 of file IOVProxy.cc.

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

                {
        if (m_keepOpen) poolDb.transaction().commit();
      }

Member Function Documentation

void cond::impl::IOVImpl::refresh ( ) [inline]

Definition at line 27 of file IOVProxy.cc.

References cond::DbScopedTransaction::commit(), cond::DbSession::getTypedObject(), iov, cond::DbScopedTransaction::isActive(), cond::DbScopedTransaction::isReadOnly(), m_token, poolDb, cond::DbScopedTransaction::start(), and python::IdGenerator::transaction.

Referenced by IOVImpl().

                     {
        cond::DbScopedTransaction transaction(poolDb);
        if(transaction.isActive() && !transaction.isReadOnly())
          transaction.start(false);
        else transaction.start(true);
        iov = poolDb.getTypedObject<cond::IOVSequence>( m_token );
        transaction.commit();
        /*
          if (!iov->iovs().empty() && !m_nolib) {
          // load dict (change: use IOV metadata....)
          std::string ptok = iov->iovs().front().wrapperToken();
          cond::reflexTypeByToken(ptok);
          }
        */
      }

Member Data Documentation

Definition at line 48 of file IOVProxy.cc.

Referenced by refresh().

Definition at line 51 of file IOVProxy.cc.

Referenced by IOVImpl(), and ~IOVImpl().

Definition at line 49 of file IOVProxy.cc.

Referenced by refresh().

Definition at line 47 of file IOVProxy.cc.

Referenced by IOVImpl(), refresh(), and ~IOVImpl().