CTimer Class Reference

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.

CHeartbeat

CPeriodic

CHeartbeat

Inherits from

Constructor & Destructor Documentation

CTimer(TInt)

IMPORT_CCTimer(TIntaPriority)[protected]

Parameters

TInt aPriority

~CTimer()

IMPORT_C~CTimer()

Member Functions Documentation

After(TTimeIntervalMicroSeconds32)

IMPORT_C voidAfter(TTimeIntervalMicroSeconds32anInterval)

Parameters

TTimeIntervalMicroSeconds32 anInterval

At(const TTime &)

IMPORT_C voidAt(const TTime &aTime)

Parameters

const TTime & aTime

AtUTC(const TTime &)

IMPORT_C voidAtUTC(const TTime &aTimeInUTC)

Parameters

const TTime & aTimeInUTC

ConstructL()

IMPORT_C voidConstructL()[protected]

DoCancel()

IMPORT_C voidDoCancel()[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().

CActive::Cancel

HighRes(TTimeIntervalMicroSeconds32)

IMPORT_C voidHighRes(TTimeIntervalMicroSeconds32aInterval)

Parameters

TTimeIntervalMicroSeconds32 aInterval

Inactivity(TTimeIntervalSeconds)

IMPORT_C voidInactivity(TTimeIntervalSecondsaSeconds)

Parameters

TTimeIntervalSeconds aSeconds

Lock(TTimerLockSpec)

IMPORT_C voidLock(TTimerLockSpecaLock)

Parameters

TTimerLockSpec aLock

Member Data Documentation

RTimer iTimer

RTimer iTimer[private]