BOSS 6.6.4.p03
BESIII Offline Software System
Loading...
Searching...
No Matches
WholeCandidateItr.h
Go to the documentation of this file.
1#ifndef DCHAIN_WHOLECANDIDATEITR_H
2#define DCHAIN_WHOLECANDIDATEITR_H
3// -*- C++ -*-
4//
5// Package: DChain
6// Module: WholeCandidateItr
7//
8// Description: a const Iterator though whole of LabeledCandidateList
9//
10// Usage:
11// <usage>
12//
13// Author: Simon Patton
14// Created: Wed Sep 11 21:51:25 EDT 1996
15// $Id: WholeCandidateItr.h,v 1.1.1.1 2009/03/03 06:06:56 maqm Exp $
16//
17// Revision history
18//
19// $Log: WholeCandidateItr.h,v $
20// Revision 1.1.1.1 2009/03/03 06:06:56 maqm
21// first import of DecayChain
22//
23// Revision 1.1 2006/01/11 20:28:18 cdj
24// massive class renaming, addition of [] for selection and unit tests
25//
26//
27
28// system include files
29#include <iterator>
30
31// user include files
32#include "DecayChain/Iterator/candidateitr.h" // distance
35
36
37// forward declarations
38//template < class CandidateClass > class IndexedLabeledCandidates ;
39namespace dchain {
40
41//template < class CandidateClass > class LabeledCandidate ;
42template < class CandidateClass > class LabeledCandidateList ;
43
44template < class CandidateClass >
46{
47 // friend classses and functions
48 friend class LabeledCandidateList< CandidateClass > ;
49
50 public:
51 // constants, enums and typedefs
56 typedef std::random_access_iterator_tag iterator_category;
59
60
61 // Constructors and destructor
63 virtual ~WholeCandidateItr() {}
64
65 // assignment operator(s)
67
68 // member functions
77
78 // const member functions
82
83 bool operator==( const WholeCandidateItr< CandidateClass >& aOtherItr ) const ;
84 bool operator!=( const WholeCandidateItr< CandidateClass >& aOtherItr ) const ;
85 bool operator<( const WholeCandidateItr< CandidateClass >& aOtherItr ) const ;
86 bool operator>( const WholeCandidateItr< CandidateClass >& aOtherItr ) const ;
87 bool operator>=( const WholeCandidateItr< CandidateClass >& aOtherItr ) const ;
88 bool operator<=( const WholeCandidateItr< CandidateClass >& aOtherItr ) const ;
89
90 // static member functions
91
92 protected:
93 // Constructors and destructor
95 const size_type aIndex ) ;
96
97 // protected member functions
98
99 // protected const member functions
101 size_type index() const ;
102
103 private:
104 // Constructors and destructor
105 WholeCandidateItr() ; // stop default
106
107 // private member functions
108
109 // private const member functions
110
111 // data members
112 IndexedLabeledCandidates< CandidateClass >* m_indexedCandidates ;
113 size_type m_index ;
114
115 // static data members
116
117} ;
118
119// inline function definitions
120
121// user include files
122//
123// forward definitions of inline functions
124//
125
126template < class CandidateClass >
127inline
129{
130 return ( m_indexedCandidates ) ;
131}
132
133template < class CandidateClass >
134inline
136{
137 return ( m_index ) ;
138}
139
140//
141// constructors and destructor
142//
143
144template < class CandidateClass >
145inline
147 m_indexedCandidates( aOtherItr.indexedCandidates() ) ,
148 m_index( aOtherItr.index() )
149{
150}
151
152template < class CandidateClass >
153inline
155 const size_type aIndex ) :
156// cast away const as const_itr can be assocciated with a non-const list,
157// but only const lists use this constructor
158 m_indexedCandidates( (IndexedLabeledCandidates< CandidateClass >*)aList ) ,
159 m_index( aIndex )
160{
161}
162
163//
164// assignment operators
165//
166
167template < class CandidateClass >
168inline
170{
171 m_indexedCandidates = aOtherItr.indexedCandidates() ;
172 m_index = aOtherItr.index() ;
173 return ( *this ) ;
174}
175
176//
177// member functions
178//
179
180template < class CandidateClass >
181inline
183{
184 ++m_index ;
185 return ( *this ) ;
186}
187
188template < class CandidateClass >
189inline
191{
192 WholeCandidateItr tmp( *this ) ;
193 ++m_index ;
194 return ( tmp ) ;
195}
196
197template < class CandidateClass >
198inline
200{
201 --m_index ;
202 return ( *this ) ;
203}
204
205template < class CandidateClass >
206inline
208{
209 WholeCandidateItr tmp( *this ) ;
210 --m_index ;
211 return ( tmp ) ;
212}
213
214template < class CandidateClass >
215inline
217{
218 m_index += n ;
219 return( *this ) ;
220}
221
222template < class CandidateClass >
223inline
225{
226 WholeCandidateItr tmp( *this ) ;
227 return ( tmp += n ) ;
228}
229
230template < class CandidateClass >
231inline
233{
234 m_index -= n ;
235 return( *this ) ;
236}
237
238template < class CandidateClass >
239inline
241{
242 WholeCandidateItr tmp( *this ) ;
243 return ( tmp -= n ) ;
244}
245
246//
247// const member functions
248//
249
250template < class CandidateClass >
251inline
253{
254 return ( (*m_indexedCandidates).labeledCandidateClass( m_index ) ) ;
255}
256
257template < class CandidateClass >
258inline
260{
261 return ( (*m_indexedCandidates).labeledCandidateClass( m_index + n ) ) ;
262}
263
264template < class CandidateClass >
265inline
268{
269 return ( m_index - aOtherItr.index() ) ;
270}
271
272template < class CandidateClass >
273inline
275{
276 return ( ( m_index == aOtherItr.index() ) &&
277 ( m_indexedCandidates == aOtherItr.indexedCandidates() ) ) ;
278}
279
280template < class CandidateClass >
281inline
283{
284 return ( ( m_index != aOtherItr.index() ) ||
285 ( m_indexedCandidates != aOtherItr.indexedCandidates() ) ) ;
286}
287
288template < class CandidateClass >
289inline
291{
292 return ( ( m_index < aOtherItr.index() ) &&
293 ( m_indexedCandidates == aOtherItr.indexedCandidates() ) ) ;
294}
295
296template < class CandidateClass >
297inline
299{
300 return ( ( m_index > aOtherItr.index() ) &&
301 ( m_indexedCandidates == aOtherItr.indexedCandidates() ) ) ;
302}
303
304template < class CandidateClass >
305inline
307{
308 return ( ( m_index >= aOtherItr.index() ) &&
309 ( m_indexedCandidates == aOtherItr.indexedCandidates() ) ) ;
310}
311
312template < class CandidateClass >
313inline
315{
316 return ( ( m_index <= aOtherItr.index() ) &&
317 ( m_indexedCandidates == aOtherItr.indexedCandidates() ) ) ;
318}
319}
320
321#endif /* DCHAIN_WHOLECANDIDATEITR_H */
const Int_t n
dchain::candidateitr::size_type distance_type
const LabeledCandidate< CandidateClass > value_type
WholeCandidateItr< CandidateClass > operator--(int)
const LabeledCandidate< CandidateClass > & operator[](size_type n) const
WholeCandidateItr< CandidateClass > & operator+=(difference_type n)
const WholeCandidateItr & operator=(const WholeCandidateItr< CandidateClass > &aOtherItr)
WholeCandidateItr< CandidateClass > operator++(int)
WholeCandidateItr< CandidateClass > & operator--()
bool operator>(const WholeCandidateItr< CandidateClass > &aOtherItr) const
WholeCandidateItr< CandidateClass > & operator++()
bool operator<=(const WholeCandidateItr< CandidateClass > &aOtherItr) const
bool operator<(const WholeCandidateItr< CandidateClass > &aOtherItr) const
const LabeledCandidate< CandidateClass > & operator*() const
WholeCandidateItr(const IndexedLabeledCandidates< CandidateClass > *aList, const size_type aIndex)
bool operator!=(const WholeCandidateItr< CandidateClass > &aOtherItr) const
std::random_access_iterator_tag iterator_category
dchain::candidateitr::difference_type difference_type
const LabeledCandidate< CandidateClass > & reference
bool operator>=(const WholeCandidateItr< CandidateClass > &aOtherItr) const
const LabeledCandidate< CandidateClass > * pointer
dchain::candidateitr::size_type size_type
IndexedLabeledCandidates< CandidateClass > * indexedCandidates() const
WholeCandidateItr(const WholeCandidateItr< CandidateClass > &aOtherItr)
bool operator==(const WholeCandidateItr< CandidateClass > &aOtherItr) const
WholeCandidateItr< CandidateClass > operator+(difference_type n)
difference_type operator-(const WholeCandidateItr< CandidateClass > &aOtherItr) const
WholeCandidateItr< CandidateClass > operator-(difference_type n)
WholeCandidateItr< CandidateClass > & operator-=(difference_type n)
unsigned int size_type
Definition: candidateitr.h:36