IQueueTimers Class Reference
[Timer managementInterfacesProtected destructors on abstract base classes]

Inheritance diagram for IQueueTimers:

Inheritance graph
[legend]
Collaboration diagram for IQueueTimers:

Collaboration graph
[legend]

List of all members.


Detailed Description

An interface representing a class that manages timers that implement the IQueueTimers::Timer interface and and which have their IQueueTimers::Timer::OnTimer() method called when the the timer expires. See here for more details.

Public Types

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

virtual Handle CreateTimer ()=0
 Create a timer and return a Handle to it.
virtual bool SetTimer (const Handle &handle, Timer &timer, const Milliseconds timeout, const UserData userData)=0
 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 bool CancelTimer (const Handle &handle)=0
 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 (Handle &handle)=0
 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 Handle &handle)=0
 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 void SetTimer (Timer &timer, const Milliseconds timeout, const UserData userData)=0
 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 Milliseconds GetMaximumTimeout () const =0
 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 =0
 Returns true if the queue dispatches timers without holding an internal lock which it also requires to manipulate timers.

Static Public Attributes

static Handle InvalidHandleValue = 0
 The value that represents an invalid handle that cannot be used.

Protected Member Functions

 ~IQueueTimers ()
 We never delete instances of this interface; you must manage the lifetime of the class that implements it.

Classes

class  Timer
 An interface to a timer that can be set with IQueueTimers. More...

Member Typedef Documentation

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().


Constructor & Destructor Documentation

~IQueueTimers (  )  [inline, protected]

We never delete instances of this interface; you must manage the lifetime of the class that implements it.


Member Function Documentation

virtual Handle CreateTimer (  )  [pure virtual]

Create a timer and return a Handle to it.

Implemented in CCallbackTimerQueueBase, and CThreadedCallbackTimerQueue.

virtual bool SetTimer ( const Handle handle,
Timer timer,
const Milliseconds  timeout,
const UserData  userData 
) [pure virtual]

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.

Implemented in CCallbackTimerQueueBase, and CThreadedCallbackTimerQueue.

virtual bool CancelTimer ( const Handle handle  )  [pure virtual]

Cancel a timer that was previously set with SetTimer(). Returns true if the timer was pending and false if the timer was not pending.

Implemented in CCallbackTimerQueueBase, and CThreadedCallbackTimerQueue.

virtual bool DestroyTimer ( Handle handle  )  [pure virtual]

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.

Implemented in CCallbackTimerQueueBase, and CThreadedCallbackTimerQueue.

virtual bool DestroyTimer ( const Handle handle  )  [pure virtual]

Destroy a timer that was previously created with CreateTimer(). Returns true if the timer was pending and false if the timer was not pending.

Implemented in CCallbackTimerQueueBase, and CThreadedCallbackTimerQueue.

virtual void SetTimer ( Timer timer,
const Milliseconds  timeout,
const UserData  userData 
) [pure virtual]

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.

Implemented in CCallbackTimerQueueBase, and CThreadedCallbackTimerQueue.

virtual Milliseconds GetMaximumTimeout (  )  const [pure virtual]

Returns the maximum timeout value that can be set. Note that this may differ between instances of the objects that implement this interface.

Implemented in CCallbackTimerQueueBase, and CThreadedCallbackTimerQueue.

virtual bool DispatchesWithoutLock (  )  const [pure virtual]

Returns true if the queue dispatches timers without holding an internal lock which it also requires to manipulate timers.

Implemented in CCallbackTimerQueueBase, and CThreadedCallbackTimerQueue.


Member Data Documentation

IQueueTimers::Handle InvalidHandleValue = 0 [static]

The value that represents an invalid handle that cannot be used.


Generated on Thu Mar 26 16:40:35 2009 for JetByte Socket Tools - v6.0 by  doxygen 1.5.3