TPosition Class Reference

API published in: S60 2nd Ed FP 2

Link against: lbs.lib

Capability Information

Required Capabilities

None

Exceptions

The capability Location is required in:

TInt RPositionServer::GetDefaultModuleId(TPositionModuleId& aModuleId) const;

TInt RPositionServer::GetNumModules(TUint& aNumModules) const;

TInt RPositionServer::GetModuleInfoByIndex(TInt aModuleIndex, TPositionModuleInfoBase& aModuleInfo) const;

TInt RPositionServer::GetModuleInfoById(TPositionModuleId aModuleId, TPositionModuleInfoBase& aModuleInfo) const;

TInt RPositionServer::GetModuleStatus(TPositionModuleStatusBase& aPosModuleStatus, TPositionModuleId aModuleId) const;

void RPositionServer::NotifyModuleStatusEvent(TPositionModuleStatusEventBase& aStatusEvent,TRequestStatus& aStatus,const TPositionModuleId aModuleId = KPositionNullModuleId) const;

TInt RPositioner::SetRequestor(CRequestor::TRequestorType aType,CRequestor::TRequestorFormat aFormat,const TDesC& aData);

TInt RPositioner::SetRequestor(const RRequestorStack& aRequestorStack);

TInt RPositioner::SetUpdateOptions(const TPositionUpdateOptionsBase& aPosOption);

TInt RPositioner::GetUpdateOptions(TPositionUpdateOptionsBase& aPosOption) const;

void RPositioner::GetLastKnownPosition(TPositionInfoBase& aPosInfo,TRequestStatus& aStatus) const;

void RPositioner::NotifyPositionUpdate(TPositionInfoBase& aPosInfo,TRequestStatus& aStatus) const;


#include <lbsposition.h>

Inherits TLocality.


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.


Public Member Functions

IMPORT_C  TPosition ()
  Default constructor for TCoordinate.
IMPORT_C  TPosition (const TLocality &aLocality, TTime aTime)
  Constructor for TPosition.
IMPORT_C void  SetTime (TTime aTime)
  Sets the time of this position data.
IMPORT_C void  SetCurrentTime ()
  Sets the time of this position data to the current universal time as indicated by the systems clock.
IMPORT_C TTime  Time () const
  Retrieves the time of this position data.
IMPORT_C TInt  Speed (const TPosition &aPosition, TReal32 &aSpeed) const
  This method calculates the horizontal speed between the current position and the supplied instance aPosition.
IMPORT_C TInt  Speed (const TPosition &aPosition, TReal32 &aSpeed, TReal32 &aDelta) const
  This method calculates the horizontal speed between the current position and the supplied instance aPosition.

Protected Attributes

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

Constructor & Destructor Documentation

IMPORT_C TPosition::TPosition  ) 
 

Default constructor for TCoordinate.

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

IMPORT_C TPosition::TPosition const TLocality aLocality,
TTime  aTime
 

Constructor for TPosition.

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

Parameters:
[in]  aLocality  specifies an initial value for the locality of the position.
aTime  specifies an initial value for the time of the position.

Member Function Documentation

IMPORT_C void TPosition::SetCurrentTime  ) 
 

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

IMPORT_C void TPosition::SetTime TTime  aTime  ) 
 

Sets the time of this position data.

Parameters:
aTime  is the new timing information.
IMPORT_C TInt TPosition::Speed 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:
[in]  aPosition  is another position to use in the calculation.
[out]  aSpeed  upon 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.
[out]  aDelta  upon successful completion, this is set to an estimate of the accuracy of the calculation, in metres per second.
Returns:
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.

IMPORT_C TInt TPosition::Speed 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:
[in]  aPosition  is another position to use in the calculation.
[out]  aSpeed  upon 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.
Returns:
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.

IMPORT_C TTime TPosition::Time  )  const
 

Retrieves the time of this position data.

Returns:
the timing component of this position information.

Field Documentation

TTime TPosition::iTime [protected]
 

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


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

Copyright © Nokia Corporation 2001-2008
Back to top