BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
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
34
35
36// forward declarations
37namespace dchain {
38 template <class T> class LabeledParticle;
39 template <class T, class CandidateClass> class LabeledParticleList;
40
41template < class T , class CandidateClass > class IndexedLabeledParticles ;
42
43//
44// Note : some functions are inlines in the declaration becuase too many
45// compiler bugs make it impractical to have definition outside
46// the delcaration! This should be reviewed in the future
47//
48
49template < class T >
50class MuteWholeItr : public MuteWholeCandidateItr< typename T::CandidateClass >
51{
52 // friend classses and functions
53 friend class LabeledParticleList< T , typename T::CandidateClass > ;
54
55 public:
56 // constants, enums and typedefs
57 typedef MuteWholeCandidateItr<typename T::CandidateClass> ParentType;
60
61 // Constructors and destructor
62 MuteWholeItr( const MuteWholeItr< T >& aOtherItr ) ;
63 //virtual ~MuteWholeItr() ;
64
65 // assignment operator(s)
66 const MuteWholeItr< T >& operator=( const MuteWholeItr< T >& aOtherItr ) ;
67
68 // member functions
69 MuteWholeItr< T >& operator++() ;
70 MuteWholeItr< T > operator++( int ) ;
71 MuteWholeItr< T >& operator--() ;
72 MuteWholeItr< T > operator--( int ) ;
73 MuteWholeItr< T >& operator+=( difference_type n )
74{
76 return( *this ) ;
77}
79{
80 MuteWholeItr< T > tmp( *this ) ;
81 return ( tmp += n ) ;
82}
84{
86 return( *this ) ;
87}
89{
90 MuteWholeItr< T > tmp( *this ) ;
91 return ( tmp -= n ) ;
92}
93
94 // const member functions
97{
98 return ( ( *(IndexedLabeledParticles< T , typename T::CandidateClass >*)(this->indexedCandidates()) ).labeledParticleClass( this->index() + n ) ) ;
99}
101{
102 return ( this->index() - aOtherItr.index() ) ;
103}
104
105 // static member functions
106
107 protected:
108 // Constructors and destructor
110 const size_type aIndex ) :
111 MuteWholeCandidateItr< typename T::CandidateClass >( aList ,
112 aIndex ) {}
113
114 // protected member functions
115
116 // protected const member functions
117
118 private:
119 // Constructors and destructor
120 MuteWholeItr() ; // stop default
121
122 // private member functions
123
124 // private const member functions
125
126 // data members
127
128 // static data members
129
130} ;
131
132// inline function definitions
133
134//
135// constructors and destructor
136//
137
138template < class T >
139inline
141 MuteWholeCandidateItr< typename T::CandidateClass >( aOtherItr )
142{
143}
144
145//
146// assignment operators
147//
148
149template < class T >
150inline
152{
154 return ( *this ) ;
155}
156
157//
158// member functions
159//
160
161template < class T >
162inline
164{
166 return ( *this ) ;
167}
168
169template < class T >
170inline
172{
173 MuteWholeItr< T > tmp( *this ) ;
175 return ( tmp ) ;
176}
177
178template < class T >
179inline
181{
183 return ( *this ) ;
184}
185
186template < class T >
187inline
189{
190 MuteWholeItr< T > tmp( *this ) ;
192 return ( tmp ) ;
193}
194
195//
196// const member functions
197//
198
199template < class T >
200inline
202{
203 return ( ( *(IndexedLabeledParticles< T , typename T::CandidateClass >*)(this->indexedCandidates()) ).labeledParticleClass( this->index() ) ) ;
204}
205}
206
207#endif /* DCHAIN_WHOLEITR_H */
MuteWholeCandidateItr< CandidateClass > & operator++()
IndexedLabeledCandidates< T::CandidateClass > * indexedCandidates() const
const MuteWholeCandidateItr< CandidateClass > & operator=(const MuteWholeCandidateItr< CandidateClass > &aOtherItr)
candidateitr::size_type size_type
candidateitr::difference_type difference_type
MuteWholeCandidateItr< CandidateClass > & operator-=(difference_type n)
MuteWholeCandidateItr< CandidateClass > & operator--()
difference_type operator-(const MuteWholeItr< T > &aOtherItr) const
Definition: MuteWholeItr.h:100
ParentType::size_type size_type
Definition: MuteWholeItr.h:59
MuteWholeItr< T > & operator-=(difference_type n)
Definition: MuteWholeItr.h:83
const MuteWholeItr< T > & operator=(const MuteWholeItr< T > &aOtherItr)
Definition: MuteWholeItr.h:151
MuteWholeItr< T > & operator++()
Definition: MuteWholeItr.h:163
MuteWholeItr< T > operator-(difference_type n)
Definition: MuteWholeItr.h:88
MuteWholeItr< T > & operator--()
Definition: MuteWholeItr.h:180
ParentType::difference_type difference_type
Definition: MuteWholeItr.h:58
MuteWholeItr< T > operator+(difference_type n)
Definition: MuteWholeItr.h:78
LabeledParticle< T > & operator*() const
Definition: MuteWholeItr.h:201
LabeledParticle< T > & operator[](size_type n) const
Definition: MuteWholeItr.h:96
MuteWholeItr(IndexedLabeledParticles< T, typename T::CandidateClass > *aList, const size_type aIndex)
Definition: MuteWholeItr.h:109