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 ()
 IOVProxy (cond::DbSession &dbSession, const std::string &token, bool nolib, bool keepOpen)
std::string payloadContainerName () 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 58 of file IOVProxy.h.


Member Typedef Documentation

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

Definition at line 84 of file IOVProxy.h.


Constructor & Destructor Documentation

cond::IOVProxy::IOVProxy ( )

Definition at line 69 of file IOVProxy.cc.

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

Definition at line 71 of file IOVProxy.cc.

{}
cond::IOVProxy::IOVProxy ( cond::DbSession dbSession,
const std::string &  token,
bool  nolib,
bool  keepOpen 
)

Definition at line 73 of file IOVProxy.cc.

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

Member Function Documentation

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

Definition at line 86 of file IOVProxy.h.

References m_iov, and m_low.

Referenced by BOOST_PYTHON_MODULE(), 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 143 of file IOVProxy.cc.

References iov().

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 156 of file IOVProxy.cc.

References m_iov.

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

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

Definition at line 91 of file IOVProxy.h.

References m_high, and m_iov.

Referenced by BOOST_PYTHON_MODULE(), 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 112 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 103 of file IOVProxy.cc.

References m_high, m_low, and min.

Referenced by BOOST_PYTHON_MODULE().

IOV const & cond::IOVProxy::iov ( ) const
std::string cond::IOVProxy::payloadContainerName ( ) const

Definition at line 135 of file IOVProxy.cc.

References iov(), and cond::parseToken().

Referenced by BOOST_PYTHON_MODULE(), and HcalO2OManager::getListOfPoolIovs().

                                      {
    // FIXME move to metadata
    std::string payloadtokstr=iov().iovs().front().wrapperToken();
    std::pair<std::string,int> oidData = parseToken( payloadtokstr );
    return oidData.first;
  }
bool cond::IOVProxy::refresh ( )

Definition at line 80 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 88 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 148 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 94 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 121 of file IOVProxy.cc.

References iov().

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

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

Definition at line 115 of file IOVProxy.h.

References iov().

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

Definition at line 107 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 152 of file IOVProxy.cc.

References iov().

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 129 of file IOVProxy.cc.

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

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

                                    {
    return iov().timeType();     
  }

Member Data Documentation

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

Definition at line 129 of file IOVProxy.h.

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

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

Definition at line 127 of file IOVProxy.h.

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

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

Definition at line 128 of file IOVProxy.h.

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