BOSS 7.0.2
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 21 of file EvtStreamInputIterator.hh.

Member Typedef Documentation

◆ iterator_category

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

Definition at line 24 of file EvtStreamInputIterator.hh.

◆ pointer

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

Definition at line 27 of file EvtStreamInputIterator.hh.

◆ reference

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

Definition at line 28 of file EvtStreamInputIterator.hh.

◆ value_type

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

Definition at line 25 of file EvtStreamInputIterator.hh.

Constructor & Destructor Documentation

◆ EvtStreamInputIterator() [1/3]

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

Definition at line 30 of file EvtStreamInputIterator.hh.

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

◆ EvtStreamInputIterator() [2/3]

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

Definition at line 34 of file EvtStreamInputIterator.hh.

35 : _counter(other._counter ? other._counter->clone() : 0),
36 _currentValue(other._currentValue)
37 {}
Index other(Index i, Index j)
Definition: EvtCyclic3.cc:118

◆ EvtStreamInputIterator() [3/3]

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

Definition at line 39 of file EvtStreamInputIterator.hh.

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

◆ ~EvtStreamInputIterator()

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

Definition at line 45 of file EvtStreamInputIterator.hh.

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

Member Function Documentation

◆ _read()

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

Definition at line 88 of file EvtStreamInputIterator.hh.

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

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

◆ operator*()

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

Definition at line 50 of file EvtStreamInputIterator.hh.

51 {
52 return _currentValue;
53 }

◆ operator++() [1/2]

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

Definition at line 55 of file EvtStreamInputIterator.hh.

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

◆ operator++() [2/2]

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

Definition at line 61 of file EvtStreamInputIterator.hh.

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

◆ operator==()

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

Definition at line 68 of file EvtStreamInputIterator.hh.

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

◆ pastEnd()

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

Definition at line 79 of file EvtStreamInputIterator.hh.

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

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

Member Data Documentation

◆ _counter

◆ _currentValue


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