CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

ora::QueryableVector< Tp > Class Template Reference

#include <QueryableVector.h>

List of all members.

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< IVectorLoaderm_loader

Detailed Description

template<typename Tp>
class ora::QueryableVector< Tp >

Definition at line 164 of file QueryableVector.h.


Member Typedef Documentation

template<typename Tp>
typedef PVector<Tp>::const_iterator ora::QueryableVector< Tp >::const_iterator

Definition at line 172 of file QueryableVector.h.

template<typename Tp>
typedef PVector<Tp>::const_reference ora::QueryableVector< Tp >::const_reference

Definition at line 170 of file QueryableVector.h.

Definition at line 174 of file QueryableVector.h.

template<typename Tp>
typedef PVector<Tp>::iterator ora::QueryableVector< Tp >::iterator

Definition at line 173 of file QueryableVector.h.

template<typename Tp>
typedef std::vector<std::pair<size_t,Tp> > ora::QueryableVector< Tp >::range_store_base_type

Definition at line 181 of file QueryableVector.h.

template<typename Tp>
typedef PVector<Tp>::reference ora::QueryableVector< Tp >::reference

Definition at line 171 of file QueryableVector.h.

template<typename Tp>
typedef PVector<Tp>::reverse_iterator ora::QueryableVector< Tp >::reverse_iterator

Definition at line 175 of file QueryableVector.h.

template<typename Tp>
typedef PVector<Tp>::size_type ora::QueryableVector< Tp >::size_type

Definition at line 169 of file QueryableVector.h.

template<typename Tp>
typedef PVector<Tp> ora::QueryableVector< Tp >::store_base_type

Definition at line 179 of file QueryableVector.h.

template<typename Tp>
typedef PVector<Tp>::value_type ora::QueryableVector< Tp >::value_type

Definition at line 176 of file QueryableVector.h.


Constructor & Destructor Documentation

template<class Tp >
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(){
}
template<class Tp>
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(){
}
template<class Tp>
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 ){
}
template<class Tp >
ora::QueryableVector< Tp >::~QueryableVector ( ) [virtual]

Definition at line 212 of file QueryableVectorImpl.h.

                                                            {
}

Member Function Documentation

template<class Tp>
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);
}
template<class Tp >
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);
}
template<class Tp >
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);
}
template<class Tp >
ora::QueryableVector< Tp >::reference ora::QueryableVector< Tp >::back ( )

Definition at line 364 of file QueryableVectorImpl.h.

                                                                                            {
  return m_data->back();
}
template<class Tp >
ora::QueryableVector< Tp >::const_reference ora::QueryableVector< Tp >::back ( ) const

Definition at line 368 of file QueryableVectorImpl.h.

                                                                                                        {
  initialize();
  return m_data->back();
}
template<class Tp >
ora::QueryableVector< Tp >::iterator ora::QueryableVector< Tp >::begin ( void  )
template<class Tp >
ora::QueryableVector< Tp >::const_iterator ora::QueryableVector< Tp >::begin ( void  ) const

Definition at line 274 of file QueryableVectorImpl.h.

                                                                                                      {
  initialize();
  return m_data->begin();
}
template<class Tp >
size_t ora::QueryableVector< Tp >::capacity ( ) const

Definition at line 319 of file QueryableVectorImpl.h.

                                                                  {
  initialize();
  return m_data->capacity();
}
template<class Tp >
void ora::QueryableVector< Tp >::clear ( void  )

Definition at line 390 of file QueryableVectorImpl.h.

                                                        {
  initialize();
  m_data->clear();
  m_isLoaded = false;
}
template<class Tp >
bool ora::QueryableVector< Tp >::empty ( ) const

Definition at line 324 of file QueryableVectorImpl.h.

                                                             {
  initialize();
  return m_data->empty();
}
template<class Tp >
ora::QueryableVector< Tp >::iterator ora::QueryableVector< Tp >::end ( void  )
template<class Tp >
ora::QueryableVector< Tp >::const_iterator ora::QueryableVector< Tp >::end ( void  ) const

