BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Event/DecayChain/include/DecayChain/Iterator/MuteWholeItr.h
Go to the documentation of this file.
1#ifndef DCHAIN_MUTEWHOLEITR_H
2#define DCHAIN_MUTEWHOLEITR_H
3// -*- C++ -*-
4//
5// Package: DChain
6// Module: MuteWholeItr
7//
8// Description: Itr through a entire LabeledList.
9//
10// Usage:
11// <usage>
12//
13// Author: Simon Patton
14// Created: Wed Sep 11 21:51:25 EDT 1996
15// $Id: MuteWholeItr.h,v 1.1.1.1 2009/03/03 06:06:56 maqm Exp $
16//
17// Revision history
18//
19// $Log: MuteWholeItr.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:17 cdj
24// massive class renaming, addition of [] for selection and unit tests
25//
26//
27
28// system include files
29
30// user include files
31#include "DecayChain/Element/LabeledParticle.h"
32#include "DecayChain/Iterator/MuteWholeCandidateItr.h" // superclass
33#include "DecayChain/List/IndexedLabeledParticles.h"
34
35// forward declarations
36namespace dchain {
37 template <class T> class LabeledParticle;
38 template <class T, class CandidateClass> class LabeledParticleList;
39
40 template <class T, class CandidateClass> class IndexedLabeledParticles;
41
42 //
43 // Note : some functions are inlines in the declaration becuase too many
44 // compiler bugs make it impractical to have definition outside
45 // the delcaration! This should be reviewed in the future
46 //
47
48 template <class T>
49 class MuteWholeItr : public MuteWholeCandidateItr<typename T::CandidateClass> {
50 // friend classses and functions
51 friend class LabeledParticleList<T, typename T::CandidateClass>;
52
53 public:
54 // constants, enums and typedefs
55 typedef MuteWholeCandidateItr<typename T::CandidateClass> ParentType;
58
59 // Constructors and destructor
60 MuteWholeItr( const MuteWholeItr<T>& aOtherItr );
61 // virtual ~MuteWholeItr() ;
62
63 // assignment operator(s)
64 const MuteWholeItr<T>& operator=( const MuteWholeItr<T>& aOtherItr );
65
66 // member functions
67 MuteWholeItr<T>& operator++();
68 MuteWholeItr<T> operator++( int );
69 MuteWholeItr<T>& operator--();
70 MuteWholeItr<T> operator--( int );
71 MuteWholeItr<T>& operator+=( difference_type n ) {
73 return ( *this );
74 }
76 MuteWholeItr<T> tmp( *this );
77 return ( tmp += n );
78 }
84 MuteWholeItr<T> tmp( *this );
85 return ( tmp -= n );
86 }
87
88 // const member functions
91 return ( ( *(IndexedLabeledParticles<
92 T, typename T::CandidateClass>*)( this->indexedCandidates() ) )
93 .labeledParticleClass( this->index() + n ) );
94 }
95 difference_type operator-( const MuteWholeItr<T>& aOtherItr ) const {
96 return ( this->index() - aOtherItr.index() );
97 }
98
99 // static member functions
100
101 protected:
102 // Constructors and destructor
104 const size_type aIndex )
105 : MuteWholeCandidateItr<typename T::CandidateClass>( aList, aIndex ) {}
106
107 // protected member functions
108
109 // protected const member functions
110
111 private:
112 // Constructors and destructor
113 MuteWholeItr(); // stop default
114
115 // private member functions
116
117 // private const member functions
118
119 // data members
120
121 // static data members
122 };
123
124 // inline function definitions
125
126 //
127 // constructors and destructor
128 //
129
130 template <class T>
132 : MuteWholeCandidateItr<typename T::CandidateClass>( aOtherItr ) {}
133
134 //
135 // assignment operators
136 //
137
138 template <class T>
139 inline const MuteWholeItr<T>&
142 return ( *this );
143 }
144
145 //
146 // member functions
147 //
148
153
154 template <class T> inline MuteWholeItr<T> MuteWholeItr<T>::operator++( int ) {
155 MuteWholeItr<T> tmp( *this );
157 return ( tmp );
158 }
159
164
165 template <class T> inline MuteWholeItr<T> MuteWholeItr<T>::operator--( int ) {
166 MuteWholeItr<T> tmp( *this );
168 return ( tmp );
169 }
170
171 //
172 // const member functions
173 //
174
175 template <class T> inline LabeledParticle<T>& MuteWholeItr<T>::operator*() const {
176 return ( ( *(IndexedLabeledParticles<
177 T, typename T::CandidateClass>*)( this->indexedCandidates() ) )
178 .labeledParticleClass( this->index() ) );
179 }
180} // namespace dchain
181
182#endif /* DCHAIN_WHOLEITR_H */
const Int_t n
MuteWholeCandidateItr< CandidateClass > & operator+=(difference_type n)
const MuteWholeCandidateItr< CandidateClass > & operator=(const MuteWholeCandidateItr< CandidateClass > &aOtherItr)
MuteWholeCandidateItr< CandidateClass > & operator-=(difference_type n)
difference_type operator-(const MuteWholeItr< T > &aOtherItr) const
const MuteWholeItr< T > & operator=(const MuteWholeItr< T > &aOtherItr)
LabeledParticle< T > & operator[](size_type n) const
MuteWholeItr(IndexedLabeledParticles< T, typename T::CandidateClass > *aList, const size_type aIndex)
MuteWholeCandidateItr< typename T::CandidateClass > ParentType