BOSS 8.0.0
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 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 20 of file EvtStreamInputIterator.hh.

Member Typedef Documentation

◆ iterator_category

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

Definition at line 22 of file EvtStreamInputIterator.hh.

◆ pointer

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

Definition at line 25 of file EvtStreamInputIterator.hh.

◆ reference

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

Definition at line 26 of file EvtStreamInputIterator.hh.

◆ value_type

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

Definition at line 23 of file EvtStreamInputIterator.hh.

Constructor & Destructor Documentation

◆ EvtStreamInputIterator() [1/3]

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

Definition at line 28 of file EvtStreamInputIterator.hh.

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

Referenced by EvtStreamInputIterator(), operator++(), operator++(), and operator==().

◆ EvtStreamInputIterator() [2/3]

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

◆ EvtStreamInputIterator() [3/3]

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

Definition at line 34 of file EvtStreamInputIterator.hh.

34 : _counter( counter.clone() ) {
35 _currentValue = _counter->currentValue();
36 }

◆ ~EvtStreamInputIterator()

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

Definition at line 38 of file EvtStreamInputIterator.hh.

38 {
39 if ( _counter ) delete _counter;
40 }

Member Function Documentation

◆ _read()

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

Definition at line 72 of file EvtStreamInputIterator.hh.

72 {
73
74 _counter->advance();
75 _currentValue = _counter->currentValue();
76 }

Referenced by operator++(), and operator++().

◆ operator*()

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

Definition at line 42 of file EvtStreamInputIterator.hh.

42{ return _currentValue; }

◆ operator++() [1/2]

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

Definition at line 44 of file EvtStreamInputIterator.hh.

44 {
45 _read();
46 return *this;
47 }

◆ operator++() [2/2]

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

Definition at line 49 of file EvtStreamInputIterator.hh.

49 {
51 _read();
52 return tmp;
53 }

◆ operator==()

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

Definition at line 55 of file EvtStreamInputIterator.hh.

55 {
56 // Equality is only defined for two past the end iterators
57 return ( pastEnd() && other.pastEnd() );
58 }

◆ pastEnd()

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

Definition at line 64 of file EvtStreamInputIterator.hh.

64 {
65 bool ret = true;
66 if ( _counter ) ret = _counter->pastEnd();
67 return ret;
68 }

Referenced by operator==().

Member Data Documentation

◆ _counter

template<class Point>
EvtStreamAdapter<Point>* EvtStreamInputIterator< Point >::_counter
protected

◆ _currentValue

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

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