#include <CondCore/IOVService/src/IOVRevIteratorImpl.h>
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::IOV > | m_iov |
bool | m_isInit |
bool | m_isOpen |
const_iterator | m_next |
cond::PoolTransaction & | m_pooldb |
const_iterator | m_pos |
std::string | m_token |
Definition at line 12 of file IOVRevIteratorImpl.h.
typedef IOV::Container::const_reverse_iterator cond::IOVRevIteratorImpl::const_iterator |
Definition at line 14 of file IOVRevIteratorImpl.h.
cond::IOVRevIteratorImpl::IOVRevIteratorImpl | ( | cond::PoolTransaction & | pooldb, | |
const std::string & | token | |||
) |
cond::IOVRevIteratorImpl::~IOVRevIteratorImpl | ( | ) | [virtual] |
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().
bool cond::IOVRevIteratorImpl::empty | ( | ) | const [virtual] |
Implements cond::IOVIterator.
Definition at line 31 of file IOVRevIteratorImpl.cc.
Referenced by init(), next(), and rewind().
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] |
size_t cond::IOVRevIteratorImpl::size | ( | void | ) | const [virtual] |
Implements cond::IOVIterator.
Definition at line 35 of file IOVRevIteratorImpl.cc.
Referenced by init().
TimeType cond::IOVRevIteratorImpl::timetype | ( | ) | const [inline, virtual] |
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 }
size_t cond::IOVRevIteratorImpl::m_count [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 39 of file IOVRevIteratorImpl.h.
Referenced by atEnd(), init(), next(), payloadToken(), and validity().
std::string cond::IOVRevIteratorImpl::m_token [private] |