CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

cond::IOVProxy Class Reference

#include <IOVProxy.h>

List of all members.

Public Types

typedef iov_range_iterator 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
cond::Time_t firstSince () const
IOVRange head (int n) const
IOVSequence const & iov () const
 IOVProxy (cond::DbSession &dbSession, const std::string &token)
 IOVProxy (boost::shared_ptr< IOVProxyData > &data)
 IOVProxy (cond::DbSession &dbSession)
 IOVProxy (const IOVProxy &rhs)
 IOVProxy ()
bool isValid (cond::Time_t currenttime)
cond::Time_t lastTill () const
void load (const std::string &token)
IOVProxyoperator= (const IOVProxy &rhs)
std::set< std::string > const & payloadClasses () const
IOVRange range (cond::Time_t since, cond::Time_t till) const
IOVRange rangeHead (cond::Time_t since, cond::Time_t till, int n) const
IOVRange rangeTail (cond::Time_t since, cond::Time_t till, int n) const
bool refresh ()
int revision () const
int size () const
SequenceState state () const
IOVRange tail (int n) const
cond::Time_t timestamp () const
TimeType timetype () const
const std::string & token ()
std::pair< cond::Time_t,
cond::Time_t
validity (cond::Time_t currenttime)
 ~IOVProxy ()

Private Attributes

boost::shared_ptr< IOVProxyDatam_iov

Detailed Description

Definition at line 142 of file IOVProxy.h.


Member Typedef Documentation

Definition at line 144 of file IOVProxy.h.


Constructor & Destructor Documentation

cond::IOVProxy::IOVProxy ( )

Definition at line 114 of file IOVProxy.cc.

                       : 
  m_iov(){
}
cond::IOVProxy::~IOVProxy ( )

Definition at line 118 of file IOVProxy.cc.

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

Definition at line 121 of file IOVProxy.cc.

                                              :
  m_iov(new IOVProxyData(dbSession)){
}
cond::IOVProxy::IOVProxy ( cond::DbSession dbSession,
const std::string &  token 
)

Definition at line 125 of file IOVProxy.cc.

                                                 :
  m_iov(new IOVProxyData(dbSession,token)){
}
cond::IOVProxy::IOVProxy ( boost::shared_ptr< IOVProxyData > &  data)

Definition at line 130 of file IOVProxy.cc.

                                                           :
  m_iov( data ){
}
cond::IOVProxy::IOVProxy ( const IOVProxy rhs)

Definition at line 134 of file IOVProxy.cc.

                                           :
  m_iov( rhs.m_iov ){
}

Member Function Documentation

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

Definition at line 171 of file IOVProxy.h.

References m_iov.

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

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

Definition at line 243 of file IOVProxy.cc.

References o2o::iov.

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 256 of file IOVProxy.cc.

Referenced by cond::IOVImportIterator::importMoreElements(), and cond::KeyList::load().

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

Definition at line 176 of file IOVProxy.h.

References m_iov, and size().

Referenced by BOOST_PYTHON_MODULE(), cond::AlignSplitIOV::execute(), HcalO2OManager::getListOfPoolIovs(), l1t::DataWriter::payloadToken(), and TestFunct::ReadWithIOV().

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

Definition at line 209 of file IOVProxy.cc.

References end, o2o::iov, n, and findQualityFiles::size.

Referenced by cond::BasePayloadProxy::loadFor(), l1t::DataWriter::payloadToken(), TestFunct::ReadWithIOV(), and cond::BasePayloadProxy::setIntervalFor().

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

Definition at line 229 of file IOVProxy.cc.

References o2o::iov.

Referenced by BOOST_PYTHON_MODULE().

                                          {
  return iov().firstSince();
}
cond::IOVRange cond::IOVProxy::head ( int  n) const

Definition at line 199 of file IOVProxy.cc.

References min, and findQualityFiles::size.

Referenced by BOOST_PYTHON_MODULE().

                                           {
  int high = std::min( n, size() );
  return IOVRange( m_iov, 0, high );  
}
cond::IOVSequence const & cond::IOVProxy::iov ( ) const
bool cond::IOVProxy::isValid ( cond::Time_t  currenttime)

Definition at line 158 of file IOVProxy.cc.

