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 (const IOVProxy &rhs)
 IOVProxy ()
 IOVProxy (cond::DbSession &dbSession)
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 ()
bool refresh (cond::DbSession &newSession)
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 158 of file IOVProxy.h.


Member Typedef Documentation

Definition at line 160 of file IOVProxy.h.


Constructor & Destructor Documentation

cond::IOVProxy::IOVProxy ( )

Definition at line 168 of file IOVProxy.cc.

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

Definition at line 172 of file IOVProxy.cc.

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

Definition at line 175 of file IOVProxy.cc.

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

Definition at line 179 of file IOVProxy.cc.

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

Definition at line 184 of file IOVProxy.cc.

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

Definition at line 188 of file IOVProxy.cc.

                                           :
  m_iov( rhs.m_iov ){
}

Member Function Documentation

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

Definition at line 188 of file IOVProxy.h.

References m_iov.

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

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

Definition at line 298 of file IOVProxy.cc.

References o2o::iov.

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 311 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 193 of file IOVProxy.h.

References getHLTprescales::index, m_iov, and size().

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

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

Definition at line 264 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 284 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 256 of file IOVProxy.cc.

Referenced by BOOST_PYTHON_MODULE().

                                           {
  return IOVRange( m_iov, n );
}
cond::IOVSequence const & cond::IOVProxy::iov ( ) const
bool cond::IOVProxy::isValid ( cond::Time_t  currenttime)

Definition at line 218 of file IOVProxy.cc.

References o2o::iov.

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

Definition at line 288 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 192 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 293 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 239 of file IOVProxy.cc.

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

                                                             {
  return IOVRange( m_iov, since, till );
}
cond::IOVRange cond::IOVProxy::rangeHead ( cond::Time_t  since,
cond::Time_t  till,
int  n 
) const

Definition at line 244 of file IOVProxy.cc.

Referenced by BOOST_PYTHON_MODULE().

                                                      {
  return IOVRange( m_iov, since, till, n );
}
cond::IOVRange cond::IOVProxy::rangeTail ( cond::Time_t  since,
cond::Time_t  till,
int  n 
) const

Definition at line 250 of file IOVProxy.cc.

Referenced by BOOST_PYTHON_MODULE().

                                                      {
  return IOVRange( m_iov, since, till, -n );
}
bool cond::IOVProxy::refresh ( cond::DbSession newSession)

Definition at line 208 of file IOVProxy.cc.

References findQualityFiles::size.

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

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

References o2o::iov.

Referenced by BOOST_PYTHON_MODULE().

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

Definition at line 272 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 232 of file IOVProxy.h.

References iov().

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

Definition at line 260 of file IOVProxy.cc.

Referenced by BOOST_PYTHON_MODULE().

                                           {
  return IOVRange( m_iov, -n );
}
cond::Time_t cond::IOVProxy::timestamp ( ) const

Definition at line 307 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 214 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 223 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 239 of file IOVProxy.h.

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