CMS 3D CMS Logo

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