rclcpp
master
C++ ROS Client Library API
|
Go to the documentation of this file.
15 #ifndef RCLCPP__QOS_EVENT_HPP_
16 #define RCLCPP__QOS_EVENT_HPP_
23 #include "rcl/error_handling.h"
75 const rcl_error_state_t * error_state,
110 template<
typename EventCallbackT,
typename ParentHandleT>
114 template<
typename InitFuncT,
typename EventTypeEnum>
116 const EventCallbackT & callback,
118 ParentHandleT parent_handle,
119 EventTypeEnum event_type)
120 : event_callback_(callback)
122 parent_handle_ = parent_handle;
140 EventCallbackInfoT callback_info;
145 "Couldn't take event info: %s", rcl_get_error_string().str);
148 return std::static_pointer_cast<void>(std::make_shared<EventCallbackInfoT>(callback_info));
158 auto callback_ptr = std::static_pointer_cast<EventCallbackInfoT>(data);
159 event_callback_(*callback_ptr);
160 callback_ptr.reset();
167 ParentHandleT parent_handle_;
168 EventCallbackT event_callback_;
173 #endif // RCLCPP__QOS_EVENT_HPP_
rcl_event_t rcl_get_zero_initialized_event(void)
std::shared_ptr< void > take_data() override
Take data so that the callback cannot be scheduled again.
Definition: qos_event.hpp:138
size_t wait_set_event_index_
Definition: qos_event.hpp:107
QOSMessageLostCallbackType message_lost_callback
Definition: qos_event.hpp:66
UnsupportedEventTypeException(rcl_ret_t ret, const rcl_error_state_t *error_state, const std::string &prefix)
rcl_event_t event_handle_
Definition: qos_event.hpp:106
QOSDeadlineOfferedCallbackType deadline_callback
Definition: qos_event.hpp:55
QOSLivelinessChangedCallbackType liveliness_callback
Definition: qos_event.hpp:64
Definition: function_traits.hpp:49
bool is_ready(rcl_wait_set_t *wait_set) override
Check if the Waitable is ready.
Definition: exceptions.hpp:135
Definition: waitable.hpp:29
bool add_to_wait_set(rcl_wait_set_t *wait_set) override
Add the Waitable to a wait set.
size_t get_number_of_ready_events() override
Get the number of ready events.
Contains callbacks for various types of events a Publisher can receive from the middleware.
Definition: qos_event.hpp:53
This header provides the get_node_base_interface() template function.
Definition: allocator_common.hpp:24
#define RCLCPP_PUBLIC
Definition: visibility_control.hpp:50
QOSRequestedIncompatibleQoSCallbackType incompatible_qos_callback
Definition: qos_event.hpp:65
#define RCUTILS_LOG_ERROR_NAMED(name,...)
Definition: qos_event.hpp:69
QOSOfferedIncompatibleQoSCallbackType incompatible_qos_callback
Definition: qos_event.hpp:57
void execute(std::shared_ptr< void > &data) override
Execute any entities of the Waitable that are ready.
Definition: qos_event.hpp:153
rcl_ret_t ret
Definition: exceptions.hpp:142
virtual ~QOSEventHandlerBase()
QOSLivelinessLostCallbackType liveliness_callback
Definition: qos_event.hpp:56
rcl_ret_t rcl_take_event(const rcl_event_t *event, void *event_info)
Contains callbacks for non-message events that a Subscription can receive from the middleware.
Definition: qos_event.hpp:61
void throw_from_rcl_error(rcl_ret_t ret, const std::string &prefix="", const rcl_error_state_t *error_state=nullptr, void(*reset_error)()=rcl_reset_error)
Throw a C++ std::exception which was created based on an rcl error.
#define RCL_RET_UNSUPPORTED
Definition: qos_event.hpp:84
Definition: qos_event.hpp:111
QOSEventHandler(const EventCallbackT &callback, InitFuncT init_func, ParentHandleT parent_handle, EventTypeEnum event_type)
Definition: qos_event.hpp:115
QOSDeadlineRequestedCallbackType deadline_callback
Definition: qos_event.hpp:63