#include <Dispatcher.h>
Inherits qpid::sys::PollerHandle.
Inherited by qpid::sys::AsynchConnector [private]
, and qpid::sys::AsynchIO [private]
.
Public Types | |
typedef boost::function1< void, DispatchHandle & > | Callback |
Public Member Functions | |
DispatchHandle (const IOHandle &h, Callback rCb, Callback wCb, Callback dCb) | |
Provide a handle to poll and a set of callbacks. | |
void | startWatch (Poller::shared_ptr poller) |
Add this DispatchHandle to the poller to be watched. | |
void | rewatch () |
Resume watchingn for all non-0 callbacks. | |
void | rewatchRead () |
Resume watchingn for read only. | |
void | rewatchWrite () |
Resume watchingn for write only. | |
void | unwatch () |
Stop watching temporarily. | |
void | unwatchRead () |
Stop watching for read. | |
void | unwatchWrite () |
Stop watching for write. | |
void | stopWatch () |
Stop watching permanently. | |
Protected Member Functions | |
void | doDelete () |
Override to get extra processing done when the DispatchHandle is deleted. |
When an event occurs on the handle, the poller calls the relevant callback and stops watching that handle. Your callback can call rewatch() or related functions to re-enable polling.
Definition at line 57 of file Dispatcher.h.
qpid::sys::DispatchHandle::DispatchHandle | ( | const IOHandle & | h, | |
Callback | rCb, | |||
Callback | wCb, | |||
Callback | dCb | |||
) | [inline] |
Provide a handle to poll and a set of callbacks.
Note callbacks can be 0, meaning you are not interested in that event.
h,: | the handle to watch. The IOHandle encapsulates a platfrom-specific handle to an IO object (e.g. a file descriptor on Unix.) | |
rCb | Callback called when the handle is readable. | |
wCb | Callback called when the handle is writable. | |
dCb | Callback called when the handle is disconnected. |
Definition at line 87 of file Dispatcher.h.
void qpid::sys::DispatchHandle::startWatch | ( | Poller::shared_ptr | poller | ) |
Add this DispatchHandle to the poller to be watched.
Referenced by qpid::sys::PollableQueue< T >::PollableQueue().
void qpid::sys::DispatchHandle::rewatch | ( | ) |
void qpid::sys::DispatchHandle::rewatchRead | ( | ) |
Resume watchingn for read only.
void qpid::sys::DispatchHandle::rewatchWrite | ( | ) |
Resume watchingn for write only.
void qpid::sys::DispatchHandle::unwatch | ( | ) |
Stop watching temporarily.
The DispatchHandle remains associated with the poller and can be re-activated using rewatch.
Referenced by qpid::sys::PollableQueue< T >::PollableQueue(), and qpid::sys::PollableQueue< T >::stop().
void qpid::sys::DispatchHandle::stopWatch | ( | ) |
Stop watching permanently.
Disassociates from the poller.
void qpid::sys::DispatchHandle::doDelete | ( | ) | [protected] |
Override to get extra processing done when the DispatchHandle is deleted.