Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
roswrap::ServiceEvent< MReq, MRes > Class Template Reference

Event type for services, ros::ServiceEvent<MReq, MRes>& can be used in your callback instead of MReq&, MRes&. More...

#include <service_callback_helper.h>

Public Types

typedef std::function< bool(ServiceEvent< RequestType, ResponseType > &)> CallbackType
 
typedef std::shared_ptr< RequestTypeRequestPtr
 
typedef MReq RequestType
 
typedef std::shared_ptr< ResponseTypeResponsePtr
 
typedef MRes ResponseType
 

Public Member Functions

const std::string & getCallerName () const
 Returns the name of the node which called this service. More...
 
M_stringgetConnectionHeader () const
 Returns a reference to the connection header. More...
 
const RequestTypegetRequest () const
 Returns a const-reference to the request. More...
 
ResponseTypegetResponse () const
 Returns a non-const reference to the response. More...
 
 ServiceEvent (const std::shared_ptr< MReq const > &req, const std::shared_ptr< MRes > &res, const std::shared_ptr< M_string > &connection_header)
 

Static Public Member Functions

static bool call (const CallbackType &cb, ServiceSpecCallParams< RequestType, ResponseType > &params)
 

Private Attributes

std::shared_ptr< M_stringconnection_header_
 
std::shared_ptr< RequestType constrequest_
 
std::shared_ptr< ResponseTyperesponse_
 

Detailed Description

template<typename MReq, typename MRes>
class roswrap::ServiceEvent< MReq, MRes >

Event type for services, ros::ServiceEvent<MReq, MRes>& can be used in your callback instead of MReq&, MRes&.

Useful if you need to retrieve meta-data about the call, such as the full connection header, or the caller's node name

Definition at line 71 of file service_callback_helper.h.

Member Typedef Documentation

◆ CallbackType

template<typename MReq , typename MRes >
typedef std::function<bool(ServiceEvent<RequestType, ResponseType>&)> roswrap::ServiceEvent< MReq, MRes >::CallbackType

Definition at line 78 of file service_callback_helper.h.

◆ RequestPtr

template<typename MReq , typename MRes >
typedef std::shared_ptr<RequestType> roswrap::ServiceEvent< MReq, MRes >::RequestPtr

Definition at line 76 of file service_callback_helper.h.

◆ RequestType

template<typename MReq , typename MRes >
typedef MReq roswrap::ServiceEvent< MReq, MRes >::RequestType

Definition at line 74 of file service_callback_helper.h.

◆ ResponsePtr

template<typename MReq , typename MRes >
typedef std::shared_ptr<ResponseType> roswrap::ServiceEvent< MReq, MRes >::ResponsePtr

Definition at line 77 of file service_callback_helper.h.

◆ ResponseType

template<typename MReq , typename MRes >
typedef MRes roswrap::ServiceEvent< MReq, MRes >::ResponseType

Definition at line 75 of file service_callback_helper.h.

Constructor & Destructor Documentation

◆ ServiceEvent()

template<typename MReq , typename MRes >
roswrap::ServiceEvent< MReq, MRes >::ServiceEvent ( const std::shared_ptr< MReq const > &  req,
const std::shared_ptr< MRes > &  res,
const std::shared_ptr< M_string > &  connection_header 
)
inline

Definition at line 86 of file service_callback_helper.h.

Member Function Documentation

◆ call()

template<typename MReq , typename MRes >
static bool roswrap::ServiceEvent< MReq, MRes >::call ( const CallbackType cb,
ServiceSpecCallParams< RequestType, ResponseType > &  params 
)
inlinestatic

Definition at line 80 of file service_callback_helper.h.

◆ getCallerName()

template<typename MReq , typename MRes >
const std::string& roswrap::ServiceEvent< MReq, MRes >::getCallerName ( ) const
inline

Returns the name of the node which called this service.

Definition at line 108 of file service_callback_helper.h.

◆ getConnectionHeader()

template<typename MReq , typename MRes >
M_string& roswrap::ServiceEvent< MReq, MRes >::getConnectionHeader ( ) const
inline

Returns a reference to the connection header.

Definition at line 103 of file service_callback_helper.h.

◆ getRequest()

template<typename MReq , typename MRes >
const RequestType& roswrap::ServiceEvent< MReq, MRes >::getRequest ( ) const
inline

Returns a const-reference to the request.

Definition at line 95 of file service_callback_helper.h.

◆ getResponse()

template<typename MReq , typename MRes >
ResponseType& roswrap::ServiceEvent< MReq, MRes >::getResponse ( ) const
inline

Returns a non-const reference to the response.

Definition at line 99 of file service_callback_helper.h.

Member Data Documentation

◆ connection_header_

template<typename MReq , typename MRes >
std::shared_ptr<M_string> roswrap::ServiceEvent< MReq, MRes >::connection_header_
private

Definition at line 112 of file service_callback_helper.h.

◆ request_

template<typename MReq , typename MRes >
std::shared_ptr<RequestType const> roswrap::ServiceEvent< MReq, MRes >::request_
private

Definition at line 110 of file service_callback_helper.h.

◆ response_

template<typename MReq , typename MRes >
std::shared_ptr<ResponseType> roswrap::ServiceEvent< MReq, MRes >::response_
private

Definition at line 111 of file service_callback_helper.h.


The documentation for this class 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