Go to the documentation of this file.
40 #include <boost/bind/bind.hpp>
42 #include <std_msgs/String.h>
52 , data_type_(data_type)
53 , request_data_type_(request_data_type)
54 , response_data_type_(response_data_type)
57 , callback_queue_(callback_queue)
58 , has_tracked_object_(false)
59 , tracked_object_(tracked_object)
101 if (
link_->getConnection()->isDropped())
113 SerializedMessage res = serialization::serializeServiceResponse<uint32_t>(
false, 0);
114 link_->processResponse(
false, res);
132 SerializedMessage res = serialization::serializeServiceResponse<uint32_t>(
false, 0);
133 link_->processResponse(
false, res);
136 catch (std::exception& e)
138 ROS_ERROR(
"Exception thrown while processing service call: %s", e.what());
139 std_msgs::String error_string;
140 error_string.data = e.what();
142 link_->processResponse(
false, res);
194 for (V_ServiceClientLink::iterator i = local_links.begin();
195 i != local_links.end(); ++i)
@ Invalid
Call no longer valid.
SerializedMessage response
void dropAllConnections()
SerializedMessage request
ServiceClientLinkPtr link_
void addServiceClientLink(const ServiceClientLinkPtr &link)
Adds a service link for us to manage.
ServiceCallback(const ServiceCallbackHelperPtr &helper, const boost::shared_array< uint8_t > &buf, size_t num_bytes, const ServiceClientLinkPtr &link, bool has_tracked_object, const VoidConstWPtr &tracked_object)
SerializedMessage serializeServiceResponse(bool ok, const M &message)
std::vector< ServiceClientLinkPtr > V_ServiceClientLink
virtual CallResult call()
Call this callback.
boost::shared_array< uint8_t > buffer_
ROSCPP_DECL bool ok()
Check whether it's time to exit.
CallResult
Possible results for the call() method.
CallbackQueueInterface * callback_queue_
VoidConstWPtr tracked_object_
boost::mutex client_links_mutex_
ServiceCallbackHelperPtr helper_
virtual void removeByID(uint64_t owner_id)=0
Remove all callbacks associated with an owner id.
VoidConstWPtr tracked_object_
Abstract interface for items which can be added to a CallbackQueueInterface.
void processRequest(boost::shared_array< uint8_t > buf, size_t num_bytes, const ServiceClientLinkPtr &link)
Adds a request to the queue if our thread pool size is not 0, otherwise immediately calls the callbac...
virtual void addCallback(const CallbackInterfacePtr &callback, uint64_t owner_id=0)=0
Add a callback, with an optional owner id. The owner id can be used to remove a set of callbacks from...
boost::weak_ptr< void const > VoidConstWPtr
V_ServiceClientLink client_links_
void removeServiceClientLink(const ServiceClientLinkPtr &link)
Removes a service link from our list.
void drop()
Terminate this service server.
ServiceCallbackHelperPtr helper_
ServicePublication(const std::string &name, const std::string &md5sum, const std::string &data_type, const std::string &request_data_type, const std::string &response_data_type, const ServiceCallbackHelperPtr &helper, CallbackQueueInterface *queue, const VoidConstPtr &tracked_object)
Abstract interface for a queue used to handle all callbacks within roscpp.
boost::shared_ptr< M_string > connection_header
roscpp
Author(s): Morgan Quigley, Josh Faust, Brian Gerkey, Troy Straszheim, Dirk Thomas
, Jacob Perron
autogenerated on Sat Sep 14 2024 02:59:35