35 #ifndef ROSCPP_SERVICE_SERVER_LINK_H 36 #define ROSCPP_SERVICE_SERVER_LINK_H 38 #include "ros/common.h" 40 #include <boost/thread/mutex.hpp> 41 #include <boost/shared_array.hpp> 42 #include <boost/enable_shared_from_this.hpp> 43 #include <boost/thread.hpp> 58 class ROSCPP_DECL
ServiceServerLink :
public boost::enable_shared_from_this<ServiceServerLink>
80 typedef std::map<std::string, std::string>
M_string;
81 ServiceServerLink(
const std::string& service_name,
bool persistent,
const std::string& request_md5sum,
const std::string& response_md5sum,
const M_string& header_values);
85 bool initialize(
const ConnectionPtr& connection);
111 void onConnectionDropped(
const ConnectionPtr& conn);
112 bool onHeaderReceived(
const ConnectionPtr& conn,
const Header&
header);
123 void processNextCall();
131 void cancelCall(
const CallInfoPtr& info);
133 void onHeaderWritten(
const ConnectionPtr& conn);
134 void onRequestWritten(
const ConnectionPtr& conn);
159 #endif // ROSCPP_SERVICE_SERVER_LINK_H
boost::mutex finished_mutex_
const ConnectionPtr & getConnection() const
ROSCONSOLE_DECL void initialize()
boost::thread::id caller_thread_id_
bool call(const std::string &service_name, MReq &req, MRes &res)
Invoke an RPC service.
boost::condition_variable finished_condition_
SerializedMessage * resp_
boost::shared_ptr< Connection > ConnectionPtr
ConnectionPtr connection_
std::map< std::string, std::string > M_string
const std::string & getServiceName() const
std::queue< CallInfoPtr > Q_CallInfo
CallInfoPtr current_call_
std::string exception_string_
boost::shared_ptr< CallInfo > CallInfoPtr
std::string service_name_
std::string request_md5sum_
boost::mutex call_queue_mutex_
bool isPersistent() const
Returns whether this is a persistent connection.
M_string extra_outgoing_header_values_
Handles a connection to a service. If it's a non-persistent client, automatically disconnects when it...
const std::string & getRequestMD5Sum() const
std::string response_md5sum_
boost::shared_ptr< ServiceServerLink > ServiceServerLinkPtr
const std::string & getResponseMD5Sum() const