BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
dchain::PartialCandidateItr< CandidateClass > Class Template Reference

#include <PartialCandidateItr.h>

Public Types

typedef LabeledCandidate< CandidateClass > value_type
 
typedef dchain::candidateitr::difference_type difference_type
 
typedef dchain::candidateitr::size_type size_type
 
typedef value_typereference
 
typedef value_typepointer
 
typedef std::bidirectional_iterator_tag iterator_category
 
typedef LabeledCandidate< CandidateClass > value_type
 
typedef dchain::candidateitr::difference_type difference_type
 
typedef dchain::candidateitr::size_type size_type
 
typedef value_typereference
 
typedef value_typepointer
 
typedef std::bidirectional_iterator_tag iterator_category
 

Public Member Functions

 PartialCandidateItr ()
 
 PartialCandidateItr (const PartialCandidateItr< CandidateClass > &aOtherItr)
 
virtual ~PartialCandidateItr ()
 
const PartialCandidateItr< CandidateClass > & operator= (const PartialCandidateItr< CandidateClass > &aOtherItr)
 
PartialCandidateItr< CandidateClass > & operator++ ()
 
PartialCandidateItr< CandidateClass > operator++ (int)
 
PartialCandidateItr< CandidateClass > & operator-- ()
 
PartialCandidateItr< CandidateClass > operator-- (int)
 
const LabeledCandidate< CandidateClass > & operator* () const
 
bool operator== (const PartialCandidateItr< CandidateClass > &aOtherItr) const
 
bool operator!= (const PartialCandidateItr< CandidateClass > &aOtherItr) const
 
 PartialCandidateItr ()
 
 PartialCandidateItr (const PartialCandidateItr< CandidateClass > &aOtherItr)
 
virtual ~PartialCandidateItr ()
 
const PartialCandidateItr< CandidateClass > & operator= (const PartialCandidateItr< CandidateClass > &aOtherItr)
 
PartialCandidateItr< CandidateClass > & operator++ ()
 
PartialCandidateItr< CandidateClass > operator++ (int)
 
PartialCandidateItr< CandidateClass > & operator-- ()
 
PartialCandidateItr< CandidateClass > operator-- (int)
 
const LabeledCandidate< CandidateClass > & operator* () const
 
bool operator== (const PartialCandidateItr< CandidateClass > &aOtherItr) const
 
bool operator!= (const PartialCandidateItr< CandidateClass > &aOtherItr) const
 

Protected Member Functions

 PartialCandidateItr (const IndexedLabeledCandidates< CandidateClass > *aList, const size_type aIndex, const conjugation::Label aLabel)
 
IndexedLabeledCandidates< CandidateClass > * indexedCandidates () const
 
size_type index () const
 
conjugation::Label label () const
 
 PartialCandidateItr (const IndexedLabeledCandidates< CandidateClass > *aList, const size_type aIndex, const conjugation::Label aLabel)
 
IndexedLabeledCandidates< CandidateClass > * indexedCandidates () const
 
size_type index () const
 
conjugation::Label label () const
 

Friends

class LabeledCandidateList< CandidateClass >
 

Detailed Description

template<class CandidateClass>
class dchain::PartialCandidateItr< CandidateClass >

Definition at line 47 of file Event/DecayChain/DecayChain-00-00-03-slc6tag/DecayChain/Iterator/PartialCandidateItr.h.

Member Typedef Documentation

◆ difference_type [1/2]

template<class CandidateClass >
typedef dchain::candidateitr::difference_type dchain::PartialCandidateItr< CandidateClass >::difference_type

◆ difference_type [2/2]

template<class CandidateClass >
typedef dchain::candidateitr::difference_type dchain::PartialCandidateItr< CandidateClass >::difference_type

◆ iterator_category [1/2]

template<class CandidateClass >
typedef std::bidirectional_iterator_tag dchain::PartialCandidateItr< CandidateClass >::iterator_category

◆ iterator_category [2/2]

template<class CandidateClass >
typedef std::bidirectional_iterator_tag dchain::PartialCandidateItr< CandidateClass >::iterator_category

◆ pointer [1/2]

template<class CandidateClass >
typedef value_type* dchain::PartialCandidateItr< CandidateClass >::pointer

◆ pointer [2/2]

template<class CandidateClass >
typedef value_type* dchain::PartialCandidateItr< CandidateClass >::pointer

◆ reference [1/2]

template<class CandidateClass >
typedef value_type& dchain::PartialCandidateItr< CandidateClass >::reference

