Go to the documentation of this file.
28 #ifndef ROSCPP_SERVICE_H
29 #define ROSCPP_SERVICE_H
32 #include "ros/common.h"
39 #include <boost/shared_ptr.hpp>
44 class ServiceServerLink;
64 template<
class MReq,
class MRes>
65 bool call(
const std::string& service_name, MReq& req, MRes& res)
67 namespace st = service_traits;
71 return client.
call(req, res);
84 template<
class Service>
85 bool call(
const std::string& service_name, Service& service)
87 namespace st = service_traits;
92 return client.
call(service.request, service.response);
103 ROSCPP_DECL
bool waitForService(
const std::string& service_name, int32_t timeout);
121 ROSCPP_DECL
bool exists(
const std::string& service_name,
bool print_failure_reason);
133 template<
class MReq,
class MRes>
151 template<
class Service>
163 #endif // ROSCPP_SERVICE_H
ROSCPP_DECL bool exists(const std::string &service_name, bool print_failure_reason)
Checks if a service is both advertised and available.
bool call(const std::string &service_name, MReq &req, MRes &res)
Invoke an RPC service.
ServiceClient createClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
Create a client for a service.
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
Create a client for a service, version templated on two message types.
ROSCPP_DECL std::string resolve(const std::string &name, bool remap=true)
Resolve a graph resource name into a fully qualified graph resource name.
Encapsulates all options available for creating a ServiceClient.
boost::shared_ptr< ServiceServerLink > ServiceServerLinkPtr
Provides a handle-based interface to service client connections.
bool call(MReq &req, MRes &res)
Call the service aliased by this handle with the specified request/response messages.
roscpp's interface for creating subscribers, publishers, etc.
ROSCPP_DECL bool waitForService(const std::string &service_name, int32_t timeout)
Wait for a service to be advertised and available. Blocks until it is.
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