CMS 3D CMS Logo

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

edm::RefGetter< T > Class Template Reference

#include <RefGetter.h>

List of all members.

Public Types

typedef std::vector< region_refcollection_type
typedef
boost::indirect_iterator
< typename
collection_type::const_iterator > 
const_iterator
typedef std::pair< typename
record_type::const_iterator,
typename
record_type::const_iterator > 
record_pair
typedef std::vector< Trecord_type
typedef Ref< LazyGetter< T >
, RegionIndex< T >, FindRegion
< T > > 
region_ref

Public Member Functions

const RegionIndex< T > & back () const
const_iterator begin () const
 Return an iterator to the first RegionIndex<T>.
bool empty () const
 Return true if we contain no 'region_ref's (one per Region).
const_iterator end () const
 Return the off-the-end iterator.
bool find (uint32_t) const
 Returns true if region already defined.
const RegionIndex< T > & operator[] (uint32_t) const
 Return a reference to the RegionIndex<T> for a given region.
void push_back (const edm::Handle< LazyGetter< T > > &, const uint32_t &)
 Add a new region to the end of the collection.
 RefGetter (uint32_t=50000)
 Default constructor. Default maximum region number 50,000.
 RefGetter (const edm::Handle< LazyGetter< T > > &, const std::vector< uint32_t > &)
 Constructor with regions and Handle.
void reserve (uint32_t)
 Reserve memory for sets_ collection.
uint32_t size () const
 Return the number of contained 'region_ref's (one per Region).
void swap (RefGetter &other)
 Swap contents of class.

Private Member Functions

 BOOST_CLASS_REQUIRE (T, boost, LessThanComparableConcept)

Private Attributes

std::vector< uint32_t > regions_
collection_type sets_

Detailed Description

template<class T>
class edm::RefGetter< T >

Definition at line 18 of file RefGetter.h.


Member Typedef Documentation

template<class T>
typedef std::vector<region_ref> edm::RefGetter< T >::collection_type

Definition at line 24 of file RefGetter.h.

template<class T>
typedef boost::indirect_iterator<typename collection_type::const_iterator> edm::RefGetter< T >::const_iterator

Definition at line 25 of file RefGetter.h.

template<class T>
typedef std::pair<typename record_type::const_iterator, typename record_type::const_iterator> edm::RefGetter< T >::record_pair

Definition at line 27 of file RefGetter.h.

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

Definition at line 26 of file RefGetter.h.

template<class T>
typedef Ref< LazyGetter<T>, RegionIndex<T>, FindRegion<T> > edm::RefGetter< T >::region_ref

Definition at line 23 of file RefGetter.h.


Constructor & Destructor Documentation

template<class T >
edm::RefGetter< T >::RefGetter ( uint32_t  maxindex = 50000) [inline]

Default constructor. Default maximum region number 50,000.

Definition at line 77 of file RefGetter.h.

                                             : sets_(), regions_(maxindex/32+1,0)
    {}
template<class T >
edm::RefGetter< T >::RefGetter ( const edm::Handle< LazyGetter< T > > &  getter,
const std::vector< uint32_t > &  interest 
) [inline]

Constructor with regions and Handle.

Definition at line 82 of file RefGetter.h.

References getHLTprescales::index, and edm::RefGetter< T >::sets_.

                                                                                                        : sets_(), regions_(getter->regions()/32+1,0) 
    {
      sets_.reserve(interest.size());
      for (uint32_t index=0;index<interest.size();index++) {
        sets_.push_back(region_ref(getter,interest[index],false));
      }
    }

Member Function Documentation

template<class T >
const RegionIndex< T > & edm::RefGetter< T >::back ( ) const [inline]

Returns a reference to the last RegionIndex<T> added to the collection, or throws an exception if empty.

Definition at line 145 of file RefGetter.h.

References edm::dslvdetail::_throw_range(), relativeConstraints::empty, and findQualityFiles::size.

    {
      if (empty()) edm::lazydetail::_throw_range(0);
      return (*this)[size()-1];
    } 
template<class T >
RefGetter< T >::const_iterator edm::RefGetter< T >::begin ( void  ) const [inline]

Return an iterator to the first RegionIndex<T>.

Definition at line 154 of file RefGetter.h.

Referenced by HLTTrackerHaloFilter::hltFilter().

    {
      return sets_.begin();
    }
template<class T>
edm::RefGetter< T >::BOOST_CLASS_REQUIRE ( T  ,
boost  ,
LessThanComparableConcept   
) [private]
template<class T >
bool edm::RefGetter< T >::empty ( ) const [inline]

Return true if we contain no 'region_ref's (one per Region).

Definition at line 119 of file RefGetter.h.

    {
      return sets_.empty();
    }
template<class T >
RefGetter< T >::const_iterator edm::RefGetter< T >::end ( void  ) const [inline]

Return the off-the-end iterator.

Definition at line 162 of file RefGetter.h.

Referenced by HLTTrackerHaloFilter::hltFilter(), and SiStripRecHitConverterAlgorithm::run().

    {
      return sets_.end();
    }
template<class T >
bool edm::RefGetter< T >::find ( uint32_t  index) const [inline]

Returns true if region already defined.

Definition at line 170 of file RefGetter.h.

Referenced by SiStripRegionCabling::updateSiStripRefGetter().

    {
      return (regions_[index/32]>>(index%32))&1;
    }
template<class T >
const RegionIndex< T > & edm::RefGetter< T >::operator[] ( uint32_t  index) const [inline]

Return a reference to the RegionIndex<T> for a given region.

Definition at line 135 of file RefGetter.h.

References edm::dslvdetail::_throw_range(), getHLTprescales::index, and findQualityFiles::size.

    {
      if (size() < index+1) edm::lazydetail::_throw_range(index);
      const_iterator it = sets_.begin()+index;
      return *it;
    }
template<class T >
void edm::RefGetter< T >::push_back ( const edm::Handle< LazyGetter< T > > &  getter,
const uint32_t &  index 
) [inline]

Add a new region to the end of the collection.

Definition at line 110 of file RefGetter.h.

Referenced by EcalRegionCabling::updateEcalRefGetterWithElementIndex(), and SiStripRegionCabling::updateSiStripRefGetter().

     {
       sets_.push_back(region_ref(getter, index, false));
       regions_[index/32] = regions_[index/32]|(1<<index%32);
     }
template<class T >
void edm::RefGetter< T >::reserve ( uint32_t  size) [inline]

Reserve memory for sets_ collection.

Definition at line 93 of file RefGetter.h.

    {
      sets_.reserve(size);
    }
template<class T >
uint32_t edm::RefGetter< T >::size ( void  ) const [inline]

Return the number of contained 'region_ref's (one per Region).

Definition at line 127 of file RefGetter.h.

    {
      return sets_.size();
    }
template<class T >
void edm::RefGetter< T >::swap ( RefGetter< T > &  other) [inline]

Swap contents of class.

Definition at line 101 of file RefGetter.h.

References edm::RefGetter< T >::regions_, and edm::RefGetter< T >::sets_.

Referenced by edm::swap().

    {
      sets_.swap(other.sets_);
      regions_.swap(other.regions_);
    }

Member Data Documentation

template<class T>
std::vector<uint32_t> edm::RefGetter< T >::regions_ [private]

Definition at line 72 of file RefGetter.h.

Referenced by edm::RefGetter< T >::swap().

template<class T>
collection_type edm::RefGetter< T >::sets_ [private]

Definition at line 71 of file RefGetter.h.

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