CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
cond::IOVProxy Class Reference

#include <IOVProxy.h>

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 ()
 
 IOVProxy (cond::DbSession &dbSession)
 
 IOVProxy (cond::DbSession &dbSession, const std::string &token)
 
 IOVProxy (boost::shared_ptr< IOVProxyData > &data)
 
 IOVProxy (const IOVProxy &rhs)
 
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.

168  :
169  m_iov(){
170 }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
cond::IOVProxy::~IOVProxy ( )

Definition at line 172 of file IOVProxy.cc.

172  {
173 }
cond::IOVProxy::IOVProxy ( cond::DbSession dbSession)
explicit

Definition at line 175 of file IOVProxy.cc.

175  :
176  m_iov(new IOVProxyData(dbSession)){
177 }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
cond::IOVProxy::IOVProxy ( cond::DbSession dbSession,
const std::string &  token 
)

Definition at line 179 of file IOVProxy.cc.

180  :
181  m_iov(new IOVProxyData(dbSession,token)){
182 }
const std::string & token()
Definition: IOVProxy.cc:214
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
cond::IOVProxy::IOVProxy ( boost::shared_ptr< IOVProxyData > &  data)

Definition at line 184 of file IOVProxy.cc.

184  :
185  m_iov( data ){
186 }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
cond::IOVProxy::IOVProxy ( const IOVProxy rhs)

Definition at line 188 of file IOVProxy.cc.

188  :
189  m_iov( rhs.m_iov ){
190 }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239

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().

188  {
189  return boost::make_transform_iterator(boost::counting_iterator<int>(0),
190  IterHelp(*m_iov));
191  }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
std::string cond::IOVProxy::comment ( ) const

Definition at line 298 of file IOVProxy.cc.

References o2o::iov.

Referenced by BOOST_PYTHON_MODULE().

298  {
299  return iov().comment();
300 }
IOVSequence const & iov() const
Definition: IOVProxy.cc:276
std::string const & comment() const
Definition: UpdateStamp.h:30
cond::DbSession & cond::IOVProxy::db ( ) const

Definition at line 311 of file IOVProxy.cc.

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

311  {
312  return m_iov->dbSession;
313 }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
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(), Types.LuminosityBlockRange::cppID(), Types.EventRange::cppID(), cond::AlignSplitIOV::execute(), HcalO2OManager::getListOfPoolIovs(), l1t::DataWriter::payloadToken(), TestFunct::ReadWithIOV(), and cond::service::PoolDBOutputService::tagInfo().

193  {
194  int index = size();
195  return boost::make_transform_iterator(boost::counting_iterator<int>(index),
196  IterHelp(*m_iov));
197  }
int size() const
Definition: IOVProxy.cc:272
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
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 BeautifulSoup.Tag::_invert(), BeautifulSoup.PageElement::insert(), cond::BasePayloadProxy::loadFor(), l1t::DataWriter::payloadToken(), TestFunct::ReadWithIOV(), and cond::BasePayloadProxy::setIntervalFor().

264  {
265  int n = iov().find(time)-iov().iovs().begin();
266  return ( n<0 || n>size() ) ?
267  end() :
268  boost::make_transform_iterator(boost::counting_iterator<int>(n),
269  IterHelp(*m_iov));
270 }
const_iterator find(cond::Time_t time) const
Definition: IOVSequence.cc:110
Container const & iovs() const
Definition: IOVSequence.cc:76
const_iterator end() const
Definition: IOVProxy.h:193
IOVSequence const & iov() const
Definition: IOVProxy.cc:276
int size() const
Definition: IOVProxy.cc:272
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
cond::Time_t cond::IOVProxy::firstSince ( ) const

Definition at line 284 of file IOVProxy.cc.

References o2o::iov.

Referenced by BOOST_PYTHON_MODULE().

284  {
285  return iov().firstSince();
286 }
cond::Time_t firstSince() const
Definition: IOVSequence.h:62
IOVSequence const & iov() const
Definition: IOVProxy.cc:276
cond::IOVRange cond::IOVProxy::head ( int  n) const

Definition at line 256 of file IOVProxy.cc.

Referenced by BOOST_PYTHON_MODULE().

256  {
257  return IOVRange( m_iov, n );
258 }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
cond::IOVSequence const & cond::IOVProxy::iov ( ) const

Definition at line 276 of file IOVProxy.cc.

Referenced by cond::ExportIOVUtilities::execute(), cond::KeyList::load(), cond::BasePayloadProxy::loadFor(), cond::IOVImportIterator::setUp(), and state().

276  {
277  return *(m_iov->data);
278 }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
bool cond::IOVProxy::isValid ( cond::Time_t  currenttime)

Definition at line 218 of file IOVProxy.cc.

References o2o::iov.

