BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
WholeItr.h
Go to the documentation of this file.
1#ifndef DCHAIN_WHOLEITR_H
2#define DCHAIN_WHOLEITR_H
3// -*- C++ -*-
4//
5// Package: DChain
6// Module: WholeItr
7//
8// Description: a Iterator though whole of LabeledDecayList
9//
10// Usage:
11// <usage>
12//
13// Author: Simon Patton
14// Created: Wed Sep 11 21:51:25 EDT 1996
15// $Id: WholeItr.h,v 1.1.1.1 2009/03/03 06:06:56 maqm Exp $
16//
17// Revision history
18//
19// $Log: WholeItr.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:19 cdj
24// massive class renaming, addition of [] for selection and unit tests
25//
26// Revision 1.1.1.1 2000/12/18 22:16:51 cdj
27// imported DChain
28//
29// Revision 1.11 1998/08/28 05:16:09 sjp
30// Updated to use IndexedLabeled classes
31//
32// Revision 1.10 1997/08/28 06:59:30 sjp
33// Modified files to handle complete templating
34//
35// Revision 1.9 1997/08/26 04:13:34 sjp
36// Made Candidate handling objects into `CandidateClass' Templates
37//
38// Revision 1.8 1997/08/19 23:02:03 sjp
39// Restructured package to be independent of Rock
40//
41// Revision 1.7 1997/08/15 21:32:43 sjp
42// Updated to use <package>/<file>.h include structure.
43// Updated to use bug flags specified in Experiement.h
44//
45// Revision 1.6 1997/01/31 20:17:19 sjp
46// Modified to use the new `bug' include files
47//
48// Revision 1.5 1997/01/22 16:27:35 sjp
49// Fixed error in pre-processor labels
50//
51// Revision 1.4 1997/01/21 20:34:11 sjp
52// Changed CPP flags and include because of library reorganization
53//
54// Revision 1.3 1996/12/31 17:46:45 sjp
55// Replaced ptrdiff with member type distance
56//
57// Revision 1.2 1996/12/20 21:19:28 sjp
58// Extended pathnames for Include files
59//
60// Revision 1.1 1996/11/04 19:36:16 sjp
61// New file for new `List' module
62//
63
64// system include files
65
66// user include files
67#include "DecayChain/Iterator/WholeCandidateItr.h" // superclass
70
71// forward declarations
72namespace dchain {
73//template < class T > class LabeledParticle ;
74//template < class T , class CandidateClass > class IndexedLabeledParticles ;
75template < class T , class CandidateClass > class LabeledParticleList ;
76
77//
78// Note : some functions are inlines in the declaration becuase too many
79// compiler bugs make it impractical to have definition outside
80// the delcaration! This should be reviewed in the future
81//
82
83template < class T >
84class WholeItr : public WholeCandidateItr< typename T::CandidateClass >
85{
86 // friend classses and functions
87 friend class LabeledParticleList< T , typename T::CandidateClass > ;
88
89 public:
90 // constants, enums and typedefs
91 typedef WholeCandidateItr<typename T::CandidateClass> ParentType;
94
95 // Constructors and destructor
96 WholeItr( const WholeItr< T >& aOtherItr ) ;
97 //virtual ~WholeItr() ;
98
99 // assignment operator(s)
100 const WholeItr< T >& operator=( const WholeItr< T >& aOtherItr ) ;
101
102 // member functions
103 WholeItr< T >& operator++() ;
104 WholeItr< T > operator++( int ) ;
105 WholeItr< T >& operator--() ;
106 WholeItr< T > operator--( int ) ;
107 WholeItr< T >& operator+=( difference_type n )
108 {
110 return( *this ) ;
111 }
113 {
114 WholeItr< T > tmp( *this ) ;
115 return ( tmp += n ) ;
116 }
118 {
120 return( *this ) ;
121 }
123 {
124 WholeItr< T > tmp( *this ) ;
125 return ( tmp -= n ) ;
126 }
127
128 // const member functions
129 const LabeledParticle< T >& operator*() const ;
131 {
132 return ( ( *(IndexedLabeledParticles< T , typename T::CandidateClass >*)(this->indexedCandidates()) ).labeledParticleClass( this->index() + n ) ) ;
133 }
134 difference_type operator-( const WholeItr< T >& aOtherItr ) const
135 {
136 return ( this->index() - aOtherItr.index() ) ;
137 }
138
139 // static member functions
140
141 protected:
142 // Constructors and destructor
144 const size_type aIndex ) :
145 WholeCandidateItr< typename T::CandidateClass >( aList ,
146 aIndex ) {}
147
148 // protected member functions
149
150 // protected const member functions
151
152 private:
153 // Constructors and destructor
154 WholeItr() ; // stop default
155
156 // private member functions
157
158 // private const member functions
159
160 // data members
161
162 // static data members
163
164} ;
165
166// inline function definitions
167
168// user include files
169
170//
171// constructors and destructor
172//
173
174template < class T >
175inline
177 WholeCandidateItr< typename T::CandidateClass >( aOtherItr )
178{
179}
180
181//
182// assignment operators
183//
184
185template < class T >
186inline
188{
190 return ( *this ) ;
191}
192
193//
194// member functions
195//
196
197template < class T >
198inline
200{
202 return ( *this ) ;
203}
204
205template < class T >
206inline
208{
209 WholeItr< T > tmp( *this ) ;
211 return ( tmp ) ;
212}
213
214template < class T >
215inline
217{
219 return ( *this ) ;
220}
221
222template < class T >
223inline
225{
226 WholeItr< T > tmp( *this ) ;
228 return ( tmp ) ;
229}
230
231//
232// const member functions
233//
234
235template < class T >
236inline
238{
239 return ( ( *(IndexedLabeledParticles< T , typename T::CandidateClass >*)(this->indexedCandidates()) ).labeledParticleClass( this->index() ) ) ;
240}
241}
242
243
244#endif /* DCHAIN_WHOLEITR_H */
const Int_t n
const WholeCandidateItr & operator=(const WholeCandidateItr< CandidateClass > &aOtherItr)
WholeCandidateItr< CandidateClass > & operator--()
WholeCandidateItr< CandidateClass > & operator++()
dchain::candidateitr::difference_type difference_type
dchain::candidateitr::size_type size_type
IndexedLabeledCandidates< T::CandidateClass > * indexedCandidates() const
WholeCandidateItr< CandidateClass > & operator-=(difference_type n)
const WholeItr< T > & operator=(const WholeItr< T > &aOtherItr)
Definition: WholeItr.h:187
WholeItr< T > operator+(difference_type n)
Definition: WholeItr.h:112
WholeItr(const IndexedLabeledParticles< T, typename T::CandidateClass > *aList, const size_type aIndex)
Definition: WholeItr.h:143
WholeItr< T > & operator--()
Definition: WholeItr.h:216
const LabeledParticle< T > & operator*() const
Definition: WholeItr.h:237
WholeItr< T > & operator-=(difference_type n)
Definition: WholeItr.h:117
WholeItr< T > & operator++()
Definition: WholeItr.h:199
WholeItr< T > operator-(difference_type n)
Definition: WholeItr.h:122
const LabeledParticle< T > & operator[](size_type n) const
Definition: WholeItr.h:130
difference_type operator-(const WholeItr< T > &aOtherItr) const
Definition: WholeItr.h:134
ParentType::size_type size_type
Definition: WholeItr.h:93
ParentType::difference_type difference_type
Definition: WholeItr.h:92