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 #endif
16 
17 namespace XmlRpc {
18 
19  // An RPC source represents a file descriptor to monitor
20  class XmlRpcSource;
21 
25  public:
28  ~XmlRpcDispatch();
29 
31  enum EventType {
32  ReadableEvent = 1,
33  WritableEvent = 2,
34  Exception = 4
35  };
36 
41  void addSource(XmlRpcSource* source, unsigned eventMask);
42 
45  void removeSource(XmlRpcSource* source);
46 
48  void setSourceEvents(XmlRpcSource* source, unsigned eventMask);
49 
50 
53  void work(double msTime);
54 
56  void exit();
57 
59  void clear();
60 
61  // helper returning current steady/monotonic time
62  double getTime();
63 
64  // A source to monitor and what to monitor it for
65  struct MonitoredSource {
66  MonitoredSource(XmlRpcSource* src, unsigned mask) : _src(src), _mask(mask) {}
67  XmlRpcSource* getSource() const { return _src; }
68  unsigned& getMask() { return _mask; }
70  unsigned _mask;
71  };
72 
73  // A list of sources to monitor
74  typedef std::list< MonitoredSource > SourceList;
75 
76  // Sources being monitored
77  SourceList _sources;
78  protected:
79 
80  // When work should stop (-1 implies wait forever, or until exit is called)
81  double _endTime;
82 
83  bool _doClear;
84  bool _inWork;
85 
86  };
87 } // namespace XmlRpc
88 
89 #endif // _XMLRPCDISPATCH_H_
Definition: XmlRpc.h:39
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 Nov 2 2020 03:52:24