Maps SDK for C++ 1.0.0
Loading...
Searching...
No Matches
gem::TimeDistance Struct Reference

Time distance representation based on meters and seconds. More...

Public Member Functions

 TimeDistance ()
 Default constructor.
 TimeDistance (unsigned int urT, unsigned int urD, unsigned int rT=0, unsigned int rD=0, double beR=-1.)
 Constructor with unrestricted and restricted times.
TimeDistancereset ()
 Reset object for reuse.
TimeDistanceassign (unsigned int urT, unsigned int urD, unsigned int rT=0, unsigned int rD=0, double beR=-1.)
 Assign new values to this object.
bool empty () const
 Check if empty.
unsigned int getTotalTime () const
 Get the total time in seconds.
unsigned int getUnrestrictedTime () const
 Get the unrestricted time in seconds.
unsigned int getRestrictedTime () const
 Get the restricted time in seconds.
unsigned int getRestrictedTimeAtBegin () const
 Get the restricted time at beginning.
unsigned int getRestrictedTimeAtEnd () const
 Get the restricted time at end.
unsigned int getTotalDistance () const
 Get the total distance in meters.
unsigned int getUnrestrictedDistance () const
 Get the unrestricted distance in meters.
unsigned int getRestrictedDistance () const
 Get the restricted distance in meters.
unsigned int getRestrictedDistanceAtBegin () const
 Get the restricted distance at beginning in meters.
unsigned int getRestrictedDistanceAtEnd () const
 Get the restricted distance at end in meters.
bool hasRestrictedBeginEndDifferentiation () const
 Check if it has different begin/end.
double getRestrictedBeginEndRatio ()
 Get restricted begin/end ratio.
bool operator== (const TimeDistance &source) const
 Comparison operator equal.
bool operator!= (const TimeDistance &source) const
 Comparison operator not equal.
TimeDistance operator+ (const TimeDistance &source) const
 Add operator.
TimeDistanceoperator+= (const TimeDistance &source)
 Add operator.

Protected Attributes

unsigned int unrestrictedTimeS
 Unrestricted time in seconds.
unsigned int restrictedTimeS
 Restricted time in seconds.
unsigned int unrestrictedDistanceM
 Unrestricted distance in meters.
unsigned int restrictedDistanceM
 Restricted distance in meters.
double ndBeginEndRatio
 Fraction in the range 0 to 1 to be used by the *AtBegin and *AtEnd functions (-1 = not set).

Detailed Description

Time distance representation based on meters and seconds.

Constructor & Destructor Documentation

◆ TimeDistance()

gem::TimeDistance::TimeDistance ( unsigned int urT,
unsigned int urD,
unsigned int rT = 0,
unsigned int rD = 0,
double beR = -1. )
inline

Constructor with unrestricted and restricted times.

Parameters
urTUnrestricted time in seconds.
urDUnrestricted distance in meters.
rTRestricted time in seconds.
rDRestricted distance in meters.
beRRestricted begin/end ratio.

Member Function Documentation

◆ assign()

TimeDistance & gem::TimeDistance::assign ( unsigned int urT,
unsigned int urD,
unsigned int rT = 0,
unsigned int rD = 0,
double beR = -1. )
inline

Assign new values to this object.

Parameters
urTUnrestricted time in seconds.
urDUnrestricted distance in meters.
rTRestricted time in seconds.
rDRestricted distance in meters.
beRRestricted begin/end ratio.
Returns
This object

◆ empty()

bool gem::TimeDistance::empty ( ) const
inline

Check if empty.

Returns
True if empty, false otherwise.

◆ getRestrictedBeginEndRatio()

double gem::TimeDistance::getRestrictedBeginEndRatio ( )
inline

Get restricted begin/end ratio.

Returns
Restricted begin/end ratio.

◆ getRestrictedDistance()

unsigned int gem::TimeDistance::getRestrictedDistance ( ) const
inline

Get the restricted distance in meters.

Returns
Restricted distance in meters.

◆ getRestrictedDistanceAtBegin()

unsigned int gem::TimeDistance::getRestrictedDistanceAtBegin ( ) const
inline

Get the restricted distance at beginning in meters.

Returns
Restricted distance at beginning in meters.

◆ getRestrictedDistanceAtEnd()

unsigned int gem::TimeDistance::getRestrictedDistanceAtEnd ( ) const
inline

Get the restricted distance at end in meters.

Returns
Restricted distance at end in meters.

◆ getRestrictedTime()

unsigned int gem::TimeDistance::getRestrictedTime ( ) const
inline

Get the restricted time in seconds.

Returns
Restricted time in seconds.

◆ getRestrictedTimeAtBegin()

unsigned int gem::TimeDistance::getRestrictedTimeAtBegin ( ) const
inline

Get the restricted time at beginning.

Returns
Restricted time at beginning.

◆ getRestrictedTimeAtEnd()

unsigned int gem::TimeDistance::getRestrictedTimeAtEnd ( ) const
inline

Get the restricted time at end.

Returns
Restricted time at end.

◆ getTotalDistance()

unsigned int gem::TimeDistance::getTotalDistance ( ) const
inline

Get the total distance in meters.

Returns
Total distance in meters.

◆ getTotalTime()

unsigned int gem::TimeDistance::getTotalTime ( ) const
inline

Get the total time in seconds.

Returns
Total time in seconds.

◆ getUnrestrictedDistance()

unsigned int gem::TimeDistance::getUnrestrictedDistance ( ) const
inline

Get the unrestricted distance in meters.

Returns
Unrestricted distance in meters.

◆ getUnrestrictedTime()

unsigned int gem::TimeDistance::getUnrestrictedTime ( ) const
inline

Get the unrestricted time in seconds.

Returns
Unrestricted time in seconds.

◆ hasRestrictedBeginEndDifferentiation()

bool gem::TimeDistance::hasRestrictedBeginEndDifferentiation ( ) const
inline

Check if it has different begin/end.

Returns
True if it has different begin/end, false otherwise.

◆ operator!=()

bool gem::TimeDistance::operator!= ( const TimeDistance & source) const
inline

Comparison operator not equal.

Parameters
sourceTimeDistance to compare to.
Returns
True if both objects are not equal, false otherwise.

◆ operator+()

TimeDistance gem::TimeDistance::operator+ ( const TimeDistance & source) const
inline

Add operator.

Parameters
sourceTimeDistance to add.
Returns
TimeDistance object with the sum of both objects.

◆ operator+=()

TimeDistance & gem::TimeDistance::operator+= ( const TimeDistance & source)
inline

Add operator.

Parameters
sourceTimeDistance to add.
Returns
TimeDistance object with the sum of both objects.

◆ operator==()

bool gem::TimeDistance::operator== ( const TimeDistance & source) const
inline

Comparison operator equal.

Parameters
sourceTimeDistance to compare to.
Returns
True if both objects are equal, false otherwise.

◆ reset()

TimeDistance & gem::TimeDistance::reset ( )
inline

Reset object for reuse.

Returns
This object