1 #ifndef StiSortedHitIterator_HH
2 #define StiSortedHitIterator_HH
5 #define HACK_forward_iterator
13 #include "StiDetector.h"
14 #include "StiHitContainer.h"
22 #ifndef HACK_forward_iterator
23 :
public iterator<forward_iterator_tag, Hit_t, ptrdiff_t, Hit_t*, Hit_t&>
25 :
public forward_iterator<Hit_t, int>
33 vector<StiDetector*>::iterator firstDet,
34 vector<StiDetector*>::iterator lastDet);
61 vector<StiDetector*>::iterator _currentDet;
63 vector<StiDetector*>::iterator _firstDet;
65 vector<StiDetector*>::iterator _lastDet;
67 vector<StiHit*>::iterator _currentDetHit;
69 vector<StiHit*>::iterator _lastDetHit;
77 _currentHit = iter._currentHit;
78 _hitContainer = iter._hitContainer;
79 _currentDet = iter._currentDet;
80 _firstDet = iter._firstDet;
81 _lastDet = iter._lastDet;
82 _currentDetHit = iter._currentDetHit;
83 _lastDetHit = iter._lastDetHit;
92 return _currentHit==rhs._currentHit;
99 return _currentHit!=rhs._currentHit;
122 if (_currentDetHit<_lastDetHit)
124 _currentHit = *_currentDetHit;
130 if (_currentDet<_lastDet)
135 while (_currentDet<_lastDet && go )
138 if (_currentDet<_lastDet )
141 if (_hitContainer->hasDetector(*_currentDet)) {
143 _currentDetHit = _hitContainer->hitsBegin(*_currentDet);
144 _lastDetHit = _hitContainer->hitsEnd(*_currentDet);
145 if (_currentDetHit < _lastDetHit)
149 _currentHit = *_currentDetHit;
159 _currentDet = _lastDet;
160 _currentDetHit = _lastDetHit;
167 _currentDet = _lastDet;
168 _currentDetHit = _lastDetHit;
StiSortedHitIterator & operator++()
prefix
bool operator==(const StiSortedHitIterator &rhs)
equality:
~StiSortedHitIterator()
Destructor.
bool operator!=(const StiSortedHitIterator &rhs)
inequlity
const StiSortedHitIterator & operator=(const StiSortedHitIterator &iter)
Asignment operator.