CGEM BOSS 6.6.5.i
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 >
45class WholeCandidateItr
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
132
133template < class CandidateClass >
134inline
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
187
188template < class CandidateClass >
189inline
191{
192 WholeCandidateItr tmp( *this ) ;
193 ++m_index ;
194 return ( tmp ) ;
195}
196
197template < class CandidateClass >
198inline
204
205template < class CandidateClass >
206inline
208{
209 WholeCandidateItr tmp( *this ) ;
210 --m_index ;
211 return ( tmp ) ;
212}
213
214template < class CandidateClass >
215inline
221
222template < class CandidateClass >
223inline
229
230template < class CandidateClass >
231inline
237
238template < class CandidateClass >
239inline
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
WholeCandidateItr< CandidateClass > operator--(int)
const LabeledCandidate< CandidateClass > & operator[](size_type n) const
const LabeledCandidate< CandidateClass > value_type
WholeCandidateItr< CandidateClass > & operator+=(difference_type n)
std::random_access_iterator_tag iterator_category
const LabeledCandidate< CandidateClass > * pointer
const WholeCandidateItr & operator=(const WholeCandidateItr< CandidateClass > &aOtherItr)
WholeCandidateItr< CandidateClass > operator++(int)
WholeCandidateItr< CandidateClass > & operator--()
bool operator>(const WholeCandidateItr< CandidateClass > &aOtherItr) const
dchain::candidateitr::difference_type difference_type
WholeCandidateItr< CandidateClass > & operator++()
bool operator<=(const WholeCandidateItr< CandidateClass > &aOtherItr) const
bool operator<(const WholeCandidateItr< CandidateClass > &aOtherItr) const
const LabeledCandidate< CandidateClass > & reference
const LabeledCandidate< CandidateClass > & operator*() const
WholeCandidateItr(const IndexedLabeledCandidates< CandidateClass > *aList, const size_type aIndex)
dchain::candidateitr::size_type distance_type
bool operator!=(const WholeCandidateItr< CandidateClass > &aOtherItr) const
bool operator>=(const WholeCandidateItr< CandidateClass > &aOtherItr) const
IndexedLabeledCandidates< CandidateClass > * indexedCandidates() const
dchain::candidateitr::size_type size_type
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