1 #ifndef DataFormats_Common_AssociativeIterator_h 2 #define DataFormats_Common_AssociativeIterator_h 46 template <
class T>
class View;
50 template <
class T>
class Ptr;
51 template <
class C,
class T,
class F>
class Ref;
60 template<
typename RefFrom,
typename RefTo>
62 static RefTo
convert(
const RefFrom &ref) {
return RefTo(ref); }
68 template<
typename T,
typename C,
typename V,
typename F>
76 template<
typename RefType,
typename EventType>
87 iEvent_.get(id_, view_);
89 BaseRefType ref = view_->refAt(
idx);
102 template<
typename AC>
113 template<
typename KeyRefType,
typename AssociativeCollection,
typename ItemGetter >
126 self_type & operator++() ;
127 self_type & operator--() ;
128 self_type & nextProductID() ;
131 const value_type &
operator*()
const {
return *(this->
get()); }
132 const value_type *
operator->()
const {
return (this->
get()); }
133 const value_type *
get()
const { chkPair();
return & pair_; }
135 const key_type &
key()
const { chkPair();
return pair_.first; }
136 const val_type &
val()
const {
return map_.get(idx_); }
139 operator bool()
const {
return idx_ < map_.size(); }
140 self_type
end()
const ;
149 const AssociativeCollection &
map_;
150 id_offset_iterator
ioi_, ioi2_;
158 void chkPair()
const ;
162 template<
typename KeyRefType,
typename AC,
typename IG>
164 map_(map), ioi_(map_.ids().
begin()), ioi2_(ioi_+1), idx_(0),
170 template<
typename KeyRefType,
typename AC,
typename IG>
182 template<
typename KeyRefType,
typename AC,
typename IG>
193 template<
typename KeyRefType,
typename AC,
typename IG>
212 template<
typename KeyRefType,
typename AC,
typename IG>
221 template<
typename KeyRefType,
typename AC,
typename IG>
229 template<
typename KeyRefType,
typename AC,
typename EventType>
value_type const * get() const
AssociativeIterator(const AssociativeCollection &map, const ItemGetter &getter)
Create the associative iterator, pointing at the beginning of the collection.
KeyRefType::value_type key_val_type
Helper class that fetches some type of Ref given ProductID and index, using the edm::Event.
Association< C >::reference_type type
AssociativeCollection::id_offset_vector id_offset_vector
static HepMC::IO_HEPEVT conv
const val_type & val() const
AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter > self_type
reco::GenParticleCollection::const_iterator IG
self_type & nextProductID()
static RefTo convert(const RefFrom &ref)
RefType::value_type element_type
Container::value_type value_type
const EventType & iEvent_
const value_type & operator*() const
def convert(infile, ofile)
bool operator<(const self_type &other) const
const value_type * operator->() const
id_offset_vector::const_iterator id_offset_iterator
std::pair< key_type, val_type > value_type
static Ptr< T > convert(const RefToBase< T > &ref)
const AssociativeCollection & map_
helper::AssociativeCollectionValueType< AssociativeCollection >::type val_type
bool operator!=(const self_type &other) const
AssociativeIterator< KeyRefType, AC, edm::EventItemGetter< KeyRefType, EventType > > makeAssociativeIterator(const AC &map, const EventType &event)
Handle< View< element_type > > view_
bool operator==(const self_type &other) const
static Ref< C, V, F > convert(const RefToBase< T > &ref)
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
EventItemGetter(const EventType &iEvent)
const ProductID & id() const
const key_type & key() const