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>
114 template <
typename AC>
119 template <
typename C>
125 template <
typename KeyRefType,
typename AssociativeCollection,
typename ItemGetter>
144 const value_type *
operator->()
const {
return (this->
get()); }
145 const value_type *
get()
const {
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)
const key_type & key() 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
const val_type & val() const
ret
prodAgent to be discontinued
const ProductID & id() 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
const value_type & operator*() const
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_
def convert(infile, ofile)
bool operator==(const self_type &other) const
bool operator!=(const self_type &other) 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
Handle< View< element_type > > view_
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
EventItemGetter(const EventType &iEvent)
value_type const * get() const
const value_type * operator->() const
bool operator<(const self_type &other) const