te::st::TrajectoryIterator Class Reference

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

#include <TrajectoryIterator.h>

Public Member Functions

te::gm::GeometrygetGeometry () const
 It returns the geometry pointed by the internal cursor. More...
 
te::dt::DateTimegetTime () const
 It returns the datetime pointed by the internal cursor. More...
 
bool operator!= (const TrajectoryIterator &rhs)
 Operator !=. More...
 
TrajectoryObservation operator* () const
 Prefix operator *. More...
 
TrajectoryIteratoroperator++ ()
 Prefix operator ++. More...
 
TrajectoryIterator operator++ (int aux)
 Postfix operator ++. More...
 
TrajectoryIteratoroperator-- ()
 Prefix operator –. More...
 
TrajectoryIterator operator-- (int aux)
 Postfix operator –. More...
 
const TrajectoryIteratoroperator= (const TrajectoryIterator &rhs)
 Assignment operator. More...
 
bool operator== (const TrajectoryIterator &rhs)
 Operator ==. More...
 
 TrajectoryIterator ()
 Empty constructor. More...
 
 TrajectoryIterator (TrajectoryObservationSet::const_iterator &it)
 Constructor. More...
 
virtual ~TrajectoryIterator ()
 Virtual destructor. More...
 

Private Attributes

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

Detailed Description

A class to traverse the observations of a trajectory.

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

An example of use:

TrajectoryIterator it = tj.begin(); while(it!=tj.end()) { Geometry* g = it.getGeometry(); DateTime* t = it.getTime(); ++it; }

See also
Trajectory

Definition at line 68 of file TrajectoryIterator.h.

Constructor & Destructor Documentation

te::st::TrajectoryIterator::TrajectoryIterator ( )

Empty constructor.

te::st::TrajectoryIterator::TrajectoryIterator ( TrajectoryObservationSet::const_iterator &  it)

Constructor.

Parameters
itA iterator that points to the trajectory observations
virtual te::st::TrajectoryIterator::~TrajectoryIterator ( )
virtual

Virtual destructor.

Member Function Documentation

te::gm::Geometry* te::st::TrajectoryIterator::getGeometry ( ) const

It returns the geometry pointed by the internal cursor.

Returns
A pointer to the geometry pointed by the internal cursor.
Note
The caller will NOT take the ownership of the returned pointer.
te::dt::DateTime* te::st::TrajectoryIterator::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.
bool te::st::TrajectoryIterator::operator!= ( const TrajectoryIterator rhs)

Operator !=.

TrajectoryObservation te::st::TrajectoryIterator::operator* ( ) const

Prefix operator *.

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

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

Prefix operator ++.

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

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

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

Postfix operator ++.

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

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

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

Prefix operator –.

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

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

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

Postfix operator –.

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

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

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

Assignment operator.

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

Operator ==.

Member Data Documentation

TrajectoryObservationSet::const_iterator te::st::TrajectoryIterator::m_it
private

The internal cursor.

Definition at line 163 of file TrajectoryIterator.h.


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