218  {
219  return ( currenttime >= iov().firstSince() &&
220  currenttime <= iov().lastTill() );
221 }
cond::Time_t firstSince() const
Definition: IOVProxy.cc:284
IOVSequence const & iov() const
Definition: IOVProxy.cc:276
cond::Time_t lastTill() const
Definition: IOVProxy.cc:288
cond::Time_t cond::IOVProxy::lastTill ( ) const

Definition at line 288 of file IOVProxy.cc.

References o2o::iov.

Referenced by BOOST_PYTHON_MODULE().

288  {
289  return iov().lastTill();
290 }
cond::Time_t lastTill() const
Definition: IOVSequence.h:64
IOVSequence const & iov() const
Definition: IOVProxy.cc:276
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.

192  {
193  m_iov = rhs.m_iov;
194  return *this;
195 }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
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().

293  {
294  return iov().payloadClasses();
295 }
IOVSequence const & iov() const
Definition: IOVProxy.cc:276
std::set< std::string > const & payloadClasses() const
Definition: IOVSequence.h:80
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().

240  {
241  return IOVRange( m_iov, since, till );
242 }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
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().

246  {
247  return IOVRange( m_iov, since, till, n );
248 }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
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().

252  {
253  return IOVRange( m_iov, since, till, -n );
254 }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
bool cond::IOVProxy::refresh ( )

Definition at line 202 of file IOVProxy.cc.

References findQualityFiles::size.

Referenced by Vispa.Main.TabController.TabController::checkModificationTimestamp(), and cond::BasePayloadProxy::refresh().

202  {
203  int oldsize = size();
204  m_iov->refresh();
205  return oldsize<size();
206 }
int size() const
Definition: IOVProxy.cc:272
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
bool cond::IOVProxy::refresh ( cond::DbSession newSession)

Definition at line 208 of file IOVProxy.cc.

References findQualityFiles::size.

Referenced by Vispa.Main.TabController.TabController::checkModificationTimestamp().

208  {
209  int oldsize = size();
210  m_iov->refresh( newSession );
211  return oldsize<size();
212 }
int size() const
Definition: IOVProxy.cc:272
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
int cond::IOVProxy::revision ( ) const

Definition at line 303 of file IOVProxy.cc.

References o2o::iov.

Referenced by BOOST_PYTHON_MODULE().

303  {
304  return iov().revision();
305 }
int revision() const
Definition: UpdateStamp.h:26
IOVSequence const & iov() const
Definition: IOVProxy.cc:276
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().

272  {
273  return iov().iovs().size();
274 }
Container const & iovs() const
Definition: IOVSequence.cc:76
IOVSequence const & iov() const
Definition: IOVProxy.cc:276
SequenceState cond::IOVProxy::state ( ) const
inline

Definition at line 232 of file IOVProxy.h.

References iov().

232  {
233  return SequenceState(iov());
234  }
IOVSequence const & iov() const
Definition: IOVProxy.cc:276
cond::IOVRange cond::IOVProxy::tail ( int  n) const

Definition at line 260 of file IOVProxy.cc.

Referenced by BOOST_PYTHON_MODULE().

260  {
261  return IOVRange( m_iov, -n );
262 }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
cond::Time_t cond::IOVProxy::timestamp ( ) const

Definition at line 307 of file IOVProxy.cc.

References o2o::iov.

Referenced by BOOST_PYTHON_MODULE().

307  {
308  return iov().timestamp();
309 }
cond::Time_t timestamp() const
Definition: UpdateStamp.h:28
IOVSequence const & iov() const
Definition: IOVProxy.cc:276
cond::TimeType cond::IOVProxy::timetype ( ) const

Definition at line 280 of file IOVProxy.cc.

References o2o::iov.

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

280  {
281  return iov().timeType();
282 }
IOVSequence const & iov() const
Definition: IOVProxy.cc:276
cond::TimeType timeType() const
Definition: IOVSequence.h:59
const std::string & cond::IOVProxy::token ( )

Definition at line 214 of file IOVProxy.cc.

Referenced by BOOST_PYTHON_MODULE().

214  {
215  return m_iov->token;
216 }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
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.

223  {
224  cond::Time_t since=iov().firstSince();
225  cond::Time_t till=iov().lastTill();
226  IOVSequence::const_iterator iter=iov().find(currenttime);
227  if (iter!=iov().iovs().end()) {
228  since=iter->sinceTime();
229  iter++;
230  if (iter!=iov().iovs().end())
231  till = iter->sinceTime()-1;
232  }
233  else {
234  since=iov().lastTill();
235  }
236  return std::pair<cond::Time_t, cond::Time_t>(since,till);
237 }
cond::Time_t lastTill() const
Definition: IOVSequence.h:64
const_iterator find(cond::Time_t time) const
Definition: IOVSequence.cc:110
cond::Time_t firstSince() const
Definition: IOVSequence.h:62
const_iterator end() const
Definition: IOVProxy.h:193
Container::const_iterator const_iterator
Definition: IOVSequence.h:28
unsigned long long Time_t
Definition: Time.h:16
IOVSequence const & iov() const
Definition: IOVProxy.cc:276

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=().