CMS 3D CMS Logo

cond::IOVRevIteratorImpl Class Reference

#include <CondCore/IOVService/src/IOVRevIteratorImpl.h>

Inheritance diagram for cond::IOVRevIteratorImpl:

cond::IOVIterator

List of all members.

Public Types

typedef
IOV::Container::const_reverse_iterator 
const_iterator

Public Member Functions

virtual bool atEnd () const
virtual bool empty () const
 IOVRevIteratorImpl (cond::PoolTransaction &pooldb, const std::string &token)
virtual bool next ()
virtual std::string payloadToken () const
virtual size_t position () const
virtual bool rewind ()
virtual size_t size () const
TimeType timetype () const
virtual cond::ValidityInterval validity () const
 return the "closed" validity interval: i.e.
virtual ~IOVRevIteratorImpl ()

Private Member Functions

void init ()
IOV::Container const & iov () const
void open () const

Private Attributes

size_t m_count
cond::TypedRef< cond::IOVm_iov
bool m_isInit
bool m_isOpen
const_iterator m_next
cond::PoolTransactionm_pooldb
const_iterator m_pos
std::string m_token


Detailed Description

Definition at line 12 of file IOVRevIteratorImpl.h.


Member Typedef Documentation

typedef IOV::Container::const_reverse_iterator cond::IOVRevIteratorImpl::const_iterator

Definition at line 14 of file IOVRevIteratorImpl.h.


Constructor & Destructor Documentation

cond::IOVRevIteratorImpl::IOVRevIteratorImpl ( cond::PoolTransaction pooldb,
const std::string &  token 
)

Definition at line 3 of file IOVRevIteratorImpl.cc.

00005   : m_pooldb(pooldb),m_token(token), m_count(0),  m_isInit(false), m_isOpen(false){
00006 } 

cond::IOVRevIteratorImpl::~IOVRevIteratorImpl (  )  [virtual]

Definition at line 7 of file IOVRevIteratorImpl.cc.

00007                                            {
00008 }


Member Function Documentation

bool cond::IOVRevIteratorImpl::atEnd (  )  const [virtual]

Implements cond::IOVIterator.

Definition at line 44 of file IOVRevIteratorImpl.cc.

References iov(), m_isInit, and m_pos.

Referenced by next(), payloadToken(), and validity().

00044                                           {
00045   return  m_isInit && m_pos==iov().rend();
00046 }

bool cond::IOVRevIteratorImpl::empty (  )  const [virtual]

Implements cond::IOVIterator.

Definition at line 31 of file IOVRevIteratorImpl.cc.

References m_iov, and open().

Referenced by init(), next(), and rewind().

00031                                          {
00032   open();
00033   return m_iov->iov.empty();
00034 }

void cond::IOVRevIteratorImpl::init ( void   )  [private]

Definition at line 17 of file IOVRevIteratorImpl.cc.

References empty(), m_count, m_iov, m_isInit, m_next, m_pos, open(), and size().

Referenced by next(), and rewind().

00017                                  {
00018   open();
00019   m_isInit=true;
00020   m_pos=m_iov->iov.rbegin();
00021   m_next=m_pos; m_next++;
00022   m_count = empty() ? 0 : size()-1;
00023 }

IOV::Container const& cond::IOVRevIteratorImpl::iov (  )  const [inline, private]

Definition at line 34 of file IOVRevIteratorImpl.h.

References m_iov.

Referenced by atEnd(), and validity().

00034 { return m_iov->iov;}

bool cond::IOVRevIteratorImpl::next (  )  [virtual]

Implements cond::IOVIterator.

Definition at line 48 of file IOVRevIteratorImpl.cc.

References atEnd(), empty(), init(), m_count, m_isInit, m_next, and m_pos.

00048                                  {
00049   if(!m_isInit){
00050     init();
00051     return !empty();
00052   }
00053   if (atEnd() ) return false;
00054   m_pos=m_next;
00055   if (atEnd() ) return false;
00056   ++m_next;
00057   --m_count;
00058   return true;
00059 }

void cond::IOVRevIteratorImpl::open (  )  const [private]

Definition at line 10 of file IOVRevIteratorImpl.cc.

References m_iov, m_isOpen, m_pooldb, and m_token.

