Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

OW32::CIoTimeoutManager Class Reference

An I/O timeout manager. More...

#include <IoTimeoutManager.h>

Inheritance diagram for OW32::CIoTimeoutManager:

OW32::CIOCPIoTimeoutManager List of all members.

Public Member Functions

 CIoTimeoutManager ()
 Do nothing c'tor.
virtual ~CIoTimeoutManager ()
 Virtual d'tor as this is a base class.
virtual bool addTimeout (CIoTimeoutCallback *pCallback, LPVOID key, __int64 after, bool *fUpdated=NULL)=0
 Add a timeout.
virtual bool updateTimeout (CIoTimeoutCallback *pCallback, LPVOID key, __int64 after, bool *fUpdated=NULL)=0
 Update a previously added timeout.
virtual bool removeTimeout (LPVOID key)=0
 Remove a previously added timeout.
virtual void drainTimeouts (CIoTimeoutDrainCallback *pCallback)=0
 Drain timeouts, potentially using a predicate function.
virtual bool shutdown ()=0
 Shutdown the timeout manager.

Detailed Description

An I/O timeout manager.


Member Function Documentation

virtual bool OW32::CIoTimeoutManager::addTimeout CIoTimeoutCallback pCallback,
LPVOID  key,
__int64  after,
bool *  fUpdated = NULL
[pure virtual]
 

Add a timeout.

The timeout object must implement #CIoTimeoutCallback, and the onTimeout function will be called after the specified time.

If the key exists, the timeout for the existing object will be updated to expire after the given interval.

Parameters:
pCallback The callback function
key Key for passing to the callback function and for use during removeTimeout.
after The timeout, in 100ns units.
fUpdated Output - true if the timeout was updated, false otherwise.
Returns:
true if successful, false if not. GetLastError returns the error code in the failure case.

Implemented in OW32::CIOCPIoTimeoutManager.

virtual void OW32::CIoTimeoutManager::drainTimeouts CIoTimeoutDrainCallback pCallback  )  [pure virtual]
 

Drain timeouts, potentially using a predicate function.

This function can be used to clear the timeout queue before shutdown if necessary. It is also possible to conditionally drain timeouts. Timeouts are removed if the predicate function returns true.

Parameters:
pCallback An object implementing the predicate function interface

Implemented in OW32::CIOCPIoTimeoutManager.

virtual bool OW32::CIoTimeoutManager::removeTimeout LPVOID  key  )  [pure virtual]
 

Remove a previously added timeout.

Parameters:
key The key passed to addTimeout()
Returns:
true if the timeout was removed, false if it could not be found (already triggered or removed)

Implemented in OW32::CIOCPIoTimeoutManager.

virtual bool OW32::CIoTimeoutManager::shutdown  )  [pure virtual]
 

Shutdown the timeout manager.

Returns:
true for success, false for failure (see GetLastError)

Implemented in OW32::CIOCPIoTimeoutManager.

virtual bool OW32::CIoTimeoutManager::updateTimeout CIoTimeoutCallback pCallback,
LPVOID  key,
__int64  after,
bool *  fUpdated = NULL
[pure virtual]
 

Update a previously added timeout.

Parameters:
pCallback The new callback function
key The existing key
after The new time to expire after
fUpdated Optional output - true if the timeout was updated, false otherwise.
Returns:
true if successful, false if not. GetLastError returns the error code in the failure case.

Implemented in OW32::CIOCPIoTimeoutManager.


The documentation for this class was generated from the following file:
Generated on Sun Jun 5 01:29:25 2005 for OW32 by  doxygen 1.3.9.1