te::st::TimeSeriesIterator Class Reference

A class to traverse the observations of a TimeSeries. More...

#include <TimeSeriesIterator.h>

Public Member Functions

double getDouble () const
 It returns the attribute value as a double pointed by the internal cursor. More...
 
int getInt () const
 It returns the attribute value as an integer pointed by the internal cursor. More...
 
std::string getString () const
 It returns the attribute value as a string pointed by the internal cursor. More...
 
te::dt::DateTimegetTime () const
 It returns the datetime pointed by the internal cursor. More...
 
te::dt::AbstractDatagetValue () const
 It returns the attribute value pointed by the internal cursor. More...
 
bool operator!= (const TimeSeriesIterator &rhs)
 Operator !=. More...
 
TimeSeriesObservation operator* () const
 Prefix operator *. More...
 
TimeSeriesIteratoroperator++ ()
 Prefix operator ++. More...
 
TimeSeriesIterator operator++ (int aux)
 Postfix operator ++. More...
 
TimeSeriesIteratoroperator-- ()
 Prefix operator –. More...
 
TimeSeriesIterator operator-- (int aux)
 Postfix operator –. More...
 
const TimeSeriesIteratoroperator= (const TimeSeriesIterator &rhs)
 Assignment operator. More...
 
bool operator== (const TimeSeriesIterator &rhs)
 Operator ==. More...
 
 TimeSeriesIterator ()
 Empty constructor. More...
 
 TimeSeriesIterator (TimeSeriesObservationSet::const_iterator &it)
 Constructor. More...
 
virtual ~TimeSeriesIterator ()
 Virtual destructor. More...
 

Private Attributes

TimeSeriesObservationSet::const_iterator m_it
 The internal cursor. More...
 

Detailed Description

A class to traverse the observations of a TimeSeries.

This class provides a mechanism to traverse the time series observations sequentially, ordered by time.

An example of use:

TimeSeriesIterator it = tj.begin(); while(it!=tj.end()) { DateTime* t = it.getTime(); double v = it.getDouble(); //or getValue() or getInt or... ++it; }

See also
TimeSeries

Definition at line 68 of file TimeSeriesIterator.h.

Constructor & Destructor Documentation

te::st::TimeSeriesIterator::TimeSeriesIterator ( )

Empty constructor.

te::st::TimeSeriesIterator::TimeSeriesIterator ( TimeSeriesObservationSet::const_iterator &  it)

Constructor.

Parameters
itA iterator that points to the TimeSeries observations
virtual te::st::TimeSeriesIterator::~TimeSeriesIterator ( )
virtual

Virtual destructor.

Member Function Documentation

double te::st::TimeSeriesIterator::getDouble ( ) const

It returns the attribute value as a double pointed by the internal cursor.

Returns
A pointer to the attribute value as a double pointed by the internal cursor.
int te::st::TimeSeriesIterator::getInt ( ) const

It returns the attribute value as an integer pointed by the internal cursor.

Returns
A pointer to the attribute value as an integer pointed by the internal cursor.
std::string te::st::TimeSeriesIterator::getString ( ) const

It returns the attribute value as a string pointed by the internal cursor.

Returns
A pointer to the attribute value as a string pointed by the internal cursor.
te::dt::DateTime* te::st::TimeSeriesIterator::getTime ( ) const

It returns the datetime pointed by the internal cursor.

Returns
A pointer to the datetime pointed by the internal cursor.
Note
The caller will NOT take the ownership of the returned pointer.
te::dt::AbstractData* te::st::TimeSeriesIterator::getValue ( ) const

It returns the attribute value pointed by the internal cursor.

Returns
A pointer to the attribute value pointed by the internal cursor.
Note
The caller will NOT take the ownership of the returned pointer.
bool te::st::TimeSeriesIterator::operator!= ( const TimeSeriesIterator rhs)

Operator !=.

TimeSeriesObservation te::st::TimeSeriesIterator::operator* ( ) const

Prefix operator *.

It returns the observation (a pair of shared pointers to the time and value) pointed by the internal cursor.

TimeSeriesIterator& te::st::TimeSeriesIterator::operator++ ( )

Prefix operator ++.

After using this operator, the internal cursor points to the next TimeSeries observation.

The semantics of prefix is this: Increment the value and then fetch it.

TimeSeriesIterator te::st::TimeSeriesIterator::operator++ ( int  aux)

Postfix operator ++.

After using this operator, the internal cursor points to the next TimeSeries observation.

The semantics of postfix is: Fetch the value and then increment the original.

TimeSeriesIterator& te::st::TimeSeriesIterator::operator-- ( )

Prefix operator –.

After using this operator, the internal cursor points to the preceding TimeSeries observation.

The semantics of prefix is this: Increment the value and then fetch it.

TimeSeriesIterator te::st::TimeSeriesIterator::operator-- ( int  aux)

Postfix operator –.

After using this operator, the internal cursor points to the preceding TimeSeries observation.

The semantics of postfix is: Fetch the value and then increment the original.

const TimeSeriesIterator& te::st::TimeSeriesIterator::operator= ( const TimeSeriesIterator rhs)

Assignment operator.

bool te::st::TimeSeriesIterator::operator== ( const TimeSeriesIterator rhs)

Operator ==.

Member Data Documentation

TimeSeriesObservationSet::const_iterator te::st::TimeSeriesIterator::m_it
private

The internal cursor.

Definition at line 184 of file TimeSeriesIterator.h.


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