TPosition Class Reference

#include <lbsposition.h>

Link against: lbs.lib

class TPosition : public TLocality

Inherits from

Protected Attributes
TTime iTime
Public Member Functions
TPosition()
TPosition(const TLocality &, TTime)
IMPORT_C voidSetCurrentTime()
IMPORT_C voidSetTime(TTime)
IMPORT_C TIntSpeed(const TPosition &, TReal32 &)
IMPORT_C TIntSpeed(const TPosition &, TReal32 &, TReal32 &)
IMPORT_C TTimeTime()
Inherited Attributes
TCoordinate::iAltitude
TCoordinate::iDatum
TCoordinate::iLatitude
TCoordinate::iLongitude
TLocality::iHorizontalAccuracy
TLocality::iVerticalAccuracy
Inherited Functions
TCoordinate::Altitude()const
TCoordinate::Datum()const
TCoordinate::Latitude()const
TCoordinate::Longitude()const
TCoordinate::Move(TReal32,TReal32)
TCoordinate::SetCoordinate(const TReal64 &,const TReal64 &)
TCoordinate::SetCoordinate(const TReal64 &,const TReal64 &,TReal32)
TCoordinate::SetDatum(TPositionDatumId)
TCoordinate::TCoordinate()
TCoordinate::TCoordinate(const TReal64 &,const TReal64 &)
TCoordinate::TCoordinate(const TReal64 &,const TReal64 &,TReal32)
TLocality::BearingTo(const TCoordinate &,TReal32 &)const
TLocality::BearingTo(const TLocality &,TReal32 &,TReal32 &)const
TLocality::Distance(const TCoordinate &,TReal32 &)const
TLocality::Distance(const TLocality &,TReal32 &,TReal32 &)const
TLocality::HorizontalAccuracy()const
TLocality::SetAccuracy(TReal32,TReal32)
TLocality::SetHorizontalAccuracy(TReal32)
TLocality::SetVerticalAccuracy(TReal32)
TLocality::TLocality()
TLocality::TLocality(const TCoordinate &,TReal32)
TLocality::TLocality(const TCoordinate &,TReal32,TReal32)
TLocality::VerticalAccuracy()const

Detailed Description

This class is the standard data structure for retrieving location information. It adds a time dimension to the inherited TLocality information. This enables the speed to be calculated from two TPosition instances.

The time reflects the system time (that is, the mobile terminal) of when the location fix was obtained. It does not indicate the time as obtained from the position technology (for example network or satellite time).

The time is contained in a TTime data structure that provides microsecond resolution. However, it should be noted that system clocks only provide a resolution of milliseconds or indeed hundredths of a second.

Member Attribute Documentation

iTime

TTime iTime[protected]

This is the system time when the position related member data was obtained.

Constructor & Destructor Documentation

TPosition ( )

IMPORT_CTPosition()

Default constructor for TCoordinate. Sets the member data to default values (NaN for coordinates, 0 for time).

TPosition ( const TLocality &, TTime )

IMPORT_CTPosition(const TLocality &aLocality,
TTimeaTime
)

Constructor for TPosition. Allows the client to set a locality and an associated time.

Parameters
aLocalityspecifies an initial value for the locality of the position.
aTimespecifies an initial value for the time of the position.

Member Function Documentation

SetCurrentTime ( )

IMPORT_C voidSetCurrentTime()

Sets the time of this position data to the current universal time as indicated by the systems clock.

SetTime ( TTime )

IMPORT_C voidSetTime(TTimeaTime)

Sets the time of this position data.

Parameters
aTimeis the new timing information.

Speed ( const TPosition &, TReal32 & )

IMPORT_C TIntSpeed(const TPosition &aPosition,
TReal32 &aSpeed
)const

This method calculates the horizontal speed between the current position and the supplied instance aPosition. The speed is calculated based on the coordinates and time associated with each instance.

Parameters
aPositionis another position to use in the calculation.
aSpeedupon successful completion, this is set to the speed indicated by being at this position at its recorded time, and at aPosition at its recorded time. Always positive, in metres per second.
Return Value
a Symbian OS error code. KErrArgument if any of iLatitude, iLongitude, aPosition.iLatitude or aPosition.iLongitude are set to NaN. KErrArgument if either of iTime or aPosition.iTime are set to zero. KErrArgument if iTime and aPosition.iTime are the same.

Speed ( const TPosition &, TReal32 &, TReal32 & )

IMPORT_C TIntSpeed(const TPosition &aPosition,
TReal32 &aSpeed,
TReal32 &aDelta
)const

This method calculates the horizontal speed between the current position and the supplied instance aPosition. The speed is calculated based on the coordinates and time associated with each instance. An estimate of the accuracy of the result is also provided.

Parameters
aPositionis another position to use in the calculation.
aSpeedupon successful completion, this is set to the speed indicated by being at this position at its recorded time, and at aPosition at its recorded time. Always positive, in metres per second.
aDeltaupon successful completion, this is set to an estimate of the accuracy of the calculation, in metres per second.
Return Value
a Symbian OS error code. KErrArgument if any of iLatitude, iLongitude, aPosition.iLatitude or aPosition.iLongitude are set to NaN. KErrArgument if any of iHorizontalAccuracy or aPosition.iHorizontalAccuracy are set to NaN. KErrArgument if either of iTime or aPosition.iTime are set to zero. KErrArgument if iTime and aPosition.iTime are the same.

Time ( )

IMPORT_C TTimeTime()const

Retrieves the time of this position data.

Return Value
the timing component of this position information.