All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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.

Definition at line 29 of file TrajectoryIterator.cpp.

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

Constructor.

Parameters
itA iterator that points to the trajectory observations

Definition at line 33 of file TrajectoryIterator.cpp.

te::st::TrajectoryIterator::~TrajectoryIterator ( )
virtual

Virtual destructor.

Definition at line 99 of file TrajectoryIterator.cpp.

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.

Definition at line 89 of file TrajectoryIterator.cpp.

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.

Definition at line 94 of file TrajectoryIterator.cpp.

Referenced by te::st::Trajectory::getPatches().

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

Operator !=.

Definition at line 53 of file TrajectoryIterator.cpp.

References m_it.

te::st::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.

Definition at line 84 of file TrajectoryIterator.cpp.

te::st::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.

Definition at line 58 of file TrajectoryIterator.cpp.

te::st::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.

Definition at line 64 of file TrajectoryIterator.cpp.

te::st::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.

Definition at line 71 of file TrajectoryIterator.cpp.

te::st::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.

Definition at line 77 of file TrajectoryIterator.cpp.

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

Assignment operator.

Definition at line 39 of file TrajectoryIterator.cpp.

References m_it.

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

Operator ==.

Definition at line 48 of file TrajectoryIterator.cpp.

References m_it.

Member Data Documentation

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

The internal cursor.

Definition at line 163 of file TrajectoryIterator.h.

Referenced by operator!=(), operator=(), and operator==().


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