CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtStreamInputIterator< Point > Class Template Reference

#include <EvtStreamInputIterator.hh>

Public Types

typedef input_iterator_tag iterator_category
 
typedef Point value_type
 
typedef ptrdiff_t difference_type
 
typedef const Point * pointer
 
typedef const Point & reference
 

Public Member Functions

 EvtStreamInputIterator ()
 
 EvtStreamInputIterator (const EvtStreamInputIterator &other)
 
 EvtStreamInputIterator (EvtStreamAdapter< Point > &counter)
 
 ~EvtStreamInputIterator ()
 
reference operator* () const
 
EvtStreamInputIteratoroperator++ ()
 
EvtStreamInputIterator operator++ (int)
 
bool operator== (const EvtStreamInputIterator &other) const
 

Protected Member Functions

bool pastEnd () const
 
void _read ()
 

Protected Attributes

EvtStreamAdapter< Point > * _counter
 
value_type _currentValue
 

Detailed Description

template<class Point>
class EvtStreamInputIterator< Point >

Definition at line 22 of file EvtStreamInputIterator.hh.

Member Typedef Documentation

◆ difference_type

template<class Point >
ptrdiff_t EvtStreamInputIterator< Point >::difference_type

Definition at line 27 of file EvtStreamInputIterator.hh.

◆ iterator_category

template<class Point >
input_iterator_tag EvtStreamInputIterator< Point >::iterator_category

Definition at line 25 of file EvtStreamInputIterator.hh.

◆ pointer

template<class Point >
const Point* EvtStreamInputIterator< Point >::pointer

Definition at line 28 of file EvtStreamInputIterator.hh.

◆ reference

template<class Point >
const Point& EvtStreamInputIterator< Point >::reference

Definition at line 29 of file EvtStreamInputIterator.hh.

◆ value_type

template<class Point >
Point EvtStreamInputIterator< Point >::value_type

Definition at line 26 of file EvtStreamInputIterator.hh.

Constructor & Destructor Documentation

◆ EvtStreamInputIterator() [1/3]

template<class Point >
EvtStreamInputIterator< Point >::EvtStreamInputIterator ( )
inline

Definition at line 31 of file EvtStreamInputIterator.hh.

32 : _counter(0)
33 {}
EvtStreamAdapter< Point > * _counter

◆ EvtStreamInputIterator() [2/3]

template<class Point >
EvtStreamInputIterator< Point >::EvtStreamInputIterator ( const EvtStreamInputIterator< Point > & other)
inline

Definition at line 35 of file EvtStreamInputIterator.hh.

36 : _counter(other._counter ? other._counter->clone() : 0),
37 _currentValue(other._currentValue)
38 {}
Index other(Index i, Index j)

◆ EvtStreamInputIterator() [3/3]

template<class Point >
EvtStreamInputIterator< Point >::EvtStreamInputIterator ( EvtStreamAdapter< Point > & counter)
inline

Definition at line 40 of file EvtStreamInputIterator.hh.

41 : _counter(counter.clone())
42 {
43 _currentValue = _counter->currentValue();
44 }
virtual EvtStreamAdapter * clone() const =0

◆ ~EvtStreamInputIterator()

template<class Point >
EvtStreamInputIterator< Point >::~EvtStreamInputIterator ( )
inline

Definition at line 46 of file EvtStreamInputIterator.hh.

47 {
48 if(_counter) delete _counter;
49 }

Member Function Documentation

◆ _read()

template<class Point >
void EvtStreamInputIterator< Point >::_read ( )
inlineprotected

Definition at line 89 of file EvtStreamInputIterator.hh.

89 {
90
91 _counter->advance();
92 _currentValue = _counter->currentValue();
93 }

Referenced by EvtStreamInputIterator< Point >::operator++(), and EvtStreamInputIterator< Point >::operator++().

◆ operator*()

template<class Point >
reference EvtStreamInputIterator< Point >::operator* ( ) const
inline

Definition at line 51 of file EvtStreamInputIterator.hh.

52 {
53 return _currentValue;
54 }

◆ operator++() [1/2]

template<class Point >
EvtStreamInputIterator & EvtStreamInputIterator< Point >::operator++ ( )
inline

Definition at line 56 of file EvtStreamInputIterator.hh.

57 {
58 _read();
59 return *this;
60 }

◆ operator++() [2/2]

template<class Point >
EvtStreamInputIterator EvtStreamInputIterator< Point >::operator++ ( int )
inline

Definition at line 62 of file EvtStreamInputIterator.hh.

63 {
64 EvtStreamInputIterator tmp = *this;
65 _read();
66 return tmp;
67 }

◆ operator==()

template<class Point >
bool EvtStreamInputIterator< Point >::operator== ( const EvtStreamInputIterator< Point > & other) const
inline

Definition at line 69 of file EvtStreamInputIterator.hh.

70 {
71 // Equality is only defined for two past the end iterators
72 return (pastEnd() && other.pastEnd());
73 }

◆ pastEnd()

template<class Point >
bool EvtStreamInputIterator< Point >::pastEnd ( ) const
inlineprotected

Definition at line 80 of file EvtStreamInputIterator.hh.

81 {
82 bool ret = true;
83 if(_counter) ret = _counter->pastEnd();
84 return ret;
85 }

Referenced by EvtStreamInputIterator< Point >::operator==().

Member Data Documentation

◆ _counter

◆ _currentValue


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