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
78  SourceList _sources;
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_
EventType
Values indicating the type of events a source is interested in.
An RPC source represents a file descriptor to monitor.
Definition: XmlRpcSource.h:16
#define XMLRPCPP_DECL
Definition: XmlRpcDecl.h:52
MonitoredSource(XmlRpcSource *src, unsigned mask)
std::list< MonitoredSource > SourceList


xmlrpcpp
Author(s): Chris Morley, Konstantin Pilipchuk, Morgan Quigley, Austin Hendrix, Dirk Thomas
autogenerated on Mon Feb 28 2022 23:33:22