Provides a handle-based interface to service client connections.
More...
#include <service_client.h>
|
template<typename MReq , typename MRes > |
bool | call (const MReq &req, MRes &resp, const std::string &service_md5sum) |
| Mostly for internal use, the other templated versions of call() just call into this one. More...
|
|
bool | call (const SerializedMessage &req, SerializedMessage &resp, const std::string &service_md5sum) |
|
template<class MReq , class MRes > |
bool | call (MReq &req, MRes &res) |
| Call the service aliased by this handle with the specified request/response messages. More...
|
|
template<class Service > |
bool | call (Service &service) |
| Call the service aliased by this handle with the specified service request/response. More...
|
|
bool | exists () |
| Checks if this is both advertised and available. More...
|
|
std::string | getService () |
| Returns the name of the service this ServiceClient connects to. More...
|
|
bool | isPersistent () const |
| Returns true if this handle points to a persistent service, false otherwise. More...
|
|
bool | isValid () const |
| Returns whether or not this handle is valid. For a persistent service, this becomes false when the connection has dropped. Non-persistent service handles are always valid. More...
|
|
| operator void * () const |
|
bool | operator!= (const ServiceClient &rhs) const |
|
bool | operator< (const ServiceClient &rhs) const |
|
ServiceClient & | operator= (const ServiceClient &other)=default |
|
bool | operator== (const ServiceClient &rhs) const |
|
| ServiceClient () |
|
| ServiceClient (const ServiceClient &rhs) |
|
| ServiceClient (const std::string &service_name, bool persistent, const M_string &header_values, const std::string &service_md5sum) |
|
void | shutdown () |
| Shutdown the connection associated with this ServiceClient. More...
|
|
bool | waitForExistence (ros::Duration timeout=ros::Duration(-1)) |
| Wait for this service to be advertised and available. Blocks until it is. More...
|
|
| ~ServiceClient () |
|
Provides a handle-based interface to service client connections.
Definition at line 42 of file service_client.h.
◆ ImplPtr
◆ ImplWPtr
◆ ServiceClient() [1/3]
ros::ServiceClient::ServiceClient |
( |
| ) |
|
|
inline |
◆ ServiceClient() [2/3]
ros::ServiceClient::ServiceClient |
( |
const std::string & |
service_name, |
|
|
bool |
persistent, |
|
|
const M_string & |
header_values, |
|
|
const std::string & |
service_md5sum |
|
) |
| |
◆ ServiceClient() [3/3]
◆ ~ServiceClient()
ros::ServiceClient::~ServiceClient |
( |
| ) |
|
◆ call() [1/4]
template<typename MReq , typename MRes >
bool ros::ServiceClient::call |
( |
const MReq & |
req, |
|
|
MRes & |
resp, |
|
|
const std::string & |
service_md5sum |
|
) |
| |
|
inline |
Mostly for internal use, the other templated versions of call() just call into this one.
Definition at line 98 of file service_client.h.
◆ call() [2/4]
◆ call() [3/4]
template<class MReq , class MRes >
bool ros::ServiceClient::call |
( |
MReq & |
req, |
|
|
MRes & |
res |
|
) |
| |
|
inline |
◆ call() [4/4]
template<class Service >
bool ros::ServiceClient::call |
( |
Service & |
service | ) |
|
|
inline |
Call the service aliased by this handle with the specified service request/response.
Definition at line 82 of file service_client.h.
◆ deserializeFailed()
void ros::ServiceClient::deserializeFailed |
( |
const std::exception & |
e | ) |
|
|
inlineprivate |
◆ exists()
bool ros::ServiceClient::exists |
( |
| ) |
|
Checks if this is both advertised and available.
- Returns
- true if the service is up and available, false otherwise
Definition at line 193 of file service_client.cpp.
◆ getService()
std::string ros::ServiceClient::getService |
( |
| ) |
|
◆ isPersistent()
bool ros::ServiceClient::isPersistent |
( |
| ) |
const |
Returns true if this handle points to a persistent service, false otherwise.
Definition at line 165 of file service_client.cpp.
◆ isValid()
bool ros::ServiceClient::isValid |
( |
| ) |
const |
Returns whether or not this handle is valid. For a persistent service, this becomes false when the connection has dropped. Non-persistent service handles are always valid.
Definition at line 155 of file service_client.cpp.
◆ operator void *()
ros::ServiceClient::operator void * |
( |
| ) |
const |
|
inline |
◆ operator!=()
bool ros::ServiceClient::operator!= |
( |
const ServiceClient & |
rhs | ) |
const |
|
inline |
◆ operator<()
bool ros::ServiceClient::operator< |
( |
const ServiceClient & |
rhs | ) |
const |
|
inline |
◆ operator=()
◆ operator==()
bool ros::ServiceClient::operator== |
( |
const ServiceClient & |
rhs | ) |
const |
|
inline |
◆ shutdown()
void ros::ServiceClient::shutdown |
( |
| ) |
|
Shutdown the connection associated with this ServiceClient.
This method usually does not need to be explicitly called, as automatic shutdown happens when all copies of this ServiceClient go out of scope
This method overrides the automatic reference counted shutdown, and does so immediately.
Definition at line 175 of file service_client.cpp.
◆ waitForExistence()
Wait for this service to be advertised and available. Blocks until it is.
- Parameters
-
timeout | The amount of time to wait for before timing out. If timeout is -1 (default), waits until the node is shutdown |
- Returns
- true on success, false otherwise
Definition at line 183 of file service_client.cpp.
◆ NodeHandle
◆ NodeHandleBackingCollection
◆ impl_
The documentation for this class was generated from the following files:
roscpp
Author(s): Morgan Quigley, Josh Faust, Brian Gerkey, Troy Straszheim, Dirk Thomas
, Jacob Perron
autogenerated on Sat Sep 14 2024 02:59:36