#include <DataFormats/Common/interface/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. | |
self_type | end () const |
const value_type * | get () const |
const ProductID & | id () const |
const key_type & | key () const |
self_type & | nextProductID () |
const value_type & | operator * () const |
operator bool () const | |
bool | operator!= (const self_type &other) const |
self_type & | operator++ () |
self_type & | operator-- () |
const value_type * | operator-> () const |
bool | operator< (const self_type &other) const |
bool | operator== (const self_type &other) const |
const val_type & | val () 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_ |
Definition at line 116 of file AssociativeIterator.h.
typedef id_offset_vector::const_iterator edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::id_offset_iterator [private] |
Definition at line 150 of file AssociativeIterator.h.
typedef AssociativeCollection::id_offset_vector edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::id_offset_vector [private] |
Definition at line 149 of file AssociativeIterator.h.
typedef KeyRefType edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::key_type |
Definition at line 118 of file AssociativeIterator.h.
typedef KeyRefType::value_type edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::key_val_type |
Definition at line 119 of file AssociativeIterator.h.
typedef AssociativeIterator<KeyRefType,AssociativeCollection,ItemGetter> edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::self_type |
Definition at line 123 of file AssociativeIterator.h.
typedef helper::AssociativeCollectionValueType<AssociativeCollection>::type edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::val_type |
Definition at line 120 of file AssociativeIterator.h.
typedef std::pair<key_type, val_type> edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::value_type |
Definition at line 121 of file AssociativeIterator.h.
AssociativeIterator::AssociativeIterator | ( | const AC & | map, | |
const IG & | getter | |||
) | [inline] |
void AssociativeIterator::chkPair | ( | ) | const [inline, private] |
Definition at line 224 of file AssociativeIterator.h.
References edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::getter_, edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::idx_, edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::ioi_, edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::map_, edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::pair_, and edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::pairOk_.
Referenced by edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::get(), and edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::key().
00224 { 00225 if (pairOk_) return; 00226 pair_.first = getter_.get(id(), idx_ - ioi_->second); 00227 pair_.second = map_.get(idx_); 00228 pairOk_ = true; 00229 }
AssociativeIterator< KeyRefType, AC, IG > AssociativeIterator::end | ( | ) | const [inline] |
Definition at line 215 of file AssociativeIterator.h.
References edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::getter_, edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::idx_, edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::ioi2_, edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::ioi_, and edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::map_.
Referenced by pat::PATTriggerEventProducer::produce().
00215 { 00216 self_type ret(map_, getter_); 00217 ret.ioi_ = map_.ids().end(); 00218 ret.ioi2_ = ret.ioi_ + 1; 00219 ret.idx_ = map_.size(); 00220 return ret; 00221 }
const value_type* edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::get | ( | void | ) | const [inline] |
Definition at line 135 of file AssociativeIterator.h.
References edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::chkPair(), and edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::pair_.
const ProductID& edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::id | ( | void | ) | const [inline] |
Definition at line 139 of file AssociativeIterator.h.
References edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::ioi_.
00139 { return ioi_->first; }
const key_type& edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::key | ( | ) | const [inline] |
Definition at line 137 of file AssociativeIterator.h.
References edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::chkPair(), and edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::pair_.
AssociativeIterator< KeyRefType, AC, IG > & AssociativeIterator::nextProductID | ( | ) | [inline] |
Definition at line 196 of file AssociativeIterator.h.
References edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::idx_, edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::ioi2_, edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::ioi_, edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::map_, and edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::pairOk_.
00196 { 00197 pairOk_ = false; 00198 ioi_++; ioi2_++; 00199 if (ioi_ == map_.ids().end()) { 00200 idx_ = map_.size(); 00201 } else { 00202 idx_ = ioi_->second; 00203 } 00204 }
const value_type& edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator * | ( | ) | const [inline] |
edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator bool | ( | ) | const [inline] |
Definition at line 141 of file AssociativeIterator.h.
References edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::idx_, and edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::map_.
bool edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator!= | ( | const self_type & | other | ) | const [inline] |
Definition at line 145 of file AssociativeIterator.h.
References edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::idx_.
00145 { return other.idx_ != idx_; }
AssociativeIterator< KeyRefType, AC, IG > & AssociativeIterator::operator++ | ( | ) | [inline] |
Definition at line 173 of file AssociativeIterator.h.
References edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::idx_, edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::ioi2_, edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::ioi_, edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::map_, and edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::pairOk_.
00173 { 00174 pairOk_ = false; 00175 idx_++; 00176 if (ioi2_ < map_.ids().end()) { 00177 if (ioi2_->second == idx_) { 00178 ++ioi_; ++ioi2_; 00179 } 00180 } 00181 return *this; 00182 }
AssociativeIterator< KeyRefType, AC, IG > & AssociativeIterator::operator-- | ( | ) | [inline] |
Definition at line 185 of file AssociativeIterator.h.
References edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::idx_, edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::ioi2_, edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::ioi_, and edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::pairOk_.
00185 { 00186 pairOk_ = false; 00187 idx_--; 00188 if (ioi_->second < idx_) { 00189 --ioi_; --ioi2_; 00190 } 00191 return *this; 00192 00193 }
const value_type* edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator-> | ( | ) | const [inline] |
bool edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator< | ( | const self_type & | other | ) | const [inline] |
Definition at line 146 of file AssociativeIterator.h.
References edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::idx_.
00146 { return other.idx_ < idx_; }
bool edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator== | ( | const self_type & | other | ) | const [inline] |
Definition at line 144 of file AssociativeIterator.h.
References edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::idx_.
00144 { return other.idx_ == idx_; }
const val_type& edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::val | ( | ) | const [inline] |
Definition at line 138 of file AssociativeIterator.h.
References edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::idx_, and edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::map_.
ItemGetter edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::getter_ [private] |
Definition at line 155 of file AssociativeIterator.h.
Referenced by edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::chkPair(), and edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::end().
size_t edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::idx_ [private] |
Definition at line 153 of file AssociativeIterator.h.
Referenced by edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::chkPair(), edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::end(), edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::nextProductID(), edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator bool(), edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator!=(), edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator++(), edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator--(), edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator<(), edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator==(), and edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::val().
id_offset_iterator edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::ioi2_ [private] |
Definition at line 152 of file AssociativeIterator.h.
Referenced by edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::end(), edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::nextProductID(), edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator++(), and edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator--().
id_offset_iterator edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::ioi_ [private] |
Definition at line 152 of file AssociativeIterator.h.
Referenced by edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::chkPair(), edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::end(), edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::id(), edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::nextProductID(), edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator++(), and edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator--().
const AssociativeCollection& edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::map_ [private] |
Definition at line 151 of file AssociativeIterator.h.
Referenced by edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::chkPair(), edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::end(), edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::nextProductID(), edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator bool(), edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator++(), and edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::val().
value_type edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::pair_ [mutable, private] |
Definition at line 158 of file AssociativeIterator.h.
Referenced by edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::chkPair(), edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::get(), and edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::key().
bool edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::pairOk_ [mutable, private] |
Definition at line 157 of file AssociativeIterator.h.
Referenced by edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::chkPair(), edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::nextProductID(), edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator++(), and edm::AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter >::operator--().