XmlRpcDispatch.h
Go to the documentation of this file.
1 
2 #ifndef _XMLRPCDISPATCH_H_
3 #define _XMLRPCDISPATCH_H_
4 //
5 // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
6 //
7 #if defined(_MSC_VER)
8 # pragma warning(disable:4786) // identifier was truncated in debug info
9 #endif
10 
11 #include "xmlrpcpp/XmlRpcDecl.h"
12 
13 #ifndef MAKEDEPEND
14 # include <list>
15 # include <vector>
16 #endif
17 
18 namespace XmlRpc {
19 
20  // An RPC source represents a file descriptor to monitor
21  class XmlRpcSource;
22 
26  public:
29  ~XmlRpcDispatch();
30 
32  enum EventType {
33  ReadableEvent = 1,
34  WritableEvent = 2,
35  Exception = 4
36  };
37 
42  void addSource(XmlRpcSource* source, unsigned eventMask);
43 
46  void removeSource(XmlRpcSource* source);
47 
49  void setSourceEvents(XmlRpcSource* source, unsigned eventMask);
50 
51 
54  void work(double msTime);
55 
57  void exit();
58 
60  void clear();
61 
62  // helper returning current steady/monotonic time
63  double getTime();
64 
65  // A source to monitor and what to monitor it for
66  struct MonitoredSource {
67  MonitoredSource(XmlRpcSource* src, unsigned mask) : _src(src), _mask(mask) {}
68  XmlRpcSource* getSource() const { return _src; }
69  unsigned& getMask() { return _mask; }
71  unsigned _mask;
72  };
73 
74  // A list of sources to monitor
75  typedef std::list< MonitoredSource > SourceList;
76 
77  // Sources being monitored
79  protected:
80 
81  // When work should stop (-1 implies wait forever, or until exit is called)
82  double _endTime;
83 
84  bool _doClear;
85  bool _inWork;
86 
87  };
88 } // namespace XmlRpc
89 
90 #endif // _XMLRPCDISPATCH_H_
XmlRpc::XmlRpcDispatch::MonitoredSource::_src
XmlRpcSource * _src
Definition: XmlRpcDispatch.h:70
XmlRpc::XmlRpcDispatch::_endTime
double _endTime
Definition: XmlRpcDispatch.h:82
XmlRpc
Definition: XmlRpcClient.h:20
XmlRpc::XmlRpcDispatch::SourceList
std::list< MonitoredSource > SourceList
Definition: XmlRpcDispatch.h:75
XmlRpcDecl.h
XmlRpc::XmlRpcSource
An RPC source represents a file descriptor to monitor.
Definition: XmlRpcSource.h:16
XmlRpc::XmlRpcDispatch
Definition: XmlRpcDispatch.h:25
XmlRpc::XmlRpcDispatch::MonitoredSource::getMask
unsigned & getMask()
Definition: XmlRpcDispatch.h:69
XmlRpc::XmlRpcDispatch::MonitoredSource::getSource
XmlRpcSource * getSource() const
Definition: XmlRpcDispatch.h:68
XmlRpc::XmlRpcDispatch::_sources
SourceList _sources
Definition: XmlRpcDispatch.h:78
XmlRpc::XmlRpcDispatch::MonitoredSource::_mask
unsigned _mask
Definition: XmlRpcDispatch.h:71
XmlRpc::XmlRpcDispatch::MonitoredSource::MonitoredSource
MonitoredSource(XmlRpcSource *src, unsigned mask)
Definition: XmlRpcDispatch.h:67
XmlRpc::XmlRpcDispatch::_doClear
bool _doClear
Definition: XmlRpcDispatch.h:84
XmlRpc::XmlRpcDispatch::MonitoredSource
Definition: XmlRpcDispatch.h:66
XMLRPCPP_DECL
#define XMLRPCPP_DECL
Definition: XmlRpcDecl.h:52
XmlRpc::XmlRpcDispatch::_inWork
bool _inWork
Definition: XmlRpcDispatch.h:85
XmlRpc::XmlRpcDispatch::EventType
EventType
Values indicating the type of events a source is interested in.
Definition: XmlRpcDispatch.h:32


xmlrpcpp
Author(s): Chris Morley, Konstantin Pilipchuk, Morgan Quigley, Austin Hendrix, Dirk Thomas
autogenerated on Sat Oct 17 2020 19:28:46