17 #include "rclcpp/waitable.hpp"
22 Waitable::get_number_of_ready_subscriptions()
61 throw std::runtime_error(
62 "Custom waitables should override take_data_by_entity_id "
63 "if they want to use it.");
69 return in_use_by_wait_set_.exchange(in_use_state);
77 throw std::runtime_error(
78 "Custom waitables should override set_on_ready_callback "
79 "if they want to use it.");
85 throw std::runtime_error(
86 "Custom waitables should override clear_on_ready_callback if they "
87 "want to use it and make sure to call it on the waitable destructor.");
100 # pragma GCC diagnostic push
101 # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
103 # pragma warning(push)
104 # pragma warning(disable: 4996)
109 # pragma GCC diagnostic pop
111 # pragma warning(pop)
119 return this->
is_ready(const_wait_set_ref);
126 # pragma GCC diagnostic push
127 # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
129 # pragma warning(push)
130 # pragma warning(disable: 4996)
136 # pragma GCC diagnostic pop
138 # pragma warning(pop)
145 const std::shared_ptr<void> & const_data = data;
153 # pragma GCC diagnostic push
154 # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
156 # pragma warning(push)
157 # pragma warning(disable: 4996)
160 this->
execute(
const_cast<std::shared_ptr<void> &
>(data));
163 # pragma GCC diagnostic pop
165 # pragma warning(pop)
virtual RCLCPP_PUBLIC size_t get_number_of_ready_guard_conditions()
Get the number of ready guard_conditions.
virtual RCLCPP_PUBLIC size_t get_number_of_ready_timers()
Get the number of ready timers.
virtual RCLCPP_PUBLIC void execute(std::shared_ptr< void > &data)
Deprecated.
virtual RCLCPP_PUBLIC std::shared_ptr< void > take_data_by_entity_id(size_t id)
Take the data so that it can be consumed with execute.
virtual RCLCPP_PUBLIC size_t get_number_of_ready_clients()
Get the number of ready clients.
virtual RCLCPP_PUBLIC bool is_ready(rcl_wait_set_t *wait_set)
Deprecated.
virtual RCLCPP_PUBLIC void clear_on_ready_callback()
Unset any callback registered via set_on_ready_callback.
virtual RCLCPP_PUBLIC void add_to_wait_set(rcl_wait_set_t *wait_set)
Deprecated.
virtual RCLCPP_PUBLIC size_t get_number_of_ready_events()
Get the number of ready events.
RCLCPP_PUBLIC bool exchange_in_use_by_wait_set_state(bool in_use_state)
Exchange the "in use by wait set" state for this timer.
virtual RCLCPP_PUBLIC size_t get_number_of_ready_services()
Get the number of ready services.
virtual RCLCPP_PUBLIC void set_on_ready_callback(std::function< void(size_t, int)> callback)
Set a callback to be called whenever the waitable becomes ready.
Container for subscription's, guard condition's, etc to be waited on.