rclcpp  beta1
C++ ROS Client Library API
Public Types | Public Member Functions | List of all members
rclcpp::service::Service< ServiceT > Class Template Reference

#include <service.hpp>

Inheritance diagram for rclcpp::service::Service< ServiceT >:
rclcpp::service::ServiceBase

Public Types

using CallbackType = std::function< void(const std::shared_ptr< typename ServiceT::Request >, std::shared_ptr< typename ServiceT::Response >)>
 
using CallbackWithHeaderType = std::function< void(const std::shared_ptr< rmw_request_id_t >, const std::shared_ptr< typename ServiceT::Request >, std::shared_ptr< typename ServiceT::Response >)>
 

Public Member Functions

 Service (std::shared_ptr< rcl_node_t > node_handle, const std::string &service_name, AnyServiceCallback< ServiceT > any_callback, rcl_service_options_t &service_options)
 
 Service (std::shared_ptr< rcl_node_t > node_handle, rcl_service_t *service_handle, AnyServiceCallback< ServiceT > any_callback)
 
 Service ()=delete
 
virtual ~Service ()
 
std::shared_ptr< void > create_request ()
 
std::shared_ptr< rmw_request_id_tcreate_request_header ()
 
void handle_request (std::shared_ptr< rmw_request_id_t > request_header, std::shared_ptr< void > request)
 
void send_response (std::shared_ptr< rmw_request_id_t > req_id, std::shared_ptr< typename ServiceT::Response > response)
 
- Public Member Functions inherited from rclcpp::service::ServiceBase
 ServiceBase (std::shared_ptr< rcl_node_t > node_handle, const std::string &service_name)
 
 ServiceBase (std::shared_ptr< rcl_node_t > node_handle)
 
virtual ~ServiceBase ()
 
std::string get_service_name ()
 
const rcl_service_tget_service_handle ()
 

Additional Inherited Members

- Protected Attributes inherited from rclcpp::service::ServiceBase
std::shared_ptr< rcl_node_tnode_handle_
 
rcl_service_tservice_handle_ = nullptr
 
std::string service_name_
 
bool owns_rcl_handle_ = true
 

Member Typedef Documentation

§ CallbackType

template<typename ServiceT>
using rclcpp::service::Service< ServiceT >::CallbackType = std::function< void( const std::shared_ptr<typename ServiceT::Request>, std::shared_ptr<typename ServiceT::Response>)>

§ CallbackWithHeaderType

template<typename ServiceT>
using rclcpp::service::Service< ServiceT >::CallbackWithHeaderType = std::function< void( const std::shared_ptr<rmw_request_id_t>, const std::shared_ptr<typename ServiceT::Request>, std::shared_ptr<typename ServiceT::Response>)>

Constructor & Destructor Documentation

§ Service() [1/3]

template<typename ServiceT>
rclcpp::service::Service< ServiceT >::Service ( std::shared_ptr< rcl_node_t node_handle,
const std::string service_name,
AnyServiceCallback< ServiceT >  any_callback,
rcl_service_options_t service_options 
)
inline

§ Service() [2/3]

template<typename ServiceT>
rclcpp::service::Service< ServiceT >::Service ( std::shared_ptr< rcl_node_t node_handle,
rcl_service_t service_handle,
AnyServiceCallback< ServiceT >  any_callback 
)
inline

§ Service() [3/3]

template<typename ServiceT>
rclcpp::service::Service< ServiceT >::Service ( )
delete

§ ~Service()

template<typename ServiceT>
virtual rclcpp::service::Service< ServiceT >::~Service ( )
inlinevirtual

Member Function Documentation

§ create_request()

template<typename ServiceT>
std::shared_ptr<void> rclcpp::service::Service< ServiceT >::create_request ( )
inlinevirtual

§ create_request_header()

template<typename ServiceT>
std::shared_ptr<rmw_request_id_t> rclcpp::service::Service< ServiceT >::create_request_header ( )
inlinevirtual

§ handle_request()

template<typename ServiceT>
void rclcpp::service::Service< ServiceT >::handle_request ( std::shared_ptr< rmw_request_id_t request_header,
std::shared_ptr< void >  request 
)
inlinevirtual

§ send_response()

template<typename ServiceT>
void rclcpp::service::Service< ServiceT >::send_response ( std::shared_ptr< rmw_request_id_t req_id,
std::shared_ptr< typename ServiceT::Response >  response 
)
inline

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