◆ reference [2/2]

template<class CandidateClass >
typedef value_type& dchain::PartialCandidateItr< CandidateClass >::reference

◆ size_type [1/2]

template<class CandidateClass >
typedef dchain::candidateitr::size_type dchain::PartialCandidateItr< CandidateClass >::size_type

◆ size_type [2/2]

template<class CandidateClass >
typedef dchain::candidateitr::size_type dchain::PartialCandidateItr< CandidateClass >::size_type

◆ value_type [1/2]

template<class CandidateClass >
typedef LabeledCandidate<CandidateClass> dchain::PartialCandidateItr< CandidateClass >::value_type

◆ value_type [2/2]

template<class CandidateClass >
typedef LabeledCandidate<CandidateClass> dchain::PartialCandidateItr< CandidateClass >::value_type

Constructor & Destructor Documentation

◆ PartialCandidateItr() [1/6]

template<class CandidateClass >
dchain::PartialCandidateItr< CandidateClass >::PartialCandidateItr
inline

◆ PartialCandidateItr() [2/6]

template<class CandidateClass >
dchain::PartialCandidateItr< CandidateClass >::PartialCandidateItr ( const PartialCandidateItr< CandidateClass > &  aOtherItr)
inline

Definition at line 156 of file Event/DecayChain/DecayChain-00-00-03-slc6tag/DecayChain/Iterator/PartialCandidateItr.h.

156 :
157 m_indexedCandidates( aOtherItr.indexedCandidates() ) ,
158 m_index( aOtherItr.index() ) ,
159 m_label( aOtherItr.label() )
160{
161}

◆ ~PartialCandidateItr() [1/2]

template<class CandidateClass >
virtual dchain::PartialCandidateItr< CandidateClass >::~PartialCandidateItr ( )
inlinevirtual

◆ PartialCandidateItr() [3/6]

template<class CandidateClass >
dchain::PartialCandidateItr< CandidateClass >::PartialCandidateItr ( const IndexedLabeledCandidates< CandidateClass > *  aList,
const size_type  aIndex,
const conjugation::Label  aLabel 
)
inlineprotected

Definition at line 165 of file Event/DecayChain/DecayChain-00-00-03-slc6tag/DecayChain/Iterator/PartialCandidateItr.h.

167 :
168 // cast away const as const_iterator can be assocciated with a non-const list,
169 // but only const lists use this constructor
170 m_indexedCandidates( (IndexedLabeledCandidates< CandidateClass >*)aList ) ,
171 m_index( aIndex ) ,
172 m_label( aLabel )
173{
174 // move to first entry with correct label
175 if ( ( m_index < size_type( (*m_indexedCandidates).size() ) ) &&
176 ( (*m_indexedCandidates).labeledCandidateClass( m_index ) != m_label )
177 ) {
178 operator++() ;
179 }
180}

◆ PartialCandidateItr() [4/6]

template<class CandidateClass >
dchain::PartialCandidateItr< CandidateClass >::PartialCandidateItr ( )

◆ PartialCandidateItr() [5/6]

template<class CandidateClass >
dchain::PartialCandidateItr< CandidateClass >::PartialCandidateItr ( const PartialCandidateItr< CandidateClass > &  aOtherItr)

◆ ~PartialCandidateItr() [2/2]

template<class CandidateClass >
virtual dchain::PartialCandidateItr< CandidateClass >::~PartialCandidateItr ( )
inlinevirtual

◆ PartialCandidateItr() [6/6]

template<class CandidateClass >
dchain::PartialCandidateItr< CandidateClass >::PartialCandidateItr ( const IndexedLabeledCandidates< CandidateClass > *  aList,
const size_type  aIndex,
const conjugation::Label  aLabel 
)
protected

Member Function Documentation

◆ index() [1/2]

template<class CandidateClass >
PartialCandidateItr< CandidateClass >::size_type dchain::PartialCandidateItr< CandidateClass >::index
inlineprotected

◆ index() [2/2]

template<class CandidateClass >
size_type dchain::PartialCandidateItr< CandidateClass >::index ( ) const
protected

◆ indexedCandidates() [1/2]

template<class CandidateClass >
IndexedLabeledCandidates< CandidateClass > * dchain::PartialCandidateItr< CandidateClass >::indexedCandidates
inlineprotected

◆ indexedCandidates() [2/2]

