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::DateTime * | getTime () const |
| It returns the datetime pointed by the internal cursor. More... | |
| te::dt::AbstractData * | getValue () 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... | |
| TimeSeriesIterator & | operator++ () |
| Prefix operator ++. More... | |
| TimeSeriesIterator | operator++ (int aux) |
| Postfix operator ++. More... | |
| TimeSeriesIterator & | operator-- () |
| Prefix operator –. More... | |
| TimeSeriesIterator | operator-- (int aux) |
| Postfix operator –. More... | |
| const TimeSeriesIterator & | operator= (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... | |
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; }
Definition at line 68 of file TimeSeriesIterator.h.
| te::st::TimeSeriesIterator::TimeSeriesIterator | ( | ) |
Empty constructor.
| te::st::TimeSeriesIterator::TimeSeriesIterator | ( | TimeSeriesObservationSet::const_iterator & | it | ) |
Constructor.
| it | A iterator that points to the TimeSeries observations |
|
virtual |
Virtual destructor.
| double te::st::TimeSeriesIterator::getDouble | ( | ) | const |
It returns 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.
| std::string te::st::TimeSeriesIterator::getString | ( | ) | const |
It returns 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.
| te::dt::AbstractData* te::st::TimeSeriesIterator::getValue | ( | ) | const |
It returns the attribute value pointed by the internal cursor.
| 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 ==.
|
private |
The internal cursor.
Definition at line 184 of file TimeSeriesIterator.h.