CMS 3D CMS Logo

iterator.h
Go to the documentation of this file.
1 #ifndef Candidate_iterator_h
2 #define Candidate_iterator_h
3 
4 /* \class reco::candidate::iterator
5  *
6  * \author Luca Lista, INFN
7  *
8  */
10 
11 namespace reco {
12  namespace candidate {
13  struct const_iterator;
14  struct iterator {
16  typedef Candidate* pointer;
17  typedef Candidate& reference;
18  typedef ptrdiff_t difference_type;
19  typedef std::vector<int>::iterator::iterator_category iterator_category;
20  iterator() : me(nullptr), i(0) {}
21  iterator(pointer ime, difference_type ii) : me(ime), i(ii) {}
23  ++i;
24  return *this;
25  }
27  iterator ci = *this;
28  ++i;
29  return ci;
30  }
32  --i;
33  return *this;
34  }
36  iterator ci = *this;
37  --i;
38  return ci;
39  }
40  difference_type operator-(const iterator& o) const { return i - o.i; }
42  iterator ci = *this;
43  ci.i += n;
44  return ci;
45  }
47  iterator ci = *this;
48  ci.i -= n;
49  return ci;
50  }
51  bool operator<(const iterator& o) { return i < o.i; }
52  bool operator==(const iterator& ci) const { return i == ci.i; }
53  bool operator!=(const iterator& ci) const { return i != ci.i; }
54 
55  inline reference operator*() const;
56  pointer operator->() const { return &(operator*()); }
58  i += d;
59  return *this;
60  }
62  i -= d;
63  return *this;
64  }
65 
66  private:
69  friend struct const_iterator;
70  };
71 
72  } // namespace candidate
73 } // namespace reco
74 
75 #endif
reco::candidate::iterator::iterator_category
std::vector< int >::iterator::iterator_category iterator_category
Definition: iterator.h:19
reco::candidate::iterator::me
pointer me
Definition: iterator.h:67
reco::candidate::iterator::operator--
iterator operator--(int)
Definition: iterator.h:35
reco::candidate::iterator::operator-=
iterator & operator-=(difference_type d)
Definition: iterator.h:61
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
reco::candidate::iterator::pointer
Candidate * pointer
Definition: iterator.h:16
reco::candidate::iterator::operator!=
bool operator!=(const iterator &ci) const
Definition: iterator.h:53
reco::candidate::const_iterator
Definition: const_iterator.h:14
reco::candidate::iterator::operator--
iterator & operator--()
Definition: iterator.h:31
reco::candidate::iterator::operator+=
iterator & operator+=(difference_type d)
Definition: iterator.h:57
reco::candidate::iterator::i
difference_type i
Definition: iterator.h:68
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
reco::candidate::iterator::iterator
iterator(pointer ime, difference_type ii)
Definition: iterator.h:21
reco::candidate::iterator::iterator
iterator()
Definition: iterator.h:20
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
CandidateFwd.h
reco::candidate::iterator::operator*
reference operator*() const
Definition: Candidate.h:302
reco::candidate::iterator::operator++
iterator & operator++()
Definition: iterator.h:22
reco::candidate::iterator::difference_type
ptrdiff_t difference_type
Definition: iterator.h:18
reco::candidate::iterator::operator==
bool operator==(const iterator &ci) const
Definition: iterator.h:52
reco::candidate::iterator::operator+
iterator operator+(difference_type n) const
Definition: iterator.h:41
reco::candidate::iterator::operator<
bool operator<(const iterator &o)
Definition: iterator.h:51
reco::candidate::iterator::operator-
difference_type operator-(const iterator &o) const
Definition: iterator.h:40
reco::candidate::iterator
Definition: iterator.h:14
reco::Candidate
Definition: Candidate.h:27
reco::candidate::iterator::operator++
iterator operator++(int)
Definition: iterator.h:26
reco::candidate::iterator::operator-
iterator operator-(difference_type n) const
Definition: iterator.h:46
reco::candidate::iterator::value_type
Candidate value_type
Definition: iterator.h:15
reco::candidate::iterator::reference
Candidate & reference
Definition: iterator.h:17
ztail.d
d
Definition: ztail.py:151
cuy.ii
ii
Definition: cuy.py:589
reco::candidate::iterator::operator->
pointer operator->() const
Definition: iterator.h:56