Referenced by empty(), init(), size(), and timetype().

00010                                        {
00011   if (m_isOpen) return;
00012   const_cast<cond::IOVRevIteratorImpl*>(this)->m_iov=
00013     cond::TypedRef<cond::IOV>(m_pooldb, m_token);
00014   const_cast<cond::IOVRevIteratorImpl*>(this)->m_isOpen=true;
00015 }

std::string cond::IOVRevIteratorImpl::payloadToken (  )  const [virtual]

Implements cond::IOVIterator.

Definition at line 62 of file IOVRevIteratorImpl.cc.

References atEnd(), m_isInit, and m_pos.

00062                                           {
00063   if(!m_isInit) return std::string("");
00064   
00065   return atEnd() ? std::string("") : m_pos->second;
00066   
00067 }

size_t cond::IOVRevIteratorImpl::position (  )  const [virtual]

Implements cond::IOVIterator.

Definition at line 39 of file IOVRevIteratorImpl.cc.

References m_count.

00039                                               {
00040   return m_count;
00041 }

bool cond::IOVRevIteratorImpl::rewind (  )  [virtual]

Definition at line 26 of file IOVRevIteratorImpl.cc.

References empty(), and init().

00026                                     {
00027   init();
00028   return !empty();
00029 }

size_t cond::IOVRevIteratorImpl::size ( void   )  const [virtual]

Implements cond::IOVIterator.

Definition at line 35 of file IOVRevIteratorImpl.cc.

References m_iov, and open().

Referenced by init().

00035                                           {
00036   open();
00037   return m_iov->iov.size();
00038 }

TimeType cond::IOVRevIteratorImpl::timetype (  )  const [inline, virtual]

Implements cond::IOVIterator.

Definition at line 25 of file IOVRevIteratorImpl.h.

References m_iov, and open().

00025                               {
00026       open();
00027       return (TimeType)(m_iov->timetype);
00028   }

cond::ValidityInterval cond::IOVRevIteratorImpl::validity (  )  const [virtual]

return the "closed" validity interval: i.e.

the payload is valid at both extremes included

Implements cond::IOVIterator.

Definition at line 70 of file IOVRevIteratorImpl.cc.

References atEnd(), iov(), m_iov, m_isInit, m_next, and m_pos.

00070                                       {
00071   cond::Time_t since=0;
00072   cond::Time_t till=0;
00073   if (m_isInit && !atEnd()) {
00074     till = m_pos->first;
00075     since = (m_next!=iov().rend()) ?  m_next->first + 1 : m_iov->firstsince;
00076   }
00077   return cond::ValidityInterval(since,till);
00078 }


Member Data Documentation

size_t cond::IOVRevIteratorImpl::m_count [private]

Definition at line 41 of file IOVRevIteratorImpl.h.

Referenced by init(), next(), and position().

cond::TypedRef<cond::IOV> cond::IOVRevIteratorImpl::m_iov [private]

Definition at line 38 of file IOVRevIteratorImpl.h.

Referenced by empty(), init(), iov(), open(), size(), timetype(), and validity().

bool cond::IOVRevIteratorImpl::m_isInit [private]

Definition at line 43 of file IOVRevIteratorImpl.h.

Referenced by atEnd(), init(), next(), payloadToken(), and validity().

bool cond::IOVRevIteratorImpl::m_isOpen [private]

Definition at line 44 of file IOVRevIteratorImpl.h.

Referenced by open().

const_iterator cond::IOVRevIteratorImpl::m_next [private]

Definition at line 40 of file IOVRevIteratorImpl.h.

Referenced by init(), next(), and validity().

cond::PoolTransaction& cond::IOVRevIteratorImpl::m_pooldb [private]

Definition at line 36 of file IOVRevIteratorImpl.h.

Referenced by open().

const_iterator cond::IOVRevIteratorImpl::m_pos [private]

Definition at line 39 of file IOVRevIteratorImpl.h.

Referenced by atEnd(), init(), next(), payloadToken(), and validity().

std::string cond::IOVRevIteratorImpl::m_token [private]

Definition at line 37 of file IOVRevIteratorImpl.h.

Referenced by open().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:36:45 2009 for CMSSW by  doxygen 1.5.4