template<class CandidateClass >
IndexedLabeledCandidates< CandidateClass > * dchain::PartialCandidateItr< CandidateClass >::indexedCandidates ( ) const
protected

◆ label() [1/2]

◆ label() [2/2]

template<class CandidateClass >
conjugation::Label dchain::PartialCandidateItr< CandidateClass >::label ( ) const
protected

◆ operator!=() [1/2]

template<class CandidateClass >
bool dchain::PartialCandidateItr< CandidateClass >::operator!= ( const PartialCandidateItr< CandidateClass > &  aOtherItr) const
inline

Definition at line 311 of file Event/DecayChain/DecayChain-00-00-03-slc6tag/DecayChain/Iterator/PartialCandidateItr.h.

312{
313 // There needs to be a final test on the label as itrs with two different labels
314 // have the same values for the past-the-end value
315 return ( ( m_index != aOtherItr.index() ) ||
316 ( m_indexedCandidates != aOtherItr.indexedCandidates() ) ||
317 ( m_label != aOtherItr.label() ) ) ;
318}

◆ operator!=() [2/2]

template<class CandidateClass >
bool dchain::PartialCandidateItr< CandidateClass >::operator!= ( const PartialCandidateItr< CandidateClass > &  aOtherItr) const

◆ operator*() [1/2]

template<class CandidateClass >
const LabeledCandidate< CandidateClass > & dchain::PartialCandidateItr< CandidateClass >::operator*
inline

Definition at line 293 of file Event/DecayChain/DecayChain-00-00-03-slc6tag/DecayChain/Iterator/PartialCandidateItr.h.

294{
295 return ( (*m_indexedCandidates).labeledCandidateClass( m_index ) ) ;
296}

◆ operator*() [2/2]

template<class CandidateClass >
const LabeledCandidate< CandidateClass > & dchain::PartialCandidateItr< CandidateClass >::operator* ( ) const

◆ operator++() [1/4]

template<class CandidateClass >
PartialCandidateItr< CandidateClass > & dchain::PartialCandidateItr< CandidateClass >::operator++
inline

Definition at line 202 of file Event/DecayChain/DecayChain-00-00-03-slc6tag/DecayChain/Iterator/PartialCandidateItr.h.

203{
204 ++m_index ;
205 // This while loop find next match to label.
206 // The order is done for efficiency reasons. It is more likely a label
207 // will match than the end of the list has been reached. However this
208 // will can cause an access to an uninitiallized location, but the
209 // loop will still terminate correctly.
210 // update: the efficiency doesn't matter but reading invalid memory
211 // makes our automated memory checkers have fits
212 while (
213 ( m_index < size_type( (*m_indexedCandidates).size() ) &&
214 ( (*m_indexedCandidates).labeledCandidateClass( m_index ) != m_label )
215 ) ) {
216 ++m_index ;
217 }
218 return ( *this ) ;
219}

Referenced by dchain::PartialItr< T >::operator++(), and dchain::PartialCandidateItr< CandidateClass >::PartialCandidateItr().

◆ operator++() [2/4]

template<class CandidateClass >
PartialCandidateItr< CandidateClass > & dchain::PartialCandidateItr< CandidateClass >::operator++ ( )

◆ operator++() [3/4]

template<class CandidateClass >
PartialCandidateItr< CandidateClass > dchain::PartialCandidateItr< CandidateClass >::operator++ ( int  )
inline

Definition at line 223 of file Event/DecayChain/DecayChain-00-00-03-slc6tag/DecayChain/Iterator/PartialCandidateItr.h.

224{
225 PartialCandidateItr< CandidateClass > tmp( *this ) ;
226 ++m_index ;
227 // This while loop find next match to label.
228 // The order is done for efficiency reasons. It is more likely a label
229 // will match than the end of the list has been reached. However this
230 // will can cause an access to an uninitiallized location, but the
231 // loop will still terminate correctly.
232 while (
233 ( (*m_indexedCandidates).labeledCandidateClass( m_index ) != m_label ) &&
234 ( m_index < size_type( (*m_indexedCandidates).size() ) ) ) {
235 ++m_index ;
236 }
237 return ( tmp ) ;
238}

◆ operator++() [4/4]

template<class CandidateClass >
PartialCandidateItr< CandidateClass > dchain::PartialCandidateItr< CandidateClass >::operator++ ( int  )

◆ operator--() [1/4]

template<class CandidateClass >
PartialCandidateItr< CandidateClass > & dchain::PartialCandidateItr< CandidateClass >::operator--
inline

