Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
RTimer Class Reference

Asynchronous timer services. More...

#include <e32std.h>

Inheritance diagram for RTimer:
RHandleBase

Public Member Functions

IMPORT_C TInt CreateLocal ()
 Creates a thread-relative timer.
 
IMPORT_C void Cancel ()
 Cancels any outstanding request for a timer event.
 
IMPORT_C void After (TRequestStatus &aStatus, TTimeIntervalMicroSeconds32 anInterval)
 Requests an event after the specified interval.
 
IMPORT_C void AfterTicks (TRequestStatus &aStatus, TInt aTicks)
 Requests an event after the specified interval.
 
IMPORT_C void At (TRequestStatus &aStatus, const TTime &aTime)
 Requests an event at a given system time (in the current time zone).
 
IMPORT_C void AtUTC (TRequestStatus &aStatus, const TTime &aUTCTime)
 Requests an event at a given UTC time.
 
IMPORT_C void Lock (TRequestStatus &aStatus, TTimerLockSpec aLock)
 Requests an event on a specified second fraction.
 
IMPORT_C void Inactivity (TRequestStatus &aStatus, TTimeIntervalSeconds aSeconds)
 Requests an event to be triggered when aSeconds is exactly, (ie not greater or less than), the time elapsed (to the nearest second) since the last user activity.
 
IMPORT_C void HighRes (TRequestStatus &aStatus, TTimeIntervalMicroSeconds32 anInterval)
 Requests an event after the specified interval to a resolution of 1ms.
 
IMPORT_C void AgainHighRes (TRequestStatus &aStatus, TTimeIntervalMicroSeconds32 anInterval)
 
- Public Member Functions inherited from RHandleBase
 RHandleBase ()
 Default constructor.
 
TInt Handle () const
 Retrieves the handle-number of the object associated with this handle.
 
void SetHandle (TInt aHandle)
 Sets the handle-number of this handle to the specified value.
 
TInt SetReturnedHandle (TInt aHandleOrError)
 Sets the handle-number of this handle to the specified value.
 
IMPORT_C void Close ()
 Closes the handle.
 
IMPORT_C TName Name () const
 Gets the name of the handle.
 
IMPORT_C TFullName FullName () const
 Gets the full name of the handle.
 
IMPORT_C void FullName (TDes &aName) const
 Gets the full name of the handle.
 
IMPORT_C void SetHandleNC (TInt aHandle)
 Sets the handle-number of this handle to the specified value, and marks it as not closable.
 
IMPORT_C TInt Duplicate (const RThread &aSrc, TOwnerType aType=EOwnerProcess)
 Creates a valid handle to the kernel object for which the specified thread already has a handle.
 
IMPORT_C void HandleInfo (THandleInfo *anInfo)
 Gets information about the handle.
 
IMPORT_C TUint Attributes () const
 
IMPORT_C TInt BTraceId () const
 Returns a unique object identifier for use with BTrace.
 
IMPORT_C void NotifyDestruction (TRequestStatus &aStatus)
 Internal technology API.
 

Additional Inherited Members

- Public Types inherited from RHandleBase
enum  TAttributes { EReadAccess =0x1 , EWriteAccess =0x2 , EDirectReadAccess =0x4 , EDirectWriteAccess =0x8 }
 Read/Write attributes for the handle. More...
 
- Static Public Member Functions inherited from RHandleBase
static void DoExtendedClose ()
 
- Protected Member Functions inherited from RHandleBase
 RHandleBase (TInt aHandle)
 Copy constructor.
 
IMPORT_C TInt Open (const TFindHandleBase &aHandle, TOwnerType aType)
 Opens a handle to a kernel side object found using a find-handle object.
 
TInt OpenByName (const TDesC &aName, TOwnerType aOwnerType, TInt aObjectType)
 Implementation for RXxxxx::Open/OpenGlocbal(const TDesC &aName,,TOwnerType aType) functions.
 
- Static Protected Member Functions inherited from RHandleBase
static TInt SetReturnedHandle (TInt aHandleOrError, RHandleBase &aHandle)
 
- Protected Attributes inherited from RHandleBase
TInt iHandle
 

Detailed Description

Asynchronous timer services.

Five types of asynchronous request are supported by the class:

  1. Requesting an event after a specified interval
  2. Requesting an event at a specified system time
  3. Requesting a timer event on a specific second fraction
  4. Requesting an event if an interval elapses with no user activity.
  5. Requesting an event after a specified interval, to a resolution of 1ms.

Each of these requests can be cancelled.

The timer exists from its creation, following a call to RTimer::CreateLocal(), until it is destroyed by a call to the Close() member function of the base class RHandleBase.

This class is ultimately implemented in terms of the nanokernel tick, and therefore the granularity of the generated events is limited to the period of this timer. This is variant specific, but is usually 1 millisecond.

Note that the CTimer active object uses an RTimer.

API status
Published to all clients. Released API.

Definition at line 3306 of file e32std.h.

Member Function Documentation

◆ After()

IMPORT_C void RTimer::After ( TRequestStatus &  aStatus,
TTimeIntervalMicroSeconds32  anInterval 
)

Requests an event after the specified interval.

The counter for this type of request stops during power-down. A 5 second timer will complete late if, for example, the machine is turned off 2 seconds after the request is made.

Parameters
aStatusOn completion, contains the status of the request. This is KErrNone if the timer completed normally at the requested time, otherwise another of the system-wide error codes.
anIntervalThe time interval, in microseconds, after which an event is to occur.

