|
OverSim
|
An object which monitors file descriptors for events and performs callbacks when interesting events happen. More...
#include <XmlRpcDispatch.h>
Classes | |
| struct | MonitoredSource |
Public Types | |
| enum | EventType { ReadableEvent = 1, WritableEvent = 2, Exception = 4 } |
| Values indicating the type of events a source is interested in. More... | |
Public Member Functions | |
| XmlRpcDispatch () | |
| Constructor. | |
| ~XmlRpcDispatch () | |
| void | addSource (XmlRpcSource *source, unsigned eventMask) |
| Monitor this source for the event types specified by the event mask and call its event handler when any of the events occur. | |
| void | removeSource (XmlRpcSource *source) |
| Stop monitoring this source. | |
| void | setSourceEvents (XmlRpcSource *source, unsigned eventMask) |
| Modify the types of events to watch for on this source. | |
| void | work (double msTime) |
| Watch current set of sources and process events for the specified duration (in ms, -1 implies wait forever, or until exit is called) | |
| void | exit () |
| Exit from work routine. | |
| void | clear () |
| Clear all sources from the monitored sources list. Sources are closed. | |
Protected Types | |
| typedef std::list < MonitoredSource > | SourceList |
Protected Member Functions | |
| bool | waitForAndProcessEvents (double timeout) |
| Wait for I/O on any source, timeout, or interrupt signal. | |
| double | getTime () |
Protected Attributes | |
| SourceList | _sources |
| double | _endTime |
| bool | _doClear |
| bool | _inWork |
An object which monitors file descriptors for events and performs callbacks when interesting events happen.
Definition at line 28 of file XmlRpcDispatch.h.
|
protected |
Definition at line 85 of file XmlRpcDispatch.h.
Values indicating the type of events a source is interested in.
| ReadableEvent |
data available to read |
| WritableEvent |
connected/data can be written without blocking |
| Exception |
uh oh |
Definition at line 35 of file XmlRpcDispatch.h.
| XmlRpcDispatch::XmlRpcDispatch | ( | ) |
Constructor.
Definition at line 35 of file XmlRpcDispatch.cc.
| XmlRpcDispatch::~XmlRpcDispatch | ( | ) |
Definition at line 43 of file XmlRpcDispatch.cc.
| void XmlRpcDispatch::addSource | ( | XmlRpcSource * | source, |
| unsigned | eventMask | ||
| ) |
Monitor this source for the event types specified by the event mask and call its event handler when any of the events occur.
| source | The source to monitor |
| eventMask | Which event types to watch for. |
Definition at line 50 of file XmlRpcDispatch.cc.
Referenced by XmlRpc::XmlRpcServer::bindAndListen(), and XmlRpc::XmlRpcServer::dispatchConnection().
| void XmlRpcDispatch::clear | ( | ) |
Clear all sources from the monitored sources list. Sources are closed.
Definition at line 149 of file XmlRpcDispatch.cc.
Referenced by XmlRpc::XmlRpcServer::shutdown().
| void XmlRpcDispatch::exit | ( | ) |
Exit from work routine.
Definition at line 141 of file XmlRpcDispatch.cc.
Referenced by XmlRpc::XmlRpcServer::exit().
|
protected |
Definition at line 165 of file XmlRpcDispatch.cc.
Referenced by work().
| void XmlRpcDispatch::removeSource | ( | XmlRpcSource * | source | ) |
Stop monitoring this source.
| source | The source to stop monitoring The source socket is not closed. |
Definition at line 57 of file XmlRpcDispatch.cc.
Referenced by XmlRpc::XmlRpcServer::removeConnection().
| void XmlRpcDispatch::setSourceEvents | ( | XmlRpcSource * | source, |
| unsigned | eventMask | ||
| ) |
Modify the types of events to watch for on this source.
Definition at line 70 of file XmlRpcDispatch.cc.
|
protected |
Wait for I/O on any source, timeout, or interrupt signal.
Definition at line 185 of file XmlRpcDispatch.cc.
Referenced by work().
| void XmlRpcDispatch::work | ( | double | msTime | ) |
Watch current set of sources and process events for the specified duration (in ms, -1 implies wait forever, or until exit is called)
Definition at line 84 of file XmlRpcDispatch.cc.
Referenced by XmlRpc::XmlRpcServer::work().
|
protected |
Definition at line 93 of file XmlRpcDispatch.h.
Referenced by clear(), work(), and XmlRpcDispatch().
|
protected |
Definition at line 91 of file XmlRpcDispatch.h.
Referenced by exit(), waitForAndProcessEvents(), work(), and XmlRpcDispatch().
|
protected |
Definition at line 94 of file XmlRpcDispatch.h.
Referenced by clear(), work(), and XmlRpcDispatch().
|
protected |
Definition at line 88 of file XmlRpcDispatch.h.
Referenced by addSource(), clear(), removeSource(), setSourceEvents(), waitForAndProcessEvents(), and work().