Definition at line 242 of file Event/DecayChain/DecayChain-00-00-03-slc6tag/DecayChain/Iterator/PartialCandidateItr.h.

243{
244 // As the index is 'unsigned' it should not go below zero. This behavior is completely
245 // consistent with the STL reverse_iterator adaptor. (See pp254 of Musser & Saini)
246 //
247 if ( 0 != m_index ) {
248 --m_index ;
249 }
250 // This while loop find next match to label.
251 // The order is done for efficiency reasons. It is more likely a label
252 // will match than the end of the list has been reached. However this
253 // will can cause an access to an uninitiallized location, but the
254 // loop will still terminate correctly.
255 while (
256 ( (*m_indexedCandidates).labeledCandidateClass( m_index ) != m_label ) &&
257 ( m_index != 0 ) ) {
258 --m_index ;
259 }
260 return ( *this ) ;
261}

Referenced by dchain::PartialItr< T >::operator--().

◆ operator--() [2/4]

template<class CandidateClass >
PartialCandidateItr< CandidateClass > & dchain::PartialCandidateItr< CandidateClass >::operator-- ( )

◆ operator--() [3/4]

template<class CandidateClass >
PartialCandidateItr< CandidateClass > dchain::PartialCandidateItr< CandidateClass >::operator-- ( int  )
inline

Definition at line 265 of file Event/DecayChain/DecayChain-00-00-03-slc6tag/DecayChain/Iterator/PartialCandidateItr.h.

266{
267 PartialCandidateItr< CandidateClass > tmp( *this ) ;
268 // As the index is 'unsigned' it should not go below zero. This behavior is completely
269 // consistent with the STL reverse_iterator adaptor. (See pp254 of Musser & Saini)
270 //
271 if ( 0 != m_index ) {
272 --m_index ;
273 }
274 // This while loop find next match to label.
275 // The order is done for efficiency reasons. It is more likely a label
276 // will match than the end of the list has been reached. However this
277 // will can cause an access to an uninitiallized location, but the
278 // loop will still terminate correctly.
279 while (
280 ( (*m_indexedCandidates).labeledCandidateClass( m_index ) != m_label ) &&
281 ( m_index != 0 ) ) {
282 --m_index ;
283 }
284 return ( tmp ) ;
285}

◆ operator--() [4/4]

template<class CandidateClass >
PartialCandidateItr< CandidateClass > dchain::PartialCandidateItr< CandidateClass >::operator-- ( int  )

◆ operator=() [1/2]

template<class CandidateClass >
const PartialCandidateItr< CandidateClass > & dchain::PartialCandidateItr< CandidateClass >::operator= ( const PartialCandidateItr< CandidateClass > &  aOtherItr)
inline

Definition at line 188 of file Event/DecayChain/DecayChain-00-00-03-slc6tag/DecayChain/Iterator/PartialCandidateItr.h.

189{
190 m_indexedCandidates = aOtherItr.indexedCandidates() ;
191 m_index = aOtherItr.index() ;
192 m_label = aOtherItr.label() ;
193 return ( *this ) ;
194}

Referenced by dchain::PartialItr< T >::operator=().

◆ operator=() [2/2]

template<class CandidateClass >
const PartialCandidateItr< CandidateClass > & dchain::PartialCandidateItr< CandidateClass >::operator= ( const PartialCandidateItr< CandidateClass > &  aOtherItr)

◆ operator==() [1/2]

template<class CandidateClass >
bool dchain::PartialCandidateItr< CandidateClass >::operator== ( const PartialCandidateItr< CandidateClass > &  aOtherItr) const
inline

Definition at line 300 of file Event/DecayChain/DecayChain-00-00-03-slc6tag/DecayChain/Iterator/PartialCandidateItr.h.

301{
302 // There needs to be a final test on the label as itrs with two different labels
303 // have the same values for the past-the-end value
304 return ( ( m_index == aOtherItr.index() ) &&
305 ( m_indexedCandidates == aOtherItr.indexedCandidates() ) &&
306 ( m_label == aOtherItr.label() ) ) ;
307}

◆ operator==() [2/2]

template<class CandidateClass >
bool dchain::PartialCandidateItr< CandidateClass >::operator== ( const PartialCandidateItr< CandidateClass > &  aOtherItr) const

Friends And Related Function Documentation

◆ LabeledCandidateList< CandidateClass >

template<class CandidateClass >
LabeledCandidateList< CandidateClass >
friend

The documentation for this class was generated from the following files: