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_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 (const 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

IOVProxy::IOVProxy ( )

Definition at line 171 of file IOVProxy.cc.

171  :
172  m_iov(){
173 }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
IOVProxy::~IOVProxy ( )

Definition at line 175 of file IOVProxy.cc.

175  {
176 }
IOVProxy::IOVProxy ( cond::DbSession dbSession)
explicit

Definition at line 178 of file IOVProxy.cc.

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

Definition at line 182 of file IOVProxy.cc.

183  :
184  m_iov(new IOVProxyData(dbSession,token)){
185 }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
const std::string & token()
Definition: IOVProxy.cc:217
IOVProxy::IOVProxy ( const boost::shared_ptr< IOVProxyData > &  data)

Definition at line 187 of file IOVProxy.cc.

187  :
188  m_iov( data ){
189 }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
IOVProxy::IOVProxy ( const IOVProxy rhs)

Definition at line 191 of file IOVProxy.cc.

191  :
192  m_iov( rhs.m_iov ){
193 }
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 IOVProxy::comment ( ) const

Definition at line 299 of file IOVProxy.cc.

References o2o::iov.

Referenced by BOOST_PYTHON_MODULE(), cond::persistency::OraTagTable::getMetadata(), and cond::persistency::OraTagTable::select().

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

Definition at line 312 of file IOVProxy.cc.

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

312  {
313  return m_iov->dbSession;
314 }
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 cmsHarvester::index, m_iov, and size().

Referenced by BOOST_PYTHON_MODULE(), Types.LuminosityBlockRange::cppID(), Types.EventRange::cppID(), cond::AlignSplitIOV::execute(), cond::persistency::OraIOVTable::getLastIov(), HcalO2OManager::getListOfPoolIovs(), and TestFunct::ReadWithIOV().

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 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::__getattr__(), BeautifulSoup.Tag::firstText(), cond::BasePayloadProxy::loadFor(), 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 }
IOVSequence const & iov() const
Definition: IOVProxy.cc:276
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
int size() const
Definition: IOVProxy.cc:272
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
cond::Time_t IOVProxy::firstSince ( ) const

Definition at line 285 of file IOVProxy.cc.

References o2o::iov.

Referenced by BOOST_PYTHON_MODULE(), and cond::persistency::OraIOVTable::selectGroups().

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

Definition at line 256 of file IOVProxy.cc.

Referenced by BOOST_PYTHON_MODULE(), and cond::persistency::OraTagTable::select().

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

Definition at line 276 of file IOVProxy.cc.

References cond::throwException().

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

276  {
277  if( !m_iov->data.get() ) throwException( "No data found.", "IOVProxy::iov" );
278  return *(m_iov->data);
279 }
void throwException(std::string const &message, std::string const &methodName)
Definition: Exception.cc:17
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
bool IOVProxy::isValid ( cond::Time_t  currenttime)

Definition at line 221 of file IOVProxy.cc.

References o2o::iov.

Referenced by core.AutoHandle.AutoHandle::ReallyLoad().

221  {
222  return ( currenttime >= iov().firstSince() &&
223  currenttime <= iov().lastTill() );
224 }
IOVSequence const & iov() const
Definition: IOVProxy.cc:276
cond::Time_t lastTill() const
Definition: IOVProxy.cc:289
cond::Time_t firstSince() const
Definition: IOVProxy.cc:285
cond::Time_t IOVProxy::lastTill ( ) const

Definition at line 289 of file IOVProxy.cc.

References o2o::iov.

Referenced by BOOST_PYTHON_MODULE(), cond::persistency::OraTagTable::select(), and cond::persistency::OraIOVTable::selectGroups().

289  {
290  return iov().lastTill();
291 }
cond::Time_t lastTill() const
Definition: IOVSequence.h:65
IOVSequence const & iov() const
Definition: IOVProxy.cc:276
void IOVProxy::load ( const std::string &  token)
cond::IOVProxy & IOVProxy::operator= ( const IOVProxy rhs)

Definition at line 195 of file IOVProxy.cc.

References m_iov.

195  {
196  m_iov = rhs.m_iov;
197  return *this;
198 }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
std::set< std::string > const & IOVProxy::payloadClasses ( ) const

Definition at line 294 of file IOVProxy.cc.

References o2o::iov.

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

294  {
295  return iov().payloadClasses();
296 }
IOVSequence const & iov() const
Definition: IOVProxy.cc:276
std::set< std::string > const & payloadClasses() const
Definition: IOVSequence.h:81
cond::IOVRange IOVProxy::range ( cond::Time_t  since,
cond::Time_t  till 
) const

Definition at line 239 of file IOVProxy.cc.

Referenced by BOOST_PYTHON_MODULE(), cond::persistency::OraIOVTable::selectLatestByGroup(), 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 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 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 IOVProxy::refresh ( )

Definition at line 205 of file IOVProxy.cc.

References findQualityFiles::size.

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

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

Definition at line 211 of file IOVProxy.cc.

References findQualityFiles::size.

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

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

Definition at line 304 of file IOVProxy.cc.

References o2o::iov.

Referenced by BOOST_PYTHON_MODULE().

304  {
305  return iov().revision();
306 }
IOVSequence const & iov() const
Definition: IOVProxy.cc:276
int revision() const
Definition: UpdateStamp.h:28
int IOVProxy::size ( void  ) const
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 IOVProxy::tail ( int  n) const

Definition at line 260 of file IOVProxy.cc.

Referenced by BOOST_PYTHON_MODULE(), and cond::persistency::OraTagTable::select().

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

Definition at line 308 of file IOVProxy.cc.

References o2o::iov.

Referenced by BOOST_PYTHON_MODULE(), and cond::persistency::OraTagTable::getMetadata().

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

Definition at line 281 of file IOVProxy.cc.

References o2o::iov.

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

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

Definition at line 217 of file IOVProxy.cc.

Referenced by BOOST_PYTHON_MODULE().

217  {
218  return m_iov->token;
219 }
boost::shared_ptr< IOVProxyData > m_iov
Definition: IOVProxy.h:239
std::pair< cond::Time_t, cond::Time_t > IOVProxy::validity ( cond::Time_t  currenttime)

Definition at line 226 of file IOVProxy.cc.

References end, o2o::iov, and getDQMSummary::iter.

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

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