Panic condition: USER 87, if aInterval is negative.

Panic condition: KERN-EXEC 15, if this function is called while a request for a timer event is still outstanding.

(generated from Symbian Developer Library)

◆ AfterTicks()

IMPORT_C void RTimer::AfterTicks ( TRequestStatus &  aStatus,
TInt  aTicks 
)

Requests an event after the specified interval.

The counter for this type of request stops during power-down. A 5 tick timer will complete late if, for example, the machine is turned off 2 ticks after the request is made.

Parameters
aStatusOn completion, contains the status of the request. This is KErrNone if the timer completed normally at the requested time, otherwise another of the system-wide error codes.
aTicksThe time interval, in system ticks, after which an event is to occur.

Panic condition: USER 87, if aTicks is negative.

Panic condition: KERN-EXEC 15, if this function is called while a request for a timer event is still outstanding.

(generated from Symbian Developer Library)

◆ AgainHighRes()

IMPORT_C void RTimer::AgainHighRes ( TRequestStatus &  aStatus,
TTimeIntervalMicroSeconds32  anInterval 
)

◆ At()

IMPORT_C void RTimer::At ( TRequestStatus &  aStatus,
const TTime &  aTime 
)

Requests an event at a given system time (in the current time zone).

If the machine is off at that time, it is automatically turned on.

Parameters
aStatusOn completion, contains the status of the request: KErrNone, the timer completed normally at the requested time; KErrCancel, the timer was cancelled; KErrAbort, the timer was aborted because the system time changed; KErrUnderflow, the requested completion time is in the past; KErrOverFlow, the requested completion time is too far in the future;
aTimeThe time at which the timer will expire.

Panic condition: KERN-EXEC 15, if this function is called while a request for a timer event is still outstanding.

(generated from Symbian Developer Library)

◆ AtUTC()

IMPORT_C void RTimer::AtUTC ( TRequestStatus &  aStatus,
const TTime &  aUTCTime 
)

Requests an event at a given UTC time.

If the machine is off at that time, it is automatically turned on.

Parameters
aUTCTimeThe absolute UTC time at which the request should complete.
aStatusOn completion, contains the status of the request: KErrNone, the timer completed normally at the requested time; KErrCancel, the timer was cancelled; KErrAbort, the timer was aborted because the system time changed; KErrUnderflow, the requested completion time is in the past; KErrOverFlow, the requested completion time is too far in the future;

Panic condition: KERN-EXEC 15, if this function is called while a request for a timer event is still outstanding.

(generated from Symbian Developer Library)

◆ Cancel()

IMPORT_C void RTimer::Cancel ( )

Cancels any outstanding request for a timer event.

Any outstanding timer event completes with KErrCancel.

(generated from Symbian Developer Library)

◆ CreateLocal()

IMPORT_C TInt RTimer::CreateLocal ( )

Creates a thread-relative timer.

(generated from Symbian Developer Library)

◆ HighRes()

IMPORT_C void RTimer::HighRes ( TRequestStatus &  aStatus,
TTimeIntervalMicroSeconds32  anInterval 
)

Requests an event after the specified interval to a resolution of 1ms.

The "HighRes timer" counter stops during power-down (the same as "after timer").

Parameters
aStatusOn completion, contains the status of the request. This is KErrNone if the timer completed normally at the requested time, otherwise another of the system-wide error codes.
anIntervalThe time interval, in microseconds, after which an event is to occur.

Panic condition: USER 87, if aInterval is negative.

Panic condition: KERN-EXEC 15, if this function is called while a request for a timer event is still outstanding.

(generated from Symbian Developer Library)

◆ Inactivity()

IMPORT_C void RTimer::Inactivity ( TRequestStatus &  aStatus,
TTimeIntervalSeconds  aSeconds 
)

Requests an event to be triggered when aSeconds is exactly, (ie not greater or less than), the time elapsed (to the nearest second) since the last user activity.

If the event trigger time has been "missed", instead of triggering late, the timer waits for the next user activity, to try and satisfy the condition.

That is to say, if there was user activity within the last aSeconds, the event will be triggered after aSeconds of continuous inactivity following that activity. Otherwise, if there has been no such activity within this time, an event is triggered after aSeconds of continuous inactivity following the next user activity in the future.

It follows from this, that you can request an event directly after the next user activity by supplying a time interval of zero.

Parameters
aStatusOn completion, contains the status of the request: KErrNone, the timer completed normally; KErrCancel, the timer was cancelled; KErrArgument, if aSeconds is less then zero; KErrOverflow, if aSecond reaches its limit (which is platform specific but greater then one and a half day).
aSecondsThe time interval in seconds.

Panic condition: KERN-EXEC 15, if this function is called while a request for a timer event is still outstanding.

(generated from Symbian Developer Library)

◆ Lock()

IMPORT_C void RTimer::Lock ( TRequestStatus &  aStatus,
TTimerLockSpec  aLock 
)

Requests an event on a specified second fraction.

Parameters
aStatusOn completion, contains the status of the request: KErrGeneral, the first time this is called; KErrNone, the timer completed normally at the requested time; KErrCancel, the timer was cancelled; KErrAbort, the timer was aborted because the system time changed; KErrUnderflow, the requested completion time is in the past; KErrOverFlow, the requested completion time is too far in the future.
aLockThe fraction of a second at which the timer completes.

Panic condition: KERN-EXEC 15, if this function is called while a request for a timer event is still outstanding.

(generated from Symbian Developer Library)


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