CMS 3D CMS Logo

Classes | Public Types | Public Member Functions | Private Attributes

cond::IOVProxy Class Reference

#include <IOVProxy.h>

List of all members.

Classes

struct  IterHelp

Public Types

typedef
boost::transform_iterator
< IterHelp,
boost::counting_iterator< int > > 
const_iterator

Public Member Functions

const_iterator begin () const
std::string comment () const
DbSessiondb () const
const_iterator end () const
const_iterator find (cond::Time_t time) const
void head (int n) const
IOV const & iov () const
 IOVProxy (cond::DbSession &dbSession, const std::string &token)
 IOVProxy (cond::DbSession &dbSession)
 IOVProxy ()
void load (const std::string &token)
std::set< std::string > const & payloadClasses () const
bool refresh ()
void resetRange () const
int revision () const
void setRange (cond::Time_t since, cond::Time_t till) const
int size () const
SequenceState state () const
void tail (int n) const
cond::Time_t timestamp () const
TimeType timetype () const
 ~IOVProxy ()

Private Attributes

int m_high
boost::shared_ptr< impl::IOVImplm_iov
int m_low

Detailed Description

Definition at line 55 of file IOVProxy.h.


Member Typedef Documentation

typedef boost::transform_iterator<IterHelp,boost::counting_iterator<int> > cond::IOVProxy::const_iterator

Definition at line 83 of file IOVProxy.h.


Constructor & Destructor Documentation

cond::IOVProxy::IOVProxy ( )

Definition at line 81 of file IOVProxy.cc.

: m_low(0), m_high(0){}
cond::IOVProxy::~IOVProxy ( )

Definition at line 83 of file IOVProxy.cc.

{}
cond::IOVProxy::IOVProxy ( cond::DbSession dbSession) [explicit]

Definition at line 85 of file IOVProxy.cc.

    :m_iov(new impl::IOVImpl(dbSession)), m_low(0), m_high(0){}
cond::IOVProxy::IOVProxy ( cond::DbSession dbSession,
const std::string &  token 
)

Definition at line 88 of file IOVProxy.cc.

    :m_iov(new impl::IOVImpl(dbSession,token)), m_low(0), m_high(size()){}

Member Function Documentation

const_iterator cond::IOVProxy::begin ( void  ) const [inline]

Definition at line 85 of file IOVProxy.h.

References m_iov, and m_low.

Referenced by BOOST_PYTHON_MODULE(), cond::AlignSplitIOV::execute(), HcalO2OManager::getListOfPoolIovs(), CondBasicIter::init(), and cond::service::PoolDBOutputService::tagInfo().

                                 {
      return  boost::make_transform_iterator(boost::counting_iterator<int>(m_low),
                                             IterHelp(*m_iov));
    }
std::string cond::IOVProxy::comment ( ) const

Definition at line 158 of file IOVProxy.cc.

References iov().

Referenced by BOOST_PYTHON_MODULE().

                         {
    return iov().comment();
  }
cond::DbSession & cond::IOVProxy::db ( ) const

Definition at line 171 of file IOVProxy.cc.

References m_iov.

Referenced by cond::KeyList::load().

                                    {
    return m_iov->dbSession;
  }
const_iterator cond::IOVProxy::end ( void  ) const [inline]

Definition at line 90 of file IOVProxy.h.

References m_high, and m_iov.

Referenced by BOOST_PYTHON_MODULE(), cond::AlignSplitIOV::execute(), find(), CondBasicIter::forward(), HcalO2OManager::getListOfPoolIovs(), and CondBasicIter::init().

                               {
      return  boost::make_transform_iterator(boost::counting_iterator<int>(m_high),
                                             IterHelp(*m_iov));
    }
IOVProxy::const_iterator cond::IOVProxy::find ( cond::Time_t  time) const

Definition at line 130 of file IOVProxy.cc.

References end(), cond::IOV::find(), iov(), m_high, m_iov, m_low, and n.

Referenced by cond::BasePayloadProxy::loadFor(), and cond::BasePayloadProxy::setIntervalFor().

                                                             {
    int n = iov().find(time)-iov().iovs().begin();
    return (n<m_low || m_high<n ) ? 
      end() :  
      boost::make_transform_iterator(boost::counting_iterator<int>(n),
                                     IterHelp(*m_iov));
  }
