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_
21 #include "rcl/error_handling.h"
70 const rcl_error_state_t * error_state,
105 template<
typename EventCallbackT,
typename ParentHandleT>
109 template<
typename InitFuncT,
typename EventTypeEnum>
111 const EventCallbackT & callback,
113 ParentHandleT parent_handle,
114 EventTypeEnum event_type)
115 : event_callback_(callback)
117 parent_handle_ = parent_handle;
119 rcl_ret_t ret = init_func(&
event_handle_, parent_handle.get(), event_type);
120 if (ret != RCL_RET_OK) {
121 if (ret == RCL_RET_UNSUPPORTED) {
135 EventCallbackInfoT callback_info;
137 rcl_ret_t ret = rcl_take_event(&
event_handle_, &callback_info);
138 if (ret != RCL_RET_OK) {
141 "Couldn't take event info: %s", rcl_get_error_string().str);
145 event_callback_(callback_info);
152 ParentHandleT parent_handle_;
153 EventCallbackT event_callback_;
158 #endif // RCLCPP__QOS_EVENT_HPP_
size_t wait_set_event_index_
Definition: qos_event.hpp:102
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:101
QOSDeadlineOfferedCallbackType deadline_callback
Definition: qos_event.hpp:51
QOSLivelinessChangedCallbackType liveliness_callback
Definition: qos_event.hpp:60
Definition: function_traits.hpp:49
bool is_ready(rcl_wait_set_t *wait_set) override
Check if the Waitable is ready.
Definition: exceptions.hpp:126
Definition: waitable.hpp:28
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:49
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:61
#define RCUTILS_LOG_ERROR_NAMED(name,...)
Definition: qos_event.hpp:64
QOSOfferedIncompatibleQoSCallbackType incompatible_qos_callback
Definition: qos_event.hpp:53
rcl_ret_t ret
Definition: exceptions.hpp:133
virtual ~QOSEventHandlerBase()
QOSLivelinessLostCallbackType liveliness_callback
Definition: qos_event.hpp:52
Contains callbacks for non-message events that a Subscription can receive from the middleware.
Definition: qos_event.hpp:57
void execute() override
Execute any entities of the Waitable that are ready.
Definition: qos_event.hpp:133
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.
Definition: qos_event.hpp:79
Definition: qos_event.hpp:106
QOSEventHandler(const EventCallbackT &callback, InitFuncT init_func, ParentHandleT parent_handle, EventTypeEnum event_type)
Definition: qos_event.hpp:110
QOSDeadlineRequestedCallbackType deadline_callback
Definition: qos_event.hpp:59