Go to the documentation of this file.
28 #ifndef ROSCPP_SERVICE_MESSAGE_HELPER_H
29 #define ROSCPP_SERVICE_MESSAGE_HELPER_H
32 #include "ros/common.h"
38 #include <boost/type_traits/is_base_of.hpp>
39 #include <boost/utility/enable_if.hpp>
53 return boost::make_shared<M>();
56 template<
typename MReq,
typename MRes>
69 template<
typename MReq,
typename MRes>
114 template<
typename MReq,
typename MRes>
145 template<
typename Spec>
161 static_cast<RequestPtr(*)()
>(defaultServiceCreateFunction<RequestType>),
163 static_cast<ResponsePtr(*)()
>(defaultServiceCreateFunction<ResponseType>))
172 namespace ser = serialization;
176 ser::deserializeMessage(params.
request, *req);
183 params.
response = ser::serializeServiceResponse(
ok, *res);
195 #endif // ROSCPP_SERVICE_MESSAGE_HELPER_H
SerializedMessage response
boost::shared_ptr< M_string > connection_header_
static bool call(const CallbackType &cb, ServiceSpecCallParams< RequestType, ResponseType > ¶ms)
boost::function< bool(RequestType &, ResponseType &)> CallbackType
SerializedMessage request
static bool call(const CallbackType &cb, ServiceSpecCallParams< RequestType, ResponseType > ¶ms)
bool call(const std::string &service_name, MReq &req, MRes &res)
Invoke an RPC service.
virtual ~ServiceCallbackHelper()
ServiceCallbackHelperT(const Callback &callback, const ReqCreateFunction &create_req=static_cast< RequestPtr(*)()>(defaultServiceCreateFunction< RequestType >), const ResCreateFunction &create_res=static_cast< ResponsePtr(*)()>(defaultServiceCreateFunction< ResponseType >))
boost::function< RequestPtr()> ReqCreateFunction
ReqCreateFunction create_req_
Spec::RequestType RequestType
const RequestType & getRequest() const
Returns a const-reference to the request.
boost::shared_ptr< ResponseType > ResponsePtr
boost::shared_ptr< RequestType > RequestPtr
ServiceEvent(const boost::shared_ptr< MReq const > &req, const boost::shared_ptr< MRes > &res, const boost::shared_ptr< M_string > &connection_header)
boost::shared_ptr< M_string > connection_header
virtual bool call(ServiceCallbackHelperCallParams ¶ms)
boost::shared_ptr< ResponseType > ResponsePtr
boost::shared_ptr< RequestType const > request_
Concrete generic implementation of ServiceCallbackHelper for any normal service type.
ROSCPP_DECL bool ok()
Check whether it's time to exit.
ResponseType & getResponse() const
Returns a non-const reference to the response.
boost::shared_ptr< MReq > request
boost::shared_ptr< M > defaultServiceCreateFunction()
boost::shared_ptr< ResponseType > response_
boost::shared_ptr< MRes > response
ResCreateFunction create_res_
Spec::RequestPtr RequestPtr
const std::string & getCallerName() const
Returns the name of the node which called this service.
Spec::ResponsePtr ResponsePtr
Abstract base class used by service servers to deal with concrete message types through a common inte...
boost::shared_ptr< ServiceCallbackHelper > ServiceCallbackHelperPtr
boost::shared_ptr< RequestType > RequestPtr
boost::function< ResponsePtr()> ResCreateFunction
M_string & getConnectionHeader() const
Returns a reference to the connection header.
Spec::CallbackType Callback
boost::function< bool(ServiceEvent< RequestType, ResponseType > &)> CallbackType
Spec::ResponseType ResponseType
Event type for services, ros::ServiceEvent<MReq, MRes>& can be used in your callback instead of MReq&...
boost::shared_ptr< M_string > connection_header
std::map< std::string, std::string > M_string
roscpp
Author(s): Morgan Quigley, Josh Faust, Brian Gerkey, Troy Straszheim, Dirk Thomas
, Jacob Perron
autogenerated on Sat Sep 14 2024 02:59:35