1 #ifndef DataFormats_Common_AssociativeIterator_h 2 #define DataFormats_Common_AssociativeIterator_h 56 template <
class C,
class T,
class F>
66 template <
typename RefFrom,
typename RefTo>
68 static RefTo
convert(
const RefFrom &ref) {
return RefTo(ref); }
76 template <
typename T,
typename C,
typename V,
typename F>
84 template <
typename RefType,
typename EventType>
96 iEvent_.get(id_, view_);
98 BaseRefType ref = view_->refAt(
idx);
112 template <
typename AC>
117 template <
typename C>
123 template <
typename KeyRefType,
typename AssociativeCollection,
typename ItemGetter>
136 self_type &operator++();
137 self_type &operator--();
138 self_type &nextProductID();
141 const value_type &
operator*()
const {
return *(this->
get()); }
142 const value_type *
operator->()
const {
return (this->
get()); }
143 const value_type *
get()
const {
148 const key_type &
key()
const {
152 const val_type &
val()
const {
return map_.get(idx_); }
155 operator bool()
const {
return idx_ < map_.size(); }
156 self_type
end()
const;
165 const AssociativeCollection &
map_;
166 id_offset_iterator
ioi_, ioi2_;
174 void chkPair()
const;
177 template <
typename KeyRefType,
typename AC,
typename IG>
179 : map_(map), ioi_(map_.
ids().
begin()), ioi2_(ioi_ + 1), idx_(0), getter_(getter), pairOk_(
false) {}
181 template <
typename KeyRefType,
typename AC,
typename IG>
194 template <
typename KeyRefType,
typename AC,
typename IG>
205 template <
typename KeyRefType,
typename AC,
typename IG>
225 template <
typename KeyRefType,
typename AC,
typename IG>
234 template <
typename KeyRefType,
typename AC,
typename IG>
243 template <
typename KeyRefType,
typename AC,
typename EventType>
AssociativeIterator< KeyRefType, AC, edm::EventItemGetter< KeyRefType, EventType > > makeAssociativeIterator(const AC &map, const EventType &event)
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
AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter > self_type
static HepMC::IO_HEPEVT conv
ret
prodAgent to be discontinued
const val_type & val() const
reco::GenParticleCollection::const_iterator IG
self_type & nextProductID()
static RefTo convert(const RefFrom &ref)
static Ref< C, V, F > convert(const RefToBase< T > &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
Handle< View< element_type > > view_
bool operator==(const self_type &other) const
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
EventItemGetter(const EventType &iEvent)
const ProductID & id() const
const key_type & key() const