28 #ifndef ROSCPP_XMLRPC_MANAGER_H 29 #define ROSCPP_XMLRPC_MANAGER_H 33 #include <boost/function.hpp> 34 #include <boost/thread/mutex.hpp> 35 #include <boost/thread/thread.hpp> 36 #include <boost/enable_shared_from_this.hpp> 68 virtual bool check() = 0;
92 typedef boost::function<void(XmlRpc::XmlRpcValue&, XmlRpc::XmlRpcValue&)>
XMLRPCFunc;
97 static const XMLRPCManagerPtr& instance();
112 bool validateXmlrpcResponse(
const std::string& method,
121 XmlRpc::XmlRpcClient* getXMLRPCClient(
const std::string& host,
const int port,
const std::string& uri);
124 void addASyncConnection(
const ASyncXMLRPCConnectionPtr& conn);
125 void removeASyncConnection(
const ASyncXMLRPCConnectionPtr& conn);
127 bool bind(
const std::string& function_name,
const XMLRPCFunc& cb);
128 void unbind(
const std::string& function_name);
136 void serverThreadFunc();
142 #if defined(__APPLE__) 144 boost::mutex xmlrpc_call_mutex_;
virtual ~ASyncXMLRPCConnection()
ros::SteadyTime last_use_time_
XmlRpc::XmlRpcClient * client_
volatile bool unbind_requested_
ROSCPP_DECL bool check()
Check whether the master is up.
boost::mutex added_connections_mutex_
ROSCPP_DECL XmlRpc::XmlRpcValue responseBool(int code, const std::string &msg, bool response)
M_StringToFuncInfo functions_
ROSCPP_DECL void start()
Actually starts the internals of the node (spins up threads, starts the network polling and xmlrpc lo...
boost::thread server_thread_
boost::shared_ptr< ASyncXMLRPCConnection > ASyncXMLRPCConnectionPtr
uint32_t getServerPort() const
ROSCPP_DECL XmlRpc::XmlRpcValue responseInt(int code, const std::string &msg, int response)
V_CachedXmlRpcClient clients_
boost::shared_ptr< XMLRPCManager > XMLRPCManagerPtr
ros::WallDuration master_retry_timeout_
ROSCPP_DECL XmlRpc::XmlRpcValue responseStr(int code, const std::string &msg, const std::string &response)
boost::mutex functions_mutex_
S_ASyncXMLRPCConnection connections_
std::vector< CachedXmlRpcClient > V_CachedXmlRpcClient
boost::mutex removed_connections_mutex_
boost::function< void(XmlRpc::XmlRpcValue &, XmlRpc::XmlRpcValue &)> XMLRPCFunc
static const ros::WallDuration s_zombie_time_
CachedXmlRpcClient(XmlRpc::XmlRpcClient *c)
boost::mutex clients_mutex_
XMLRPCCallWrapperPtr wrapper
std::set< ASyncXMLRPCConnectionPtr > S_ASyncXMLRPCConnection
ROSCPP_DECL void shutdown()
Disconnects everything and unregisters from the master. It is generally not necessary to call this fu...
boost::shared_ptr< XMLRPCCallWrapper > XMLRPCCallWrapperPtr
S_ASyncXMLRPCConnection removed_connections_
S_ASyncXMLRPCConnection added_connections_
XmlRpc::XmlRpcServer server_
const std::string & getServerURI() const
Get the xmlrpc server URI of this node.
const std::string response
std::map< std::string, FunctionInfo > M_StringToFuncInfo