

Public Types | |
| typedef ULONG_PTR * | TimeoutHandle |
| A handle to a timer that has been timed out. This can be passed to HandleTimeout() and EndTimeoutHandling() and is obtained by calling BeginTimeoutHandling(). | |
| typedef ULONG_PTR | UserData |
| User data that can be passed to Timer via the OnTimer() call when the timeout expires. | |
| typedef ULONG_PTR | Handle |
| A handle to a timer that has been created. This can be passed to SetTimer(), CancelTimer() and DestroyTimer() and is created with CreateTimer(). | |
Public Member Functions | |
| CCallbackTimerQueueEx () | |
| Create a timer queue. | |
| CCallbackTimerQueueEx (const IProvideTickCount64 &tickProvider) | |
| Create a timer queue that uses the provdided instance of IProvideTickCount64 to obtain its tick counts rather than getting them directly from the system. | |
| virtual | ~CCallbackTimerQueueEx () |
| virtual Milliseconds | GetNextTimeout () |
| Get the number of milliseconds until the next timer is due to fire. Or INFINITE if no timer is set. | |
| virtual void | HandleTimeouts () |
| Process any timers that have timed out. Note that in an implementation that is safe for use in a multi-threaded situation it is acceptable to hold a lock whilst this method is called to prevent concurrent calls to any of the methods on IQueueTimers. | |
| virtual IManageTimerQueue::TimeoutHandle | BeginTimeoutHandling () |
| Returns the handle of a timer than needs to be handled, or InvalidTimeoutHandleValue if no timers currenly need to be handled. Note that in an implementation that is safe for use in a multi-threaded situation it is acceptable to hold a lock whilst this method is called to prevent concurrent calls to any of the methods on IQueueTimers. | |
| virtual void | HandleTimeout (IManageTimerQueue::TimeoutHandle &handle) |
| Handle the timeout for the given timer handle. Note that in an implementation that is safe for use in a multi-threaded situation it is NOT acceptable to hold a lock that will prevent concurrent calls to any of the methods on IQueueTimers. | |
| virtual void | EndTimeoutHandling (IManageTimerQueue::TimeoutHandle &handle) |
| Complete the handling of a timeout that was started with BeginTimeoutHandling(). Note that in an implementation that is safe for use in a multi-threaded situation it is acceptable to hold a lock whilst this method is called to prevent concurrent calls to any of the methods on IQueueTimers. | |
| virtual IQueueTimers::Handle | CreateTimer () |
| Create a timer and return a Handle to it. | |
| virtual bool | SetTimer (const IQueueTimers::Handle &handle, IQueueTimers::Timer &timer, const Milliseconds timeout, const IQueueTimers::UserData userData) |
| Set a timer that was previously created with CreateTimer(). Returns true if the timer was previously pending for another timeout and false if the timer was not already pending. Note that calling SetTimer() will cause any timers that have expired to be processed before the new timer is set. | |
| virtual void | SetTimer (IQueueTimers::Timer &timer, const Milliseconds timeout, const IQueueTimers::UserData userData) |
| Create and set a single use timer. Note that calling SetTimer() will cause any timers that have expired to be processed before the new timer is set. | |
| virtual bool | CancelTimer (const IQueueTimers::Handle &handle) |
| Cancel a timer that was previously set with SetTimer(). Returns true if the timer was pending and false if the timer was not pending. | |
| virtual bool | DestroyTimer (IQueueTimers::Handle &handle) |
| Destroy a timer that was previously created with CreateTimer() and update the variable passed in to contain InvalidHandleValue. Note that it is not permitted to call DestroyHandle() on a handle that contains the InvalidHandleValue value and an exception is thrown in this case. Returns true if the timer was pending and false if the timer was not pending. | |
| virtual bool | DestroyTimer (const IQueueTimers::Handle &handle) |
| Destroy a timer that was previously created with CreateTimer(). Returns true if the timer was pending and false if the timer was not pending. | |
| virtual Milliseconds | GetMaximumTimeout () const |
| Returns the maximum timeout value that can be set. Note that this may differ between instances of the objects that implement this interface. | |
| virtual bool | DispatchesWithoutLock () const |
| Returns true if the queue dispatches timers without holding an internal lock which it also requires to manipulate timers. | |
Static Public Attributes | |
| static TimeoutHandle | InvalidTimeoutHandleValue = 0 |
| The value that represents an invalid handle that cannot be used. | |
| static Handle | InvalidHandleValue = 0 |
| The value that represents an invalid handle that cannot be used. | |
Protected Member Functions | |
| bool | SetInternalTimer (const IQueueTimers::Handle &handle, IQueueTimers::Timer &timer, const ULONGLONG absoluteTimeout) |
typedef ULONG_PTR* TimeoutHandle [inherited] |
A handle to a timer that has been timed out. This can be passed to HandleTimeout() and EndTimeoutHandling() and is obtained by calling BeginTimeoutHandling().
typedef ULONG_PTR UserData [inherited] |
User data that can be passed to Timer via the OnTimer() call when the timeout expires.
typedef ULONG_PTR Handle [inherited] |
A handle to a timer that has been created. This can be passed to SetTimer(), CancelTimer() and DestroyTimer() and is created with CreateTimer().
Create a timer queue.
| CCallbackTimerQueueEx | ( | const IProvideTickCount64 & | tickProvider | ) | [explicit] |
Create a timer queue that uses the provdided instance of IProvideTickCount64 to obtain its tick counts rather than getting them directly from the system.
| ~CCallbackTimerQueueEx | ( | ) | [virtual] |
| Milliseconds GetNextTimeout | ( | ) | [virtual, inherited] |
Get the number of milliseconds until the next timer is due to fire. Or INFINITE if no timer is set.
Implements IManageTimerQueue.
| void HandleTimeouts | ( | ) | [virtual, inherited] |
Process any timers that have timed out. Note that in an implementation that is safe for use in a multi-threaded situation it is acceptable to hold a lock whilst this method is called to prevent concurrent calls to any of the methods on IQueueTimers.
Implements IManageTimerQueue.
| IManageTimerQueue::TimeoutHandle BeginTimeoutHandling | ( | ) | [virtual, inherited] |
Returns the handle of a timer than needs to be handled, or InvalidTimeoutHandleValue if no timers currenly need to be handled. Note that in an implementation that is safe for use in a multi-threaded situation it is acceptable to hold a lock whilst this method is called to prevent concurrent calls to any of the methods on IQueueTimers.
Implements IManageTimerQueue.
| void HandleTimeout | ( | IManageTimerQueue::TimeoutHandle & | handle | ) | [virtual, inherited] |
Handle the timeout for the given timer handle. Note that in an implementation that is safe for use in a multi-threaded situation it is NOT acceptable to hold a lock that will prevent concurrent calls to any of the methods on IQueueTimers.
Implements IManageTimerQueue.
| void EndTimeoutHandling | ( | IManageTimerQueue::TimeoutHandle & | handle | ) | [virtual, inherited] |
Complete the handling of a timeout that was started with BeginTimeoutHandling(). Note that in an implementation that is safe for use in a multi-threaded situation it is acceptable to hold a lock whilst this method is called to prevent concurrent calls to any of the methods on IQueueTimers.
Implements IManageTimerQueue.
| CCallbackTimerQueueBase::Handle CreateTimer | ( | ) | [virtual, inherited] |
| virtual bool SetTimer | ( | const IQueueTimers::Handle & | handle, | |
| IQueueTimers::Timer & | timer, | |||
| const Milliseconds | timeout, | |||
| const IQueueTimers::UserData | userData | |||
| ) | [virtual, inherited] |
Set a timer that was previously created with CreateTimer(). Returns true if the timer was previously pending for another timeout and false if the timer was not already pending. Note that calling SetTimer() will cause any timers that have expired to be processed before the new timer is set.
Implements IQueueTimers.
| virtual void SetTimer | ( | IQueueTimers::Timer & | timer, | |
| const Milliseconds | timeout, | |||
| const IQueueTimers::UserData | userData | |||
| ) | [virtual, inherited] |
Create and set a single use timer. Note that calling SetTimer() will cause any timers that have expired to be processed before the new timer is set.
Implements IQueueTimers.
| virtual bool CancelTimer | ( | const IQueueTimers::Handle & | handle | ) | [virtual, inherited] |
Cancel a timer that was previously set with SetTimer(). Returns true if the timer was pending and false if the timer was not pending.
Implements IQueueTimers.
| virtual bool DestroyTimer | ( | IQueueTimers::Handle & | handle | ) | [virtual, inherited] |
Destroy a timer that was previously created with CreateTimer() and update the variable passed in to contain InvalidHandleValue. Note that it is not permitted to call DestroyHandle() on a handle that contains the InvalidHandleValue value and an exception is thrown in this case. Returns true if the timer was pending and false if the timer was not pending.
Implements IQueueTimers.
| virtual bool DestroyTimer | ( | const IQueueTimers::Handle & | handle | ) | [virtual, inherited] |
Destroy a timer that was previously created with CreateTimer(). Returns true if the timer was pending and false if the timer was not pending.
Implements IQueueTimers.
| Milliseconds GetMaximumTimeout | ( | ) | const [virtual, inherited] |
Returns the maximum timeout value that can be set. Note that this may differ between instances of the objects that implement this interface.
Implements IQueueTimers.
| bool DispatchesWithoutLock | ( | ) | const [virtual, inherited] |
Returns true if the queue dispatches timers without holding an internal lock which it also requires to manipulate timers.
Implements IQueueTimers.
| bool SetInternalTimer | ( | const IQueueTimers::Handle & | handle, | |
| IQueueTimers::Timer & | timer, | |||
| const ULONGLONG | absoluteTimeout | |||
| ) | [protected, inherited] |
IManageTimerQueue::TimeoutHandle InvalidTimeoutHandleValue = 0 [static, inherited] |
The value that represents an invalid handle that cannot be used.
IQueueTimers::Handle InvalidHandleValue = 0 [static, inherited] |
The value that represents an invalid handle that cannot be used.
1.5.3