class CTimer : public CActive |
Base class for a timer active object.
This is an active object that uses the asynchronous services provided by RTimer, to generate events. These events occur either at a specific time specified as a TTime, or after an interval specified in microseconds.
The RunL() virtual member function is called by the active scheduler after this event occurs.
To write a class derived from CTimer, first define and implement a constructor through which the priority of the CTimer active object can be specified. Then define and implement a suitable RunL() function to handle the completion of a timer request. This function is not defined by CTimer itself and must, therefore, be provided by the derived class.
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 CPeriodic and CHeartbeat classes are derived from CTimer, and answer most timing needs.
Public Member Functions | |
---|---|
~CTimer() | |
IMPORT_C void | After(TTimeIntervalMicroSeconds32) |
IMPORT_C void | At(const TTime &) |
IMPORT_C void | AtUTC(const TTime &) |
IMPORT_C void | HighRes(TTimeIntervalMicroSeconds32) |
IMPORT_C void | Inactivity(TTimeIntervalSeconds) |
IMPORT_C void | Lock(TTimerLockSpec) |
Protected Member Functions | |
---|---|
CTimer(TInt) | |
IMPORT_C void | ConstructL() |
IMPORT_C void | DoCancel() |
Inherited Enumerations | |
---|---|
CActive:TPriority |
Private Attributes | |
---|---|
RTimer | iTimer |
Inherited Attributes | |
---|---|
CActive::iStatus |
IMPORT_C void | After | ( | TTimeIntervalMicroSeconds32 | anInterval | ) |
TTimeIntervalMicroSeconds32 anInterval |
IMPORT_C void | DoCancel | ( | ) | [protected, virtual] |
Implements cancellation of an outstanding request.
This function is called as part of the active object's Cancel().
It must call the appropriate cancel function offered by the active object's asynchronous service provider. The asynchronous service provider's cancel is expected to act immediately.
DoCancel() must not wait for event completion; this is handled by Cancel().
IMPORT_C void | HighRes | ( | TTimeIntervalMicroSeconds32 | aInterval | ) |
TTimeIntervalMicroSeconds32 aInterval |
IMPORT_C void | Inactivity | ( | TTimeIntervalSeconds | aSeconds | ) |
TTimeIntervalSeconds aSeconds |