15 #ifndef RCLCPP__ANY_SERVICE_CALLBACK_HPP_ 16 #define RCLCPP__ANY_SERVICE_CALLBACK_HPP_ 21 #include <type_traits> 26 #include "tracetools/tracetools.h" 31 template<
typename ServiceT>
52 : shared_ptr_callback_(nullptr), shared_ptr_with_request_header_callback_(nullptr)
66 void set(CallbackT callback)
68 shared_ptr_callback_ = callback;
80 void set(CallbackT callback)
82 shared_ptr_with_request_header_callback_ = callback;
90 TRACEPOINT(callback_start, (
const void *)
this,
false);
91 if (shared_ptr_callback_ !=
nullptr) {
93 shared_ptr_callback_(request, response);
94 }
else if (shared_ptr_with_request_header_callback_ !=
nullptr) {
95 shared_ptr_with_request_header_callback_(request_header, request, response);
99 TRACEPOINT(callback_end, (
const void *)
this);
105 #endif // RCLCPP__ANY_SERVICE_CALLBACK_HPP_
This header provides the get_node_base_interface() template function.
Definition: allocator_common.hpp:24
void dispatch(std::shared_ptr< rmw_request_id_t > request_header, std::shared_ptr< typename ServiceT::Request > request, std::shared_ptr< typename ServiceT::Response > response)
Definition: any_service_callback.hpp:85
Definition: function_traits.hpp:161
AnyServiceCallback()
Definition: any_service_callback.hpp:51
Definition: any_service_callback.hpp:32