References o2o::iov.

                                                  {
  return (  currenttime >= iov().firstSince() && 
            currenttime <= iov().lastTill() );
}
cond::Time_t cond::IOVProxy::lastTill ( ) const

Definition at line 233 of file IOVProxy.cc.

References o2o::iov.

Referenced by BOOST_PYTHON_MODULE().

                                        {
  return iov().lastTill();
}
void cond::IOVProxy::load ( const std::string &  token)
cond::IOVProxy & cond::IOVProxy::operator= ( const IOVProxy rhs)

Definition at line 138 of file IOVProxy.cc.

References m_iov.

                                                          {
  m_iov = rhs.m_iov;
  return *this;
}
std::set< std::string > const & cond::IOVProxy::payloadClasses ( ) const

Definition at line 238 of file IOVProxy.cc.

References o2o::iov.

Referenced by cond::ExportIOVUtilities::execute().

                                  {
  return iov().payloadClasses();
}
cond::IOVRange cond::IOVProxy::range ( cond::Time_t  since,
cond::Time_t  till 
) const

Definition at line 179 of file IOVProxy.cc.

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

                                                             {
  std::pair<int,int> rg = m_iov->range( since, till );
  return IOVRange( m_iov, rg.first, rg.second );
}
cond::IOVRange cond::IOVProxy::rangeHead ( cond::Time_t  since,
cond::Time_t  till,
int  n 
) const

Definition at line 185 of file IOVProxy.cc.

References min.

Referenced by BOOST_PYTHON_MODULE().

                                                      {
  std::pair<int,int> rg = m_iov->range( since, till );
  return IOVRange( m_iov, rg.first, std::min( rg.first+n, rg.second ) );  
}
cond::IOVRange cond::IOVProxy::rangeTail ( cond::Time_t  since,
cond::Time_t  till,
int  n 
) const

Definition at line 192 of file IOVProxy.cc.

References max().

Referenced by BOOST_PYTHON_MODULE().

                                                      {
  std::pair<int,int> rg = m_iov->range( since, till );
  return IOVRange( m_iov, std::max( rg.second-n,rg.first), rg.second );
}
bool cond::IOVProxy::refresh ( )

Definition at line 148 of file IOVProxy.cc.

References findQualityFiles::size.

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

                          {
  int oldsize = size();
  m_iov->refresh();
  return oldsize<size();
}
int cond::IOVProxy::revision ( ) const

Definition at line 248 of file IOVProxy.cc.

References o2o::iov.

Referenced by BOOST_PYTHON_MODULE().

                            {
  return iov().revision();
}
int cond::IOVProxy::size ( void  ) const

Definition at line 217 of file IOVProxy.cc.

References o2o::iov.

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

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

Definition at line 214 of file IOVProxy.h.

References iov().

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

Definition at line 204 of file IOVProxy.cc.

References max(), and findQualityFiles::size.

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

                                           {
  int low = std::max(size()-n, 0);
  return IOVRange( m_iov, low, size() );  
}
cond::Time_t cond::IOVProxy::timestamp ( ) const

Definition at line 252 of file IOVProxy.cc.

References o2o::iov.

Referenced by BOOST_PYTHON_MODULE().

                                         {
  return iov().timestamp();
}
cond::TimeType cond::IOVProxy::timetype ( ) const
const std::string & cond::IOVProxy::token ( )

Definition at line 154 of file IOVProxy.cc.

Referenced by BOOST_PYTHON_MODULE().

                                    {
  return m_iov->token;
}
std::pair< cond::Time_t, cond::Time_t > cond::IOVProxy::validity ( cond::Time_t  currenttime)

Definition at line 163 of file IOVProxy.cc.

References end, and o2o::iov.

                                                                              {  
  cond::Time_t since=iov().firstSince();
  cond::Time_t till=iov().lastTill();
  IOVSequence::const_iterator iter=iov().find(currenttime);
  if (iter!=iov().iovs().end())  {
    since=iter->sinceTime();
    iter++;
    if (iter!=iov().iovs().end()) 
      till = iter->sinceTime()-1;
  }
  else {
    since=iov().lastTill();
  }
  return std::pair<cond::Time_t, cond::Time_t>(since,till);
}

Member Data Documentation

boost::shared_ptr<IOVProxyData> cond::IOVProxy::m_iov [private]

Definition at line 221 of file IOVProxy.h.

Referenced by begin(), end(), and operator=().