#include <QueryableVector.h>
Public Types | |
typedef PVector< Tp > ::const_iterator | const_iterator |
typedef PVector< Tp > ::const_reference | const_reference |
typedef PVector< Tp > ::const_reverse_iterator | const_reverse_iterator |
typedef PVector< Tp >::iterator | iterator |
typedef std::vector< std::pair < size_t, Tp > > | range_store_base_type |
typedef PVector< Tp >::reference | reference |
typedef PVector< Tp > ::reverse_iterator | reverse_iterator |
typedef PVector< Tp >::size_type | size_type |
typedef PVector< Tp > | store_base_type |
typedef PVector< Tp >::value_type | value_type |
Public Member Functions | |
void | assign (size_t n, const Tp &u) |
reference | at (size_t n) |
const_reference | at (size_t n) const |
const_reference | back () const |
reference | back () |
const_iterator | begin () const |
iterator | begin () |
size_t | capacity () const |
void | clear () |
bool | empty () const |
iterator | end () |
const_iterator | end () const |
reference | front () |
const_reference | front () const |
bool | isLocked () const |
void | load () const |
bool | lock () |
size_t | max_size () const |
bool | operator!= (const QueryableVector &vec) const |
QueryableVector< Tp > & | operator= (const QueryableVector< Tp > &rhs) |
bool | operator== (const QueryableVector &vec) const |
reference | operator[] (size_t n) |
const_reference | operator[] (size_t n) const |
size_t | persistentSize () const |
void | pop_back () |
void | push_back (const Tp &x) |
Query< Tp > | query () const |
QueryableVector () | |
QueryableVector (size_t n, const Tp &value=Tp()) | |
QueryableVector (const QueryableVector< Tp > &rhs) | |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
const_reverse_iterator | rend () const |
reverse_iterator | rend () |
void | reserve (size_t n) |
void | reset () |
void | resize (size_t n, const Tp &value=Tp()) |
Range< Tp > | select (int startIndex, int endIndex=Selection::endOfRange) const |
Range< Tp > | select (const Selection &sel) const |
size_t | size () const |
const void * | storageAddress () const |
virtual | ~QueryableVector () |
Private Member Functions | |
void | initialize () const |
Private Attributes | |
boost::shared_ptr < store_base_type > | m_data |
bool | m_isLoaded |
bool | m_isLocked |
boost::shared_ptr< IVectorLoader > | m_loader |
Definition at line 164 of file QueryableVector.h.
typedef PVector<Tp>::const_iterator ora::QueryableVector< Tp >::const_iterator |
Definition at line 172 of file QueryableVector.h.
typedef PVector<Tp>::const_reference ora::QueryableVector< Tp >::const_reference |
Definition at line 170 of file QueryableVector.h.
typedef PVector<Tp>::const_reverse_iterator ora::QueryableVector< Tp >::const_reverse_iterator |
Definition at line 174 of file QueryableVector.h.
typedef PVector<Tp>::iterator ora::QueryableVector< Tp >::iterator |
Definition at line 173 of file QueryableVector.h.
typedef std::vector<std::pair<size_t,Tp> > ora::QueryableVector< Tp >::range_store_base_type |
Definition at line 181 of file QueryableVector.h.
typedef PVector<Tp>::reference ora::QueryableVector< Tp >::reference |
Definition at line 171 of file QueryableVector.h.
typedef PVector<Tp>::reverse_iterator ora::QueryableVector< Tp >::reverse_iterator |
Definition at line 175 of file QueryableVector.h.
typedef PVector<Tp>::size_type ora::QueryableVector< Tp >::size_type |
Definition at line 169 of file QueryableVector.h.
typedef PVector<Tp> ora::QueryableVector< Tp >::store_base_type |
Definition at line 179 of file QueryableVector.h.
typedef PVector<Tp>::value_type ora::QueryableVector< Tp >::value_type |
Definition at line 176 of file QueryableVector.h.
ora::QueryableVector< Tp >::QueryableVector | ( | ) |
Definition at line 191 of file QueryableVectorImpl.h.
: m_data(new PVector<Tp>), m_isLocked(false), m_isLoaded(false), m_loader(){ }
ora::QueryableVector< Tp >::QueryableVector | ( | size_t | n, |
const Tp & | value = Tp() |
||
) | [explicit] |
Definition at line 198 of file QueryableVectorImpl.h.
: m_data(new PVector<Tp>(n,value)), m_isLocked(false), m_isLoaded(false), m_loader(){ }
ora::QueryableVector< Tp >::QueryableVector | ( | const QueryableVector< Tp > & | rhs | ) |
Definition at line 205 of file QueryableVectorImpl.h.
: m_data(rhs.m_data), m_isLocked(rhs.m_isLocked), m_isLoaded(rhs.m_isLoaded), m_loader( rhs.m_loader ){ }
ora::QueryableVector< Tp >::~QueryableVector | ( | ) | [virtual] |
Definition at line 212 of file QueryableVectorImpl.h.
{ }
void ora::QueryableVector< Tp >::assign | ( | size_t | n, |
const Tp & | u | ||
) |
Definition at line 373 of file QueryableVectorImpl.h.
{ initialize(); m_data->assign(n,u); }
ora::QueryableVector< Tp >::reference ora::QueryableVector< Tp >::at | ( | size_t | n | ) |
Definition at line 349 of file QueryableVectorImpl.h.
References n.
{ initialize(); return m_data->operator[](n); }
ora::QueryableVector< Tp >::const_reference ora::QueryableVector< Tp >::at | ( | size_t | n | ) | const |
Definition at line 344 of file QueryableVectorImpl.h.
References n.
{ initialize(); return m_data->operator[](n); }
ora::QueryableVector< Tp >::reference ora::QueryableVector< Tp >::back | ( | ) |
Definition at line 364 of file QueryableVectorImpl.h.
{ return m_data->back(); }
ora::QueryableVector< Tp >::const_reference ora::QueryableVector< Tp >::back | ( | ) | const |
Definition at line 368 of file QueryableVectorImpl.h.
{ initialize(); return m_data->back(); }
ora::QueryableVector< Tp >::iterator ora::QueryableVector< Tp >::begin | ( | void | ) |
Definition at line 264 of file QueryableVectorImpl.h.
Referenced by cond::IOVSequence::sortMe(), cond::IOVSequence::swapOIds(), and cond::IOVSequence::swapTokens().
{ initialize(); return m_data->begin(); }
ora::QueryableVector< Tp >::const_iterator ora::QueryableVector< Tp >::begin | ( | void | ) | const |
Definition at line 274 of file QueryableVectorImpl.h.
{ initialize(); return m_data->begin(); }
size_t ora::QueryableVector< Tp >::capacity | ( | ) | const |
Definition at line 319 of file QueryableVectorImpl.h.
{ initialize(); return m_data->capacity(); }
void ora::QueryableVector< Tp >::clear | ( | void | ) |
Definition at line 390 of file QueryableVectorImpl.h.
{ initialize(); m_data->clear(); m_isLoaded = false; }
bool ora::QueryableVector< Tp >::empty | ( | ) | const |
Definition at line 324 of file QueryableVectorImpl.h.
{ initialize(); return m_data->empty(); }
ora::QueryableVector< Tp >::iterator ora::QueryableVector< Tp >::end | ( | void | ) |
Definition at line 269 of file QueryableVectorImpl.h.
Referenced by cond::IOVSequence::exist(), cond::IOVSequence::find(), cond::IOVSequence::findSince(), cond::IOVSequence::sortMe(), cond::IOVSequence::swapOIds(), and cond::IOVSequence::swapTokens().
{ initialize(); return m_data->end(); }
ora::QueryableVector< Tp >::const_iterator ora::QueryableVector< Tp >::end | ( | void | ) | const |
Definition at line 279 of file QueryableVectorImpl.h.
{ initialize(); return m_data->end(); }
ora::QueryableVector< Tp >::reference ora::QueryableVector< Tp >::front | ( | ) |
Definition at line 354 of file QueryableVectorImpl.h.
Referenced by cond::IOVSequence::firstSince().
{ initialize(); return m_data->front(); }
ora::QueryableVector< Tp >::const_reference ora::QueryableVector< Tp >::front | ( | ) | const |
Definition at line 359 of file QueryableVectorImpl.h.
{ initialize(); return m_data->front(); }
void ora::QueryableVector< Tp >::initialize | ( | ) | const [private] |
Definition at line 429 of file QueryableVectorImpl.h.
References ora::QueryableVector< Tp >::load().
Referenced by ora::QueryableVector< Tp >::operator!=(), and ora::QueryableVector< Tp >::operator==().
{ if(m_loader.get() && !m_isLocked && !m_isLoaded){ m_loader->load(m_data.get()); m_isLoaded = true; } }
bool ora::QueryableVector< Tp >::isLocked | ( | ) | const |
Definition at line 260 of file QueryableVectorImpl.h.
{ return m_isLocked; }
void ora::QueryableVector< Tp >::load | ( | ) | const |
Definition at line 425 of file QueryableVectorImpl.h.
Referenced by ora::QueryableVector< Tp >::initialize(), cond::IOVSequence::loadAll(), cond::IOVSequence::piovs(), and cond::IOVSequence::sortMe().
{ initialize(); }
bool ora::QueryableVector< Tp >::lock | ( | ) |
Definition at line 254 of file QueryableVectorImpl.h.
{ bool wasLocked = m_isLocked; m_isLocked = true; return wasLocked; }
size_t ora::QueryableVector< Tp >::max_size | ( | ) | const |
Definition at line 309 of file QueryableVectorImpl.h.
{ initialize(); return m_data->max_size(); }
bool ora::QueryableVector< Tp >::operator!= | ( | const QueryableVector< Tp > & | vec | ) | const |
Definition at line 409 of file QueryableVectorImpl.h.
References ora::QueryableVector< Tp >::initialize(), and ora::QueryableVector< Tp >::m_data.
{ initialize(); vec.initialize(); return m_data->operator!=(*vec.m_data); }
ora::QueryableVector< Tp > & ora::QueryableVector< Tp >::operator= | ( | const QueryableVector< Tp > & | rhs | ) |
Definition at line 215 of file QueryableVectorImpl.h.
References ora::QueryableVector< Tp >::m_data, ora::QueryableVector< Tp >::m_isLoaded, ora::QueryableVector< Tp >::m_isLocked, and ora::QueryableVector< Tp >::m_loader.
{ if(&rhs != this){ m_data = rhs.m_data; m_isLocked = rhs.m_isLocked; m_isLoaded = rhs.m_isLoaded; m_loader = rhs.m_loader; } return *this; }
bool ora::QueryableVector< Tp >::operator== | ( | const QueryableVector< Tp > & | vec | ) | const |
Definition at line 403 of file QueryableVectorImpl.h.
References ora::QueryableVector< Tp >::initialize(), and ora::QueryableVector< Tp >::m_data.
{ initialize(); vec.initialize(); return m_data->operator==(*vec.m_data); }
ora::QueryableVector< Tp >::reference ora::QueryableVector< Tp >::operator[] | ( | size_t | n | ) |
Definition at line 334 of file QueryableVectorImpl.h.
References n.
{ initialize(); return m_data->operator[](n); }
ora::QueryableVector< Tp >::const_reference ora::QueryableVector< Tp >::operator[] | ( | size_t | n | ) | const |
Definition at line 339 of file QueryableVectorImpl.h.
References n.
{ initialize(); return m_data->operator[](n); }
size_t ora::QueryableVector< Tp >::persistentSize | ( | ) | const |
Definition at line 415 of file QueryableVectorImpl.h.
References ora::QueryableVector< Tp >::persistentSize().
Referenced by ora::QueryableVector< Tp >::persistentSize().
{ // not sure needs init... //initialize(); return m_data->persistentSize(); }
void ora::QueryableVector< Tp >::pop_back | ( | ) |
Definition at line 384 of file QueryableVectorImpl.h.
Referenced by cond::IOVSequence::truncate().
{ initialize(); m_isLocked = true; m_data->pop_back(); }
void ora::QueryableVector< Tp >::push_back | ( | const Tp & | x | ) |
Definition at line 378 of file QueryableVectorImpl.h.
Referenced by cond::IOVSequence::add().
{ initialize(); m_isLocked = true; m_data->push_back(x); }
ora::Query< Tp > ora::QueryableVector< Tp >::query | ( | ) | const |
Definition at line 244 of file QueryableVectorImpl.h.
References ora::throwException().
{ if(m_isLocked ){ throwException("The Vector is locked in writing mode, cannot make queries.","ora::QueryableVector<Tp>::query"); } if(!m_loader.get()){ throwException("The Loader is not installed.","ora::QueryableVector<Tp>::query"); } return Query<Tp>(m_loader); }
ora::QueryableVector< Tp >::reverse_iterator ora::QueryableVector< Tp >::rbegin | ( | ) |
Definition at line 284 of file QueryableVectorImpl.h.
{ initialize(); return m_data->rbegin(); }
ora::QueryableVector< Tp >::const_reverse_iterator ora::QueryableVector< Tp >::rbegin | ( | ) | const |
Definition at line 294 of file QueryableVectorImpl.h.
{ initialize(); return m_data->rbegin(); }
ora::QueryableVector< Tp >::reverse_iterator ora::QueryableVector< Tp >::rend | ( | ) |
Definition at line 289 of file QueryableVectorImpl.h.
{ initialize(); return m_data->rend(); }
ora::QueryableVector< Tp >::const_reverse_iterator ora::QueryableVector< Tp >::rend | ( | ) | const |
Definition at line 299 of file QueryableVectorImpl.h.
{ initialize(); return m_data->rend(); }
void ora::QueryableVector< Tp >::reserve | ( | size_t | n | ) |
Definition at line 329 of file QueryableVectorImpl.h.
{ initialize(); m_data->reserve(n); }
void ora::QueryableVector< Tp >::reset | ( | void | ) |
Definition at line 396 of file QueryableVectorImpl.h.
{ initialize(); m_data->clear(); m_isLoaded = false; m_isLocked = false; }
void ora::QueryableVector< Tp >::resize | ( | size_t | n, |
const Tp & | value = Tp() |
||
) |
Definition at line 314 of file QueryableVectorImpl.h.
{ initialize(); m_data->resize(n,value); }
ora::Range< Tp > ora::QueryableVector< Tp >::select | ( | int | startIndex, |
int | endIndex = Selection::endOfRange |
||
) | const |
Definition at line 225 of file QueryableVectorImpl.h.
References ora::Selection::addIndexItem(), EgammaValidation_Wenu_cff::sel, and benchmark_cfg::select.
ora::Range< Tp > ora::QueryableVector< Tp >::select | ( | const Selection & | sel | ) | const |
Definition at line 231 of file QueryableVectorImpl.h.
References ora::throwException().
{ if(m_isLocked ){ throwException("The Vector is locked in writing mode, cannot make queries.","ora::QueryableVector<Tp>::select"); } if(!m_loader.get()){ throwException("The Loader is not installed.","ora::QueryableVector<Tp>::select"); } typedef typename Range<Tp>::store_base_type range_store_base_type; boost::shared_ptr<range_store_base_type> newData ( new range_store_base_type ); m_loader->loadSelection( sel, newData.get()); return Range<Tp>(newData); }
size_t ora::QueryableVector< Tp >::size | ( | void | ) | const |
Definition at line 304 of file QueryableVectorImpl.h.
Referenced by cond::IOVSequence::add(), and cond::IOVSequence::truncate().
{ initialize(); return m_data->size(); }
const void * ora::QueryableVector< Tp >::storageAddress | ( | ) | const |
Definition at line 421 of file QueryableVectorImpl.h.
{ return m_data.get(); }
boost::shared_ptr<store_base_type> ora::QueryableVector< Tp >::m_data [private] |
Definition at line 284 of file QueryableVector.h.
Referenced by ora::QueryableVector< Tp >::operator!=(), ora::QueryableVector< Tp >::operator=(), and ora::QueryableVector< Tp >::operator==().
bool ora::QueryableVector< Tp >::m_isLoaded [mutable, private] |
Definition at line 286 of file QueryableVector.h.
Referenced by ora::QueryableVector< Tp >::operator=().
bool ora::QueryableVector< Tp >::m_isLocked [private] |
Definition at line 285 of file QueryableVector.h.
Referenced by ora::QueryableVector< Tp >::operator=().
boost::shared_ptr<IVectorLoader> ora::QueryableVector< Tp >::m_loader [mutable, private] |
Definition at line 287 of file QueryableVector.h.
Referenced by ora::QueryableVector< Tp >::operator=().