libcommonc++
0.7
|
A class that polls a set of AsyncIOTask objects. More...
#include <AsyncIOPoller.h++>
Public Member Functions | |
AsyncIOPoller () | |
Construct a new AsyncIOPoller. More... | |
~AsyncIOPoller () | |
Destructor. More... | |
void | addTask (AsyncIOTask *task) |
Register the specified AsyncIOTask with this poller. More... | |
void | removeTask (AsyncIOTask *task) |
Unregister the specified AsyncIOTask from this poller. More... | |
void | removeAllTasks () |
Unregister all AsyncIOTask objects from this poller. More... | |
uint_t | getTaskCount () const |
Get the number of tasks currently registered with this poller. More... | |
bool | poll (timespan_ms_t timeout=0) |
Poll the AsyncIOTask objects registered with this poller. More... | |
A class that polls a set of AsyncIOTask objects.
AsyncIOPoller | ( | ) |
Construct a new AsyncIOPoller.
~AsyncIOPoller | ( | ) |
Destructor.
void addTask | ( | AsyncIOTask * | task | ) |
Register the specified AsyncIOTask with this poller.
The poller does not take ownership of the AsyncIOTask object.
task | The task to register. |
uint_t getTaskCount | ( | ) | const |
Get the number of tasks currently registered with this poller.
bool poll | ( | timespan_ms_t | timeout = 0 | ) |
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.
timeout | The timeout, in milliseconds. Negative values are interpreted as an infinite timeout. |
void removeAllTasks | ( | ) |
Unregister all AsyncIOTask objects from this poller.
void removeTask | ( | AsyncIOTask * | task | ) |
Unregister the specified AsyncIOTask from this poller.
task | The task to unregister. |