XmlRpcServer.h
Go to the documentation of this file.
1 #include "sick_scan/sick_scan_base.h" /* Base definitions included in all header files, added by add_sick_scan_base_header.py. Do not edit this line. */
2 // this file modified by Morgan Quigley on 22 Apr 2008.
3 // added features: server can be opened on port 0 and you can read back
4 // what port the OS gave you
5 
6 #ifndef _XMLRPCSERVER_H_
7 #define _XMLRPCSERVER_H_
8 //
9 // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley
10 //
11 #if defined(_MSC_VER)
12 # pragma warning(disable:4786) // identifier was truncated in debug info
13 #endif
14 
15 #ifndef MAKEDEPEND
16 # include <map>
17 # include <string>
18 #endif
19 
20 #include "xmlrpcpp/XmlRpcDispatch.h"
21 #include "xmlrpcpp/XmlRpcSource.h"
22 #include "xmlrpcpp/XmlRpcDecl.h"
23 
24 namespace XmlRpc {
25 
26 
27  // An abstract class supporting XML RPC methods
28  class XmlRpcServerMethod;
29 
30  // Class representing connections to specific clients
31  class XmlRpcServerConnection;
32 
33  // Class representing argument and result values
34  class XmlRpcValue;
35 
36 
38  class XMLRPCPP_DECL XmlRpcServer : public XmlRpcSource {
39  public:
41  XmlRpcServer();
43  virtual ~XmlRpcServer();
44 
46  void enableIntrospection(bool enabled=true);
47 
49  void addMethod(XmlRpcServerMethod* method);
50 
52  void removeMethod(XmlRpcServerMethod* method);
53 
55  void removeMethod(const std::string& methodName);
56 
58  XmlRpcServerMethod* findMethod(const std::string& name) const;
59 
62  bool bindAndListen(int port, int backlog = 5);
63 
65  void work(double msTime);
66 
68  void exit();
69 
71  void shutdown();
72 
74  void listMethods(XmlRpcValue& result);
75 
76  // XmlRpcSource interface implementation
77 
79  virtual unsigned handleEvent(unsigned eventType);
80 
82  virtual void removeConnection(XmlRpcServerConnection*);
83 
84  inline int get_port() { return _port; }
85 
86  XmlRpcDispatch *get_dispatch() { return &_disp; }
87 
88  protected:
89 
91  virtual void acceptConnection();
92 
94  virtual XmlRpcServerConnection* createConnection(int socket);
95 
96  // Whether the introspection API is supported by this server
97  bool _introspectionEnabled;
98 
99  // Event dispatcher
100  XmlRpcDispatch _disp;
101 
102  // Collection of methods. This could be a set keyed on method name if we wanted...
103  typedef std::map< std::string, XmlRpcServerMethod* > MethodMap;
104  MethodMap _methods;
105 
106  // system methods
107  XmlRpcServerMethod* _listMethods;
108  XmlRpcServerMethod* _methodHelp;
109 
110  int _port;
111 
112  };
113 } // namespace XmlRpc
114 
115 #endif //_XMLRPCSERVER_H_
roswrap::console::shutdown
ROSCONSOLE_DECL void shutdown()
Definition: rossimu.cpp:269
XmlRpc
api.setup.name
name
Definition: python/api/setup.py:12
sick_scan_base.h
XMLRPCPP_DECL
#define XMLRPCPP_DECL
Definition: XmlRpcDecl.h:53


sick_scan_xd
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:13