Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
roswrap::AdvertiseServiceOptions Struct Reference

Encapsulates all options available for creating a ServiceServer. More...

#include <advertise_service_options.h>

Public Member Functions

 AdvertiseServiceOptions ()
 
template<class MReq , class MRes >
void init (const std::string &_service, const std::function< bool(MReq &, MRes &)> &_callback)
 Templated convenience method for filling out md5sum/etc. based on the service request/response types. More...
 
template<class Service >
void init (const std::string &_service, const std::function< bool(typename Service::Request &, typename Service::Response &)> &_callback)
 Templated convenience method for filling out md5sum/etc. based on the service type. More...
 
template<class Spec >
void initBySpecType (const std::string &_service, const typename Spec::CallbackType &_callback)
 Templated convenience method for filling out md5sum/etc. based on the service spec type. More...
 

Static Public Member Functions

template<class Service >
static AdvertiseServiceOptions create (const std::string &service, const std::function< bool(typename Service::Request &, typename Service::Response &)> &callback, const VoidConstPtr &tracked_object, CallbackQueueInterface *queue)
 Templated helper function for creating an AdvertiseServiceOptions with all of its options. More...
 

Public Attributes

CallbackQueueInterfacecallback_queue
 Queue to add callbacks to. If NULL, the global callback queue will be used. More...
 
std::string datatype
 Datatype of the service. More...
 
ServiceCallbackHelperPtr helper
 Helper object used for creating messages and calling callbacks. More...
 
std::string md5sum
 MD5 of the service. More...
 
std::string req_datatype
 Request message datatype. More...
 
std::string res_datatype
 Response message datatype. More...
 
std::string service
 Service name. More...
 
VoidConstPtr tracked_object
 An object whose destruction will prevent the callback associated with this service from being called. More...
 

Detailed Description

Encapsulates all options available for creating a ServiceServer.

Definition at line 44 of file advertise_service_options.h.

Constructor & Destructor Documentation

◆ AdvertiseServiceOptions()

roswrap::AdvertiseServiceOptions::AdvertiseServiceOptions ( )
inline

Definition at line 46 of file advertise_service_options.h.

Member Function Documentation

◆ create()

template<class Service >
static AdvertiseServiceOptions roswrap::AdvertiseServiceOptions::create ( const std::string &  service,
const std::function< bool(typename Service::Request &, typename Service::Response &)> &  callback,
const VoidConstPtr tracked_object,
CallbackQueueInterface queue 
)
inlinestatic

Templated helper function for creating an AdvertiseServiceOptions with all of its options.

Parameters
serviceService name to advertise on
callbackThe callback to invoke when the service is called
tracked_objectThe tracked object to use (see AdvertiseServiceOptions::tracked_object)
queueThe callback queue to use (see AdvertiseServiceOptions::callback_queue)

Definition at line 149 of file advertise_service_options.h.

◆ init() [1/2]

template<class MReq , class MRes >
void roswrap::AdvertiseServiceOptions::init ( const std::string &  _service,
const std::function< bool(MReq &, MRes &)> &  _callback 
)
inline

Templated convenience method for filling out md5sum/etc. based on the service request/response types.

Parameters
_serviceService name to advertise on
_callbackCallback to call when this service is called

Definition at line 57 of file advertise_service_options.h.

◆ init() [2/2]

template<class Service >
void roswrap::AdvertiseServiceOptions::init ( const std::string &  _service,
const std::function< bool(typename Service::Request &, typename Service::Response &)> &  _callback 
)
inline

Templated convenience method for filling out md5sum/etc. based on the service type.

Parameters
_serviceService name to advertise on
_callbackCallback to call when this service is called

Definition at line 85 of file advertise_service_options.h.

◆ initBySpecType()

template<class Spec >
void roswrap::AdvertiseServiceOptions::initBySpecType ( const std::string &  _service,
const typename Spec::CallbackType &  _callback 
)
inline

Templated convenience method for filling out md5sum/etc. based on the service spec type.

Parameters
_serviceService name to advertise on
_callbackCallback to call when this service is called

Definition at line 105 of file advertise_service_options.h.

Member Data Documentation

◆ callback_queue

CallbackQueueInterface* roswrap::AdvertiseServiceOptions::callback_queue

Queue to add callbacks to. If NULL, the global callback queue will be used.

Definition at line 127 of file advertise_service_options.h.

◆ datatype

std::string roswrap::AdvertiseServiceOptions::datatype

Datatype of the service.

Definition at line 121 of file advertise_service_options.h.

◆ helper

ServiceCallbackHelperPtr roswrap::AdvertiseServiceOptions::helper

Helper object used for creating messages and calling callbacks.

Definition at line 125 of file advertise_service_options.h.

◆ md5sum

std::string roswrap::AdvertiseServiceOptions::md5sum

MD5 of the service.

Definition at line 120 of file advertise_service_options.h.

◆ req_datatype

std::string roswrap::AdvertiseServiceOptions::req_datatype

Request message datatype.

Definition at line 122 of file advertise_service_options.h.

◆ res_datatype

std::string roswrap::AdvertiseServiceOptions::res_datatype

Response message datatype.

Definition at line 123 of file advertise_service_options.h.

◆ service

std::string roswrap::AdvertiseServiceOptions::service

Service name.

Definition at line 119 of file advertise_service_options.h.

◆ tracked_object

VoidConstPtr roswrap::AdvertiseServiceOptions::tracked_object

An object whose destruction will prevent the callback associated with this service from being called.

A shared pointer to an object to track for these callbacks. If set, the a weak_ptr will be created to this object, and if the reference count goes to 0 the subscriber callbacks will not get called.

Note
Note that setting this will cause a new reference to be added to the object before the callback, and for it to go out of scope (and potentially be deleted) in the code path (and therefore thread) that the callback is invoked from.

Definition at line 139 of file advertise_service_options.h.


The documentation for this struct was generated from the following file:


sick_scan_xd
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:15