Definition at line 279 of file QueryableVectorImpl.h.

                                                                                                    {
  initialize();
  return m_data->end();
}
template<class Tp >
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();
}
template<class Tp >
ora::QueryableVector< Tp >::const_reference ora::QueryableVector< Tp >::front ( ) const

Definition at line 359 of file QueryableVectorImpl.h.

                                                                                                         {
  initialize();
  return m_data->front();
}
template<class Tp >
void ora::QueryableVector< Tp >::initialize ( ) const [private]
template<class Tp >
bool ora::QueryableVector< Tp >::isLocked ( ) const

Definition at line 260 of file QueryableVectorImpl.h.

                                                                {
  return m_isLocked;
}
template<class Tp >
void ora::QueryableVector< Tp >::load ( ) const
template<class Tp >
bool ora::QueryableVector< Tp >::lock ( )

Definition at line 254 of file QueryableVectorImpl.h.

                                                      {
  bool wasLocked = m_isLocked;
  m_isLocked = true;
  return wasLocked;
}
template<class Tp >
size_t ora::QueryableVector< Tp >::max_size ( ) const

Definition at line 309 of file QueryableVectorImpl.h.

                                                                  {
  initialize();
  return m_data->max_size();
}
template<class Tp >
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);
}
template<class Tp>
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;
}
template<class Tp >
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);
}
template<class Tp >
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);
}
template<class Tp >
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);
}
template<class Tp >
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();
}
template<class Tp >
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();
}
template<class Tp>
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);
}
template<class Tp >
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);
}
template<class Tp >
ora::QueryableVector< Tp >::reverse_iterator ora::QueryableVector< Tp >::rbegin ( )

Definition at line 284 of file QueryableVectorImpl.h.

                                                                                                  {
  initialize();
  return m_data->rbegin();
}
template<class Tp >
ora::QueryableVector< Tp >::const_reverse_iterator ora::QueryableVector< Tp >::rbegin ( ) const

Definition at line 294 of file QueryableVectorImpl.h.

                                                                                                               {
  initialize();
  return m_data->rbegin();
}
template<class Tp >
ora::QueryableVector< Tp >::reverse_iterator ora::QueryableVector< Tp >::rend ( )

Definition at line 289 of file QueryableVectorImpl.h.

                                                                                                {
  initialize();
  return m_data->rend();
}
template<class Tp >
ora::QueryableVector< Tp >::const_reverse_iterator ora::QueryableVector< Tp >::rend ( ) const

Definition at line 299 of file QueryableVectorImpl.h.

                                                                                                             {
  initialize();
  return m_data->rend();
}
template<class Tp >
void ora::QueryableVector< Tp >::reserve ( size_t  n)

Definition at line 329 of file QueryableVectorImpl.h.

                                                                 {
  initialize();
  m_data->reserve(n);
}
template<class Tp >
void ora::QueryableVector< Tp >::reset ( void  )

Definition at line 396 of file QueryableVectorImpl.h.

                                                        {
  initialize();
  m_data->clear();
  m_isLoaded = false;
  m_isLocked = false;
}
template<class Tp>
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);
}
template<class Tp >
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.

                                                                                                  {
  Selection sel;
  sel.addIndexItem( startIndex, endIndex );
  return select( sel );
}
template<class Tp >
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);
}
template<class Tp >
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();
}
template<class Tp >
const void * ora::QueryableVector< Tp >::storageAddress ( ) const

Definition at line 421 of file QueryableVectorImpl.h.

                                                                             {
  return m_data.get();
}

Member Data Documentation

template<typename Tp>
boost::shared_ptr<store_base_type> ora::QueryableVector< Tp >::m_data [private]
template<typename Tp>
bool ora::QueryableVector< Tp >::m_isLoaded [mutable, private]

Definition at line 286 of file QueryableVector.h.

Referenced by ora::QueryableVector< Tp >::operator=().

template<typename Tp>
bool ora::QueryableVector< Tp >::m_isLocked [private]

Definition at line 285 of file QueryableVector.h.

Referenced by ora::QueryableVector< Tp >::operator=().

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