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 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_type
value_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 = EdmEventItemGetter<KeyRefType>>
class edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >

Definition at line 115 of file AssociativeIterator.h.

Member Typedef Documentation

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

Definition at line 149 of file AssociativeIterator.h.

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

Definition at line 148 of file AssociativeIterator.h.

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

Definition at line 117 of file AssociativeIterator.h.

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

Definition at line 118 of file AssociativeIterator.h.

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

Definition at line 122 of file AssociativeIterator.h.

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

Definition at line 119 of file AssociativeIterator.h.

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

Definition at line 120 of file AssociativeIterator.h.

Constructor & Destructor Documentation

template<typename KeyRefType, typename AssociativeCollection, typename ItemGetter = EdmEventItemGetter<KeyRefType>>
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 164 of file AssociativeIterator.h.

164  :
165  map_(map), ioi_(map_.ids().begin()), ioi2_(ioi_+1), idx_(0),
166  getter_(getter),
167  pairOk_(false)
168  {
169  }
const AssociativeCollection & map_

Member Function Documentation

template<typename KeyRefType , typename AC , typename IG >
void edm::AssociativeIterator< KeyRefType, AC, IG >::chkPair ( ) const
private
template<typename KeyRefType , typename AC , typename IG >
AssociativeIterator< KeyRefType, AC, IG > edm::AssociativeIterator< KeyRefType, AC, IG >::end ( void  ) const
template<typename KeyRefType, typename AssociativeCollection, typename ItemGetter = EdmEventItemGetter<KeyRefType>>
const value_type* edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::get ( ) const
inline
template<typename KeyRefType, typename AssociativeCollection, typename ItemGetter = EdmEventItemGetter<KeyRefType>>
const ProductID& edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::id ( ) const
inline
template<typename KeyRefType, typename AssociativeCollection, typename ItemGetter = EdmEventItemGetter<KeyRefType>>
const key_type& edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::key ( ) const
inline
template<typename KeyRefType , typename AC , typename IG >
AssociativeIterator< KeyRefType, AC, IG > & edm::AssociativeIterator< KeyRefType, AC, IG >::nextProductID ( )

Definition at line 195 of file AssociativeIterator.h.

References map_.

195  {
196  pairOk_ = false;
197  ioi_++; ioi2_++;
198  if (ioi_ == map_.ids().end()) {
199  idx_ = map_.size();
200  } else {
201  idx_ = ioi_->second;
202  }
203  }
const AssociativeCollection & map_
template<typename KeyRefType, typename AssociativeCollection, typename ItemGetter = EdmEventItemGetter<KeyRefType>>
edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator bool ( ) const
inline
template<typename KeyRefType, typename AssociativeCollection, typename ItemGetter = EdmEventItemGetter<KeyRefType>>
bool edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator!= ( const self_type other) const
inline
template<typename KeyRefType, typename AssociativeCollection, typename ItemGetter = EdmEventItemGetter<KeyRefType>>
const value_type& edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator* ( ) const
inline

Definition at line 132 of file AssociativeIterator.h.

132 { return *(this->get()); }
template<typename KeyRefType , typename AC , typename IG >
AssociativeIterator< KeyRefType, AC, IG > & edm::AssociativeIterator< KeyRefType, AC, IG >::operator++ ( )

Definition at line 172 of file AssociativeIterator.h.

References map_.

172  {
173  pairOk_ = false;
174  idx_++;
175  if (ioi2_ < map_.ids().end()) {
176  if (ioi2_->second == idx_) {
177  ++ioi_; ++ioi2_;
178  }
179  }
180  return *this;
181  }
const AssociativeCollection & map_
template<typename KeyRefType , typename AC , typename IG >
AssociativeIterator< KeyRefType, AC, IG > & edm::AssociativeIterator< KeyRefType, AC, IG >::operator-- ( )

Definition at line 184 of file AssociativeIterator.h.

184  {
185  pairOk_ = false;
186  idx_--;
187  if (ioi_->second < idx_) {
188  --ioi_; --ioi2_;
189  }
190  return *this;
191 
192  }
template<typename KeyRefType, typename AssociativeCollection, typename ItemGetter = EdmEventItemGetter<KeyRefType>>
const value_type* edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator-> ( ) const
inline

Definition at line 133 of file AssociativeIterator.h.

133 { return (this->get()); }
template<typename KeyRefType, typename AssociativeCollection, typename ItemGetter = EdmEventItemGetter<KeyRefType>>
bool edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator< ( const self_type other) const
inline
template<typename KeyRefType, typename AssociativeCollection, typename ItemGetter = EdmEventItemGetter<KeyRefType>>
bool edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator== ( const self_type other) const
inline
template<typename KeyRefType, typename AssociativeCollection, typename ItemGetter = EdmEventItemGetter<KeyRefType>>
const val_type& edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::val ( ) const
inline

Member Data Documentation

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

Definition at line 154 of file AssociativeIterator.h.

template<typename KeyRefType, typename AssociativeCollection, typename ItemGetter = EdmEventItemGetter<KeyRefType>>
size_t edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::idx_
private
template<typename KeyRefType, typename AssociativeCollection, typename ItemGetter = EdmEventItemGetter<KeyRefType>>
id_offset_iterator edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::ioi2_
private
template<typename KeyRefType, typename AssociativeCollection, typename ItemGetter = EdmEventItemGetter<KeyRefType>>
id_offset_iterator edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::ioi_
private
template<typename KeyRefType, typename AssociativeCollection, typename ItemGetter = EdmEventItemGetter<KeyRefType>>
const AssociativeCollection& edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::map_
private
template<typename KeyRefType, typename AssociativeCollection, typename ItemGetter = EdmEventItemGetter<KeyRefType>>
value_type edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::pair_
mutableprivate
template<typename KeyRefType, typename AssociativeCollection, typename ItemGetter = EdmEventItemGetter<KeyRefType>>
bool edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::pairOk_
mutableprivate

Definition at line 156 of file AssociativeIterator.h.