1 #ifndef DataFormats_Common_AssociativeIterator_h
2 #define DataFormats_Common_AssociativeIterator_h
57 template <
class C,
class T,
class F>
67 template <
typename RefFrom,
typename RefTo>
69 static RefTo
convert(
const RefFrom &ref) {
return RefTo(ref); }
77 template <
typename T,
typename C,
typename V,
typename F>
85 template <
typename RefType,
typename EventType>
99 BaseRefType ref =
view_->refAt(idx);
114 template <
typename AC>
119 template <
typename C>
125 template <
typename KeyRefType,
typename AssociativeCollection,
typename ItemGetter>
157 operator bool()
const {
return idx_ <
map_.size(); }
167 const AssociativeCollection &
map_;
180 template <
typename KeyRefType,
typename AC,
typename IG>
182 : map_(map), ioi_(map_.ids().
begin()), ioi2_(ioi_ + 1), idx_(0), getter_(getter), pairOk_(
false) {}
184 template <
typename KeyRefType,
typename AC,
typename IG>
188 if (ioi2_ < map_.ids().end()) {
189 if (ioi2_->second == idx_) {
197 template <
typename KeyRefType,
typename AC,
typename IG>
201 if (ioi_->second < idx_) {
208 template <
typename KeyRefType,
typename AC,
typename IG>
213 if (ioi_ == map_.ids().end()) {
228 template <
typename KeyRefType,
typename AC,
typename IG>
231 ret.
ioi_ = map_.ids().end();
233 ret.
idx_ = map_.size();
237 template <
typename KeyRefType,
typename AC,
typename IG>
241 pair_.first = getter_.get(
id(), idx_ - ioi_->second);
242 pair_.second = map_.get(idx_);
246 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
tuple ret
prodAgent to be discontinued
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
uint16_t *__restrict__ id
AssociativeCollection::id_offset_vector id_offset_vector
AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter > self_type
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
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t V
const EventType & iEvent_
const value_type & operator*() const
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