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

#include <RefGetter.h>

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

Static Public Member Functions

static short Class_Version ()
 

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.

77  : sets_(), regions_(maxindex/32+1,0)
78  {}
std::vector< uint32_t > regions_
Definition: RefGetter.h:72
collection_type sets_
Definition: RefGetter.h:71
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_.

82  : sets_(), regions_(getter->regions()/32+1,0)
83  {
84  sets_.reserve(interest.size());
85  for (uint32_t index=0;index<interest.size();index++) {
86  sets_.push_back(region_ref(getter,interest[index],false));
87  }
88  }
std::vector< uint32_t > regions_
Definition: RefGetter.h:72
collection_type sets_
Definition: RefGetter.h:71
Ref< LazyGetter< T >, RegionIndex< T >, FindRegion< T > > region_ref
Definition: RefGetter.h:23

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::lazydetail::_throw_range(), relativeConstraints::empty, and findQualityFiles::size.

146  {
148  return (*this)[size()-1];
149  }
uint32_t size() const
Return the number of contained &#39;region_ref&#39;s (one per Region).
Definition: RefGetter.h:127
void _throw_range(uint32_t region)
Definition: LazyGetter.h:28
bool empty() const
Return true if we contain no &#39;region_ref&#39;s (one per Region).
Definition: RefGetter.h:119
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().

155  {
156  return sets_.begin();
157  }
collection_type sets_
Definition: RefGetter.h:71
template<class T>
edm::RefGetter< T >::BOOST_CLASS_REQUIRE ( T  ,
boost  ,
LessThanComparableConcept   
)
private
template<class T>
static short edm::RefGetter< T >::Class_Version ( )
inlinestatic

Definition at line 67 of file RefGetter.h.

69 :
70 
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.

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

120  {
121  return sets_.empty();
122  }
collection_type sets_
Definition: RefGetter.h:71
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 Types.LuminosityBlockRange::cppID(), Types.EventRange::cppID(), HLTTrackerHaloFilter::hltFilter(), and SiStripRecHitConverterAlgorithm::run().

163  {
164  return sets_.end();
165  }
collection_type sets_
Definition: RefGetter.h:71
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 BeautifulSoup.Tag::__getattr__(), BeautifulSoup.Tag::firstText(), and SiStripRegionCabling::updateSiStripRefGetter().

171  {
172  return (regions_[index/32]>>(index%32))&1;
173  }
std::vector< uint32_t > regions_
Definition: RefGetter.h:72
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::lazydetail::_throw_range(), getHLTprescales::index, and findQualityFiles::size.

136  {
138  const_iterator it = sets_.begin()+index;
139  return *it;
140  }
collection_type sets_
Definition: RefGetter.h:71
uint32_t size() const
Return the number of contained &#39;region_ref&#39;s (one per Region).
Definition: RefGetter.h:127
void _throw_range(uint32_t region)
Definition: LazyGetter.h:28
boost::indirect_iterator< typename collection_type::const_iterator > const_iterator
Definition: RefGetter.h:25
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().

111  {
112  sets_.push_back(region_ref(getter, index, false));
113  regions_[index/32] = regions_[index/32]|(1<<index%32);
114  }
std::vector< uint32_t > regions_
Definition: RefGetter.h:72
collection_type sets_
Definition: RefGetter.h:71
Ref< LazyGetter< T >, RegionIndex< T >, FindRegion< T > > region_ref
Definition: RefGetter.h:23
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.

94  {
95  sets_.reserve(size);
96  }
collection_type sets_
Definition: RefGetter.h:71
uint32_t size() const
Return the number of contained &#39;region_ref&#39;s (one per Region).
Definition: RefGetter.h:127
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.

128  {
129  return sets_.size();
130  }
collection_type sets_
Definition: RefGetter.h:71
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().

102  {
103  sets_.swap(other.sets_);
104  regions_.swap(other.regions_);
105  }
std::vector< uint32_t > regions_
Definition: RefGetter.h:72
collection_type sets_
Definition: RefGetter.h:71

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().