AsyncIOPoller Class Reference

A class that polls a set of AsyncIOTask objects. More...

#include <AsyncIOPoller.h++>

List of all members.

Public Member Functions

 AsyncIOPoller ()
 Construct a new AsyncIOPoller.
 ~AsyncIOPoller ()
 Destructor.
void addTask (AsyncIOTask *task)
 Register the specified AsyncIOTask with this poller.
void removeTask (AsyncIOTask *task)
 Unregister the specified AsyncIOTask from this poller.
void removeAllTasks ()
 Unregister all AsyncIOTask objects from this poller.
uint_t getTaskCount () const throw ()
 Get the number of tasks currently registered with this poller.
bool poll (timespan_ms_t timeout=0) throw ()
 Poll the AsyncIOTask objects registered with this poller.

Detailed Description

A class that polls a set of AsyncIOTask objects.

Author:
Mark Lindner

Constructor & Destructor Documentation

AsyncIOPoller (  ) 

Construct a new AsyncIOPoller.

~AsyncIOPoller (  ) 

Destructor.


Member Function Documentation

void addTask ( AsyncIOTask task  ) 

Register the specified AsyncIOTask with this poller.

The poller does not take ownership of the AsyncIOTask object.

Parameters:
task The task to register.
uint_t getTaskCount (  )  const throw ()

Get the number of tasks currently registered with this poller.

bool poll ( timespan_ms_t  timeout = 0  )  throw ()

Poll the AsyncIOTask objects registered with this poller.

The call blocks until at least one of the tasks is completed, or the timeout interval passes, whichever occurs first. There is no userspace latency imposed by this call.

Parameters:
timeout The timeout, in milliseconds. Negative values are interpreted as an infinite timeout.
Returns:
true if at least one of the asynchronous I/O tasks registered with this poller has completed, false otherwise.
void removeAllTasks (  ) 

Unregister all AsyncIOTask objects from this poller.

void removeTask ( AsyncIOTask task  ) 

Unregister the specified AsyncIOTask from this poller.

Parameters:
task The task to unregister.

The documentation for this class was generated from the following files:
Generated on Sat Nov 26 16:49:08 2011 for libcommonc++ by  doxygen 1.6.3