void cond::IOVProxy::head ( int  n) const

Definition at line 121 of file IOVProxy.cc.

References m_high, m_low, and min.

Referenced by BOOST_PYTHON_MODULE().

IOV const & cond::IOVProxy::iov ( ) const
void cond::IOVProxy::load ( const std::string &  token)

Definition at line 92 of file IOVProxy.cc.

References m_high, m_iov, and size().

Referenced by cond::BasePayloadProxy::BasePayloadProxy(), cond::BasePayloadProxy::loadIov(), and cond::BasePayloadProxy::loadTag().

                                             {
    m_iov->m_token = token;
    m_iov->refresh();
    m_high = size();
  }
std::set< std::string > const & cond::IOVProxy::payloadClasses ( ) const

Definition at line 153 of file IOVProxy.cc.

References iov().

                                {
    return iov().payloadClasses();
  }
bool cond::IOVProxy::refresh ( )

Definition at line 98 of file IOVProxy.cc.

References m_high, m_iov, and size().

Referenced by cond::BasePayloadProxy::refresh().

                         {
    int oldsize = size();
    m_iov->refresh();
   bool anew = oldsize<size();
    if (anew) m_high = size();  // FIXME
    return anew;
  }
void cond::IOVProxy::resetRange ( ) const

Definition at line 106 of file IOVProxy.cc.

References m_high, m_low, and size().

Referenced by BOOST_PYTHON_MODULE().

                                  {
    m_low=0;
    m_high=size();
  }
int cond::IOVProxy::revision ( ) const

Definition at line 163 of file IOVProxy.cc.

References iov().

Referenced by BOOST_PYTHON_MODULE().

                          {
    return iov().revision();
  }
void cond::IOVProxy::setRange ( cond::Time_t  since,
cond::Time_t  till 
) const

Definition at line 112 of file IOVProxy.cc.

References cond::IOV::find(), iov(), m_high, m_low, min, and size().

Referenced by BOOST_PYTHON_MODULE(), CondBasicIter::setMax(), CondBasicIter::setMin(), and CondBasicIter::setRange().

                                                                  {
     m_low = (since<iov().iovs().front().sinceTime()) ? 0 :
      iov().find(since)-iov().iovs().begin();
    m_high=iov().find(till)-iov().iovs().begin();
    m_high=std::min(m_high+1,size());
  }
int cond::IOVProxy::size ( void  ) const

Definition at line 139 of file IOVProxy.cc.

References iov().

Referenced by BOOST_PYTHON_MODULE(), load(), refresh(), resetRange(), setRange(), and cond::service::PoolDBOutputService::tagInfo().

                           {
    return iov().iovs().size();
  }
SequenceState cond::IOVProxy::state ( ) const [inline]

Definition at line 114 of file IOVProxy.h.

References iov().

                                {
      return SequenceState(iov());
    }
void cond::IOVProxy::tail ( int  n) const

Definition at line 125 of file IOVProxy.cc.

References m_high, m_low, and max().

Referenced by BOOST_PYTHON_MODULE(), and cond::service::PoolDBOutputService::tagInfo().

cond::Time_t cond::IOVProxy::timestamp ( ) const

Definition at line 167 of file IOVProxy.cc.

References iov().

Referenced by BOOST_PYTHON_MODULE().

                                       {
    return iov().timestamp();
  }
TimeType cond::IOVProxy::timetype ( ) const

Definition at line 147 of file IOVProxy.cc.

References iov(), and cond::IOV::timeType().

Referenced by BOOST_PYTHON_MODULE(), cond::AlignSplitIOV::execute(), and cond::BasePayloadProxy::timetype().

                                    {
    return iov().timeType();     
  }

Member Data Documentation

int cond::IOVProxy::m_high [mutable, private]

Definition at line 128 of file IOVProxy.h.

Referenced by end(), find(), head(), load(), refresh(), resetRange(), setRange(), and tail().

boost::shared_ptr<impl::IOVImpl> cond::IOVProxy::m_iov [private]

Definition at line 126 of file IOVProxy.h.

Referenced by begin(), db(), end(), find(), load(), and refresh().

int cond::IOVProxy::m_low [mutable, private]

Definition at line 127 of file IOVProxy.h.

Referenced by begin(), find(), head(), resetRange(), setRange(), and tail().