|
||
class RTimer : public RHandleBase;
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 RHandleBase::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.
RHandleBase
- A handle to an object.
RTimer
-
Asynchronous timer services.
Defined in RTimer
:
After(TRequestStatus &,TTimeIntervalMicroSeconds32)
Requests an event after the specified interval.AfterTicks(TRequestStatus &,TInt)
Requests an event after the specified interval.At(TRequestStatus &,const TTime &)
Requests an event at a given system time (in the current time zone).AtUTC(TRequestStatus &,const TTime &)
Requests an event at a given UTC time.Cancel()
Cancels any outstanding request for a timer event.CreateLocal()
Creates a thread-relative timer.HighRes(TRequestStatus &,TTimeIntervalMicroSeconds32)
Requests an event after the specified interval to a resolution of 1ms. The "...Inactivity(TRequestStatus &,TTimeIntervalSeconds)
Requests an event to be triggered when aSeconds is exactly, (ie not greater or l...Lock(TRequestStatus &,TTimerLockSpec)
Requests an event on a specified second fraction.Inherited from RHandleBase
:
Attributes()const
BTraceId()const
Returns a unique object identifier for use with BTrace
Close()
Closes the handle.Duplicate(const RThread &,TOwnerType)
Creates a valid handle to the kernel object for which the specified thread alrea...FullName()const
Gets the full name of the handle.FullName(TDes &)const
Gets the full name of the handle.Handle()const
Retrieves the handle-number of the object associated with this handle.HandleInfo(THandleInfo *)
Gets information about the handle.Name()const
Gets the name of the handle.Open(const TFindHandleBase &,TOwnerType)
Opens a handle to a kernel side object found using a find-handle object.RHandleBase(TInt)
Copy constructor.SetHandle(TInt)
Sets the handle-number of this handle to the specified value.SetHandleNC(TInt)
Sets the handle-number of this handle to the specified value, and marks it as no...SetReturnedHandle(TInt)
Sets the handle-number of this handle to the specified value.iHandle
IMPORT_C TInt CreateLocal();
Creates a thread-relative timer.
|
IMPORT_C void Cancel();
Cancels any outstanding request for a timer event.
Any outstanding timer event completes with KErrCancel.
IMPORT_C void 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.
|
|
IMPORT_C void 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.
|
|
IMPORT_C void 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.
|
|
IMPORT_C void 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.
|
|
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. 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.
|
|
IMPORT_C void 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").
|
|