CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter > Class Template Reference

#include <AssociativeIterator.h>

Public Types

typedef KeyRefType key_type
 
typedef KeyRefType::value_type key_val_type
 
typedef AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter > self_type
 
typedef helper::AssociativeCollectionValueType< AssociativeCollection >::type val_type
 
typedef std::pair< key_type, val_typevalue_type
 

Public Member Functions

 AssociativeIterator (const AssociativeCollection &map, const ItemGetter &getter)
 Create the associative iterator, pointing at the beginning of the collection. More...
 
self_type end () const
 
const value_typeget () const
 
const ProductIDid () const
 
const key_typekey () const
 
self_typenextProductID ()
 
 operator bool () const
 
bool operator!= (const self_type &other) const
 
const value_typeoperator* () const
 
self_typeoperator++ ()
 
self_typeoperator-- ()
 
const value_typeoperator-> () const
 
bool operator< (const self_type &other) const
 
bool operator== (const self_type &other) const
 
const val_typeval () const
 

Private Types

typedef id_offset_vector::const_iterator id_offset_iterator
 
typedef AssociativeCollection::id_offset_vector id_offset_vector
 

Private Member Functions

void chkPair () const
 

Private Attributes

ItemGetter getter_
 
size_t idx_
 
id_offset_iterator ioi2_
 
id_offset_iterator ioi_
 
const AssociativeCollection & map_
 
value_type pair_
 
bool pairOk_
 

Detailed Description

template<typename KeyRefType, typename AssociativeCollection, typename ItemGetter>
class edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >

Definition at line 126 of file AssociativeIterator.h.

Member Typedef Documentation

◆ id_offset_iterator

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
typedef id_offset_vector::const_iterator edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::id_offset_iterator
private

Definition at line 166 of file AssociativeIterator.h.

◆ id_offset_vector

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
typedef AssociativeCollection::id_offset_vector edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::id_offset_vector
private

Definition at line 165 of file AssociativeIterator.h.

◆ key_type

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
typedef KeyRefType edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::key_type

Definition at line 128 of file AssociativeIterator.h.

◆ key_val_type

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
typedef KeyRefType::value_type edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::key_val_type

Definition at line 129 of file AssociativeIterator.h.

◆ self_type

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
typedef AssociativeIterator<KeyRefType, AssociativeCollection, ItemGetter> edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::self_type

Definition at line 133 of file AssociativeIterator.h.

◆ val_type

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
typedef helper::AssociativeCollectionValueType<AssociativeCollection>::type edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::val_type

Definition at line 130 of file AssociativeIterator.h.

◆ value_type

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
typedef std::pair<key_type, val_type> edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::value_type

Definition at line 131 of file AssociativeIterator.h.

Constructor & Destructor Documentation

◆ AssociativeIterator()

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
edm::AssociativeIterator< KeyRefType, AC, IG >::AssociativeIterator ( const AssociativeCollection &  map,
const ItemGetter &  getter 
)

Create the associative iterator, pointing at the beginning of the collection.

Definition at line 181 of file AssociativeIterator.h.

182  : map_(map), ioi_(map_.ids().begin()), ioi2_(ioi_ + 1), idx_(0), getter_(getter), pairOk_(false) {}

Member Function Documentation

◆ chkPair()

template<typename KeyRefType , typename AC , typename IG >
void edm::AssociativeIterator< KeyRefType, AC, IG >::chkPair ( ) const
private

Definition at line 238 of file AssociativeIterator.h.

238  {
239  if (pairOk_)
240  return;
241  pair_.first = getter_.get(id(), idx_ - ioi_->second);
242  pair_.second = map_.get(idx_);
243  pairOk_ = true;
244  }

Referenced by edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::get(), and edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::key().

◆ end()

template<typename KeyRefType , typename AC , typename IG >
AssociativeIterator< KeyRefType, AC, IG > edm::AssociativeIterator< KeyRefType, AC, IG >::end ( void  ) const

Definition at line 229 of file AssociativeIterator.h.

229  {
231  ret.ioi_ = map_.ids().end();
232  ret.ioi2_ = ret.ioi_ + 1;
233  ret.idx_ = map_.size();
234  return ret;
235  }

References runTheMatrix::ret.

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

◆ get()

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
const value_type* edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::get ( ) const
inline

◆ id()

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
const ProductID& edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::id ( ) const
inline

◆ key()

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
const key_type& edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::key ( ) const
inline

◆ nextProductID()

template<typename KeyRefType , typename AC , typename IG >
AssociativeIterator< KeyRefType, AC, IG > & edm::AssociativeIterator< KeyRefType, AC, IG >::nextProductID ( )

Definition at line 209 of file AssociativeIterator.h.

209  {
210  pairOk_ = false;
211  ioi_++;
212  ioi2_++;
213  if (ioi_ == map_.ids().end()) {
214  idx_ = map_.size();
215  } else {
216  idx_ = ioi_->second;
217  }
218  }

◆ operator bool()

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator bool ( ) const
inline

◆ operator!=()

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
bool edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator!= ( const self_type other) const
inline

◆ operator*()

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
const value_type& edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator* ( ) const
inline

Definition at line 143 of file AssociativeIterator.h.

143 { return *(this->get()); }

References edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::get().

◆ operator++()

template<typename KeyRefType , typename AC , typename IG >
AssociativeIterator< KeyRefType, AC, IG > & edm::AssociativeIterator< KeyRefType, AC, IG >::operator++ ( )

Definition at line 185 of file AssociativeIterator.h.

185  {
186  pairOk_ = false;
187  idx_++;
188  if (ioi2_ < map_.ids().end()) {
189  if (ioi2_->second == idx_) {
190  ++ioi_;
191  ++ioi2_;
192  }
193  }
194  return *this;
195  }

◆ operator--()

template<typename KeyRefType , typename AC , typename IG >
AssociativeIterator< KeyRefType, AC, IG > & edm::AssociativeIterator< KeyRefType, AC, IG >::operator-- ( )

Definition at line 198 of file AssociativeIterator.h.

198  {
199  pairOk_ = false;
200  idx_--;
201  if (ioi_->second < idx_) {
202  --ioi_;
203  --ioi2_;
204  }
205  return *this;
206  }

◆ operator->()

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
const value_type* edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator-> ( ) const
inline

Definition at line 144 of file AssociativeIterator.h.

144 { return (this->get()); }

References edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::get().

◆ operator<()

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
bool edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator< ( const self_type other) const
inline

◆ operator==()

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
bool edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator== ( const self_type other) const
inline

◆ val()

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
const val_type& edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::val ( ) const
inline

Member Data Documentation

◆ getter_

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
ItemGetter edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::getter_
private

Definition at line 171 of file AssociativeIterator.h.

◆ idx_

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
size_t edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::idx_
private

◆ ioi2_

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
id_offset_iterator edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::ioi2_
private

Definition at line 168 of file AssociativeIterator.h.

◆ ioi_

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
id_offset_iterator edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::ioi_
private

◆ map_

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
const AssociativeCollection& edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::map_
private

◆ pair_

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
value_type edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::pair_
mutableprivate

◆ pairOk_

template<typename KeyRefType , typename AssociativeCollection , typename ItemGetter >
bool edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::pairOk_
mutableprivate

Definition at line 174 of file AssociativeIterator.h.

runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:355
edm::AssociativeIterator::getter_
ItemGetter getter_
Definition: AssociativeIterator.h:171
edm::AssociativeIterator::pairOk_
bool pairOk_
Definition: AssociativeIterator.h:174
edm::AssociativeIterator::self_type
AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter > self_type
Definition: AssociativeIterator.h:133
edm::AssociativeIterator::get
const value_type * get() const
Definition: AssociativeIterator.h:145
edm::AssociativeIterator::ioi2_
id_offset_iterator ioi2_
Definition: AssociativeIterator.h:168
trackingPlots.other
other
Definition: trackingPlots.py:1465
edm::AssociativeIterator::map_
const AssociativeCollection & map_
Definition: AssociativeIterator.h:167
edm::AssociativeIterator::pair_
value_type pair_
Definition: AssociativeIterator.h:175
edm::AssociativeIterator::ioi_
id_offset_iterator ioi_
Definition: AssociativeIterator.h:168
genParticles_cff.map
map
Definition: genParticles_cff.py:11
edm::AssociativeIterator::chkPair
void chkPair() const
Definition: AssociativeIterator.h:238
edm::AssociativeIterator::idx_
size_t idx_
Definition: AssociativeIterator.h:169