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 Member Functions | Private Attributes
edm::LazyGetter< T > Class Template Reference

#include <LazyGetter.h>

Public Types

typedef
boost::transform_iterator
< LazyAdapter< T >, typename
register_type::const_iterator > 
const_iterator
 
typedef record_type::const_iterator record_iterator
 
typedef std::vector< Trecord_type
 
typedef
boost::transform_iterator
< UpdateGetterAdapter< T >
, typename
register_type::const_iterator > 
register_iterator
 
typedef std::vector
< RegionIndex< T > > 
register_type
 
typedef Ref< LazyGetter< T >
, T, FindValue< T > > 
value_ref
 

Public Member Functions

const_iterator begin () const
 Returns an iterator to the first register_. More...
 
register_iterator begin_nounpack () const
 Returns an iterator to the start of the register_ without unpacking. More...
 
record_iterator begin_record () const
 Returns an iterator to the start of record_. More...
 
bool empty () const
 Returns true if record_ is empty. More...
 
const_iterator end () const
 Returns the off-the-end iterator. More...
 
register_iterator end_nounpack () const
 Returns the off-the-end iter. More...
 
record_iterator end_record () const
 Returns an off-the-end iterator. More...
 
const_iterator find (uint32_t index) const
 Returns an iterator to the register_ for a given index. More...
 
 LazyGetter ()
 Default constructor. More...
 
 LazyGetter (uint32_t, const boost::shared_ptr< LazyUnpacker< T > > &)
 Constructor with unpacker. More...
 
const RegionIndex< T > & operator[] (uint32_t index) const
 Returns a reference to the register_ for a given index. More...
 
uint32_t regions () const
 Returns the size of LazyUnpacker::register_. More...
 
void setEvent (Event const &e) const
 
uint32_t size () const
 Returns the size of the record_. More...
 
void swap (LazyGetter &other)
 Swap contents of class. More...
 
bool unpacked (uint32_t) const
 

Private Member Functions

 BOOST_CLASS_REQUIRE (T, boost, LessThanComparableConcept)
 

Private Attributes

std::vector< Trecord_
 
std::vector< RegionIndex< T > > register_
 
boost::shared_ptr
< LazyUnpacker< T > > 
unpacker_
 

Detailed Description

template<class T>
class edm::LazyGetter< T >

Definition at line 23 of file LazyGetter.h.

Member Typedef Documentation

template<class T>
typedef boost::transform_iterator< LazyAdapter<T>, typename register_type::const_iterator > edm::LazyGetter< T >::const_iterator

Definition at line 318 of file LazyGetter.h.

template<class T>
typedef record_type::const_iterator edm::LazyGetter< T >::record_iterator

Definition at line 317 of file LazyGetter.h.

template<class T>
typedef std::vector<T> edm::LazyGetter< T >::record_type

Definition at line 315 of file LazyGetter.h.

template<class T>
typedef boost::transform_iterator< UpdateGetterAdapter<T>, typename register_type::const_iterator > edm::LazyGetter< T >::register_iterator

Definition at line 316 of file LazyGetter.h.

template<class T>
typedef std::vector< RegionIndex<T> > edm::LazyGetter< T >::register_type

Definition at line 314 of file LazyGetter.h.

template<class T>
typedef Ref< LazyGetter<T>, T, FindValue<T> > edm::LazyGetter< T >::value_ref

Definition at line 319 of file LazyGetter.h.

Constructor & Destructor Documentation

template<class T >
edm::LazyGetter< T >::LazyGetter ( )
inline

Default constructor.

Definition at line 385 of file LazyGetter.h.

385  : unpacker_(), record_(), register_()
386  {}
boost::shared_ptr< LazyUnpacker< T > > unpacker_
Definition: LazyGetter.h:378
std::vector< RegionIndex< T > > register_
Definition: LazyGetter.h:380
std::vector< T > record_
Definition: LazyGetter.h:379
template<class T >
edm::LazyGetter< T >::LazyGetter ( uint32_t  nregions,
const boost::shared_ptr< LazyUnpacker< T > > &  unpacker 
)
inline

Constructor with unpacker.

Definition at line 390 of file LazyGetter.h.

References edm::LazyGetter< T >::record_, and edm::LazyGetter< T >::register_.

390  : unpacker_(unpacker), record_(), register_()
391  {
392  //Reserve 100,000 to absorb event-by-event fluctuations.
393  record_.reserve(100000);
394  register_.reserve(nregions);
395  for (uint32_t iregion=0;iregion<nregions;iregion++) {
396  register_.push_back(RegionIndex<T>(iregion,0,0,this));
397  }
398  }
boost::shared_ptr< LazyUnpacker< T > > unpacker_
Definition: LazyGetter.h:378
std::vector< RegionIndex< T > > register_
Definition: LazyGetter.h:380
std::vector< T > record_
Definition: LazyGetter.h:379

Member Function Documentation

template<class T >
LazyGetter< T >::const_iterator edm::LazyGetter< T >::begin ( void  ) const
inline

Returns an iterator to the first register_.

Definition at line 443 of file LazyGetter.h.

444  {
445  const LazyAdapter<T> adapter(unpacker_.get(),&record_,this);
446  return boost::make_transform_iterator(register_.begin(),adapter);
447  }
boost::shared_ptr< LazyUnpacker< T > > unpacker_
Definition: LazyGetter.h:378
std::vector< RegionIndex< T > > register_
Definition: LazyGetter.h:380
std::vector< T > record_
Definition: LazyGetter.h:379
template<class T >
LazyGetter< T >::register_iterator edm::LazyGetter< T >::begin_nounpack ( ) const
inline

Returns an iterator to the start of the register_ without unpacking.

Definition at line 461 of file LazyGetter.h.

462  {
463  const UpdateGetterAdapter<T> adapter(this);
464  return boost::make_transform_iterator(register_.begin(),adapter);
465  }
std::vector< RegionIndex< T > > register_
Definition: LazyGetter.h:380
template<class T >
LazyGetter< T >::record_iterator edm::LazyGetter< T >::begin_record ( ) const
inline

Returns an iterator to the start of record_.

Definition at line 487 of file LazyGetter.h.

Referenced by edm::ContainerMaskTraits< edm::LazyGetter< T > >::indexFor().

488  {
489  return record_.begin();
490  }
std::vector< T > record_
Definition: LazyGetter.h:379
template<class T>
edm::LazyGetter< T >::BOOST_CLASS_REQUIRE ( T  ,
boost  ,
LessThanComparableConcept   
)
private
template<class T >
bool edm::LazyGetter< T >::empty ( ) const
inline

Returns true if record_ is empty.

Definition at line 511 of file LazyGetter.h.

Referenced by Vispa.Gui.VispaWidget.TextField::setAutosizeFont(), and Vispa.Gui.VispaWidget.TextField::setAutotruncate().

512  {
513  return record_.empty();
514  }
std::vector< T > record_
Definition: LazyGetter.h:379
template<class T >
LazyGetter< T >::const_iterator edm::LazyGetter< T >::end ( void  ) const
inline

Returns the off-the-end iterator.

Definition at line 452 of file LazyGetter.h.

Referenced by Types.LuminosityBlockRange::cppID(), and Types.EventRange::cppID().

453  {
454  const LazyAdapter<T> adapter(unpacker_.get(),&record_,this);
455  return boost::make_transform_iterator(register_.end(),adapter);
456  }
boost::shared_ptr< LazyUnpacker< T > > unpacker_
Definition: LazyGetter.h:378
std::vector< RegionIndex< T > > register_
Definition: LazyGetter.h:380
std::vector< T > record_
Definition: LazyGetter.h:379
template<class T >
LazyGetter< T >::register_iterator edm::LazyGetter< T >::end_nounpack ( ) const
inline

Returns the off-the-end iter.

Definition at line 470 of file LazyGetter.h.

471  {
472  const UpdateGetterAdapter<T> adapter(this);
473  return boost::make_transform_iterator(register_.end(),adapter);
474  }
std::vector< RegionIndex< T > > register_
Definition: LazyGetter.h:380
template<class T >
LazyGetter< T >::record_iterator edm::LazyGetter< T >::end_record ( ) const
inline

Returns an off-the-end iterator.

Definition at line 495 of file LazyGetter.h.

496  {
497  return record_.end();
498  }
std::vector< T > record_
Definition: LazyGetter.h:379
template<class T >
LazyGetter< T >::const_iterator edm::LazyGetter< T >::find ( uint32_t  index) const
inline

Returns an iterator to the register_ for a given index.

Definition at line 421 of file LazyGetter.h.

References end, and cmsHarvester::index.

Referenced by BeautifulSoup.Tag::__getattr__(), and BeautifulSoup.Tag::firstText().

422  {
423  if (index>=regions()) return end();
424  typename register_type::const_iterator it = register_.begin()+index;
425  const LazyAdapter<T> adapter(unpacker_.get(),&record_,this);
426  return boost::make_transform_iterator(it,adapter);
427  }
uint32_t regions() const
Returns the size of LazyUnpacker::register_.
Definition: LazyGetter.h:413
boost::shared_ptr< LazyUnpacker< T > > unpacker_
Definition: LazyGetter.h:378
const_iterator end() const
Returns the off-the-end iterator.
Definition: LazyGetter.h:452
std::vector< RegionIndex< T > > register_
Definition: LazyGetter.h:380
std::vector< T > record_
Definition: LazyGetter.h:379
template<class T >
const RegionIndex< T > & edm::LazyGetter< T >::operator[] ( uint32_t  index) const
inline

Returns a reference to the register_ for a given index.

Definition at line 432 of file LazyGetter.h.

References edm::lazydetail::_throw_range(), and cmsHarvester::index.

433  {
435  typename register_type::const_iterator it = register_.begin()+index;
436  const LazyAdapter<T> adapter(unpacker_.get(),&record_,this);
437  return *(boost::make_transform_iterator(it,adapter));
438  }
uint32_t regions() const
Returns the size of LazyUnpacker::register_.
Definition: LazyGetter.h:413
boost::shared_ptr< LazyUnpacker< T > > unpacker_
Definition: LazyGetter.h:378
std::vector< RegionIndex< T > > register_
Definition: LazyGetter.h:380
void _throw_range(uint32_t region)
Definition: LazyGetter.h:30
std::vector< T > record_
Definition: LazyGetter.h:379
template<class T >
uint32_t edm::LazyGetter< T >::regions ( ) const
inline

Returns the size of LazyUnpacker::register_.

Definition at line 413 of file LazyGetter.h.

414  {
415  return register_.size();
416  }
std::vector< RegionIndex< T > > register_
Definition: LazyGetter.h:380
template<class T>
void edm::LazyGetter< T >::setEvent ( Event const &  e) const
inline

Definition at line 371 of file LazyGetter.h.

References edm::LazyGetter< T >::unpacker_.

371 { unpacker_->setEvent(e); }
boost::shared_ptr< LazyUnpacker< T > > unpacker_
Definition: LazyGetter.h:378
template<class T >
uint32_t edm::LazyGetter< T >::size ( void  ) const
inline

Returns the size of the record_.

Definition at line 503 of file LazyGetter.h.

Referenced by edm::ContainerMaskTraits< edm::LazyGetter< T > >::size().

504  {
505  return record_.size();
506  }
std::vector< T > record_
Definition: LazyGetter.h:379
template<class T>
void edm::LazyGetter< T >::swap ( LazyGetter< T > &  other)
inline

Swap contents of class.

Definition at line 403 of file LazyGetter.h.

References edm::LazyGetter< T >::record_, edm::LazyGetter< T >::register_, std::swap(), and edm::LazyGetter< T >::unpacker_.

Referenced by edm::swap().

404  {
405  std::swap(unpacker_,other.unpacker_);
406  std::swap(record_,other.record_);
407  std::swap(register_,other.register_);
408  }
boost::shared_ptr< LazyUnpacker< T > > unpacker_
Definition: LazyGetter.h:378
std::vector< RegionIndex< T > > register_
Definition: LazyGetter.h:380
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::vector< T > record_
Definition: LazyGetter.h:379
template<class T >
bool edm::LazyGetter< T >::unpacked ( uint32_t  index) const
inline

Returns boolean describing unpacking status of a given region without unpacking

Definition at line 479 of file LazyGetter.h.

References cmsHarvester::index.

480  {
481  return (index<regions()) ? register_[index].unpacked() : false;
482  }
uint32_t regions() const
Returns the size of LazyUnpacker::register_.
Definition: LazyGetter.h:413
std::vector< RegionIndex< T > > register_
Definition: LazyGetter.h:380

Member Data Documentation

template<class T>
std::vector<T> edm::LazyGetter< T >::record_
private

Definition at line 379 of file LazyGetter.h.

Referenced by edm::LazyGetter< T >::LazyGetter(), and edm::LazyGetter< T >::swap().

template<class T>
std::vector< RegionIndex<T> > edm::LazyGetter< T >::register_
private

Definition at line 380 of file LazyGetter.h.

Referenced by edm::LazyGetter< T >::LazyGetter(), and edm::LazyGetter< T >::swap().

template<class T>
boost::shared_ptr< LazyUnpacker<T> > edm::LazyGetter< T >::unpacker_
private

Definition at line 378 of file LazyGetter.h.

Referenced by edm::LazyGetter< T >::setEvent(), and edm::LazyGetter< T >::swap().