15 #ifndef RCLCPP__WAITABLE_HPP_
16 #define RCLCPP__WAITABLE_HPP_
23 #include "rclcpp/macros.hpp"
24 #include "rclcpp/visibility_control.hpp"
36 RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(
Waitable)
163 std::shared_ptr<void>
181 std::shared_ptr<void>
209 execute(
const std::shared_ptr<void> & data) = 0;
272 std::vector<std::shared_ptr<rclcpp::TimerBase>>
276 std::atomic<bool> in_use_by_wait_set_{
false};
virtual RCLCPP_PUBLIC void add_to_wait_set(rcl_wait_set_t &wait_set)=0
Add the Waitable to a wait set.
virtual RCLCPP_PUBLIC void execute(const std::shared_ptr< void > &data)=0
Execute data that is passed in.
virtual RCLCPP_PUBLIC std::shared_ptr< void > take_data_by_entity_id(size_t id)=0
Take the data so that it can be consumed with execute.
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 std::vector< std::shared_ptr< rclcpp::TimerBase > > get_timers() const =0
Returns all timers used by this waitable.
virtual RCLCPP_PUBLIC size_t get_number_of_ready_clients()
Get the number of ready clients.
virtual RCLCPP_PUBLIC void set_on_ready_callback(std::function< void(size_t, int)> callback)=0
Set a callback to be called whenever the waitable becomes ready.
virtual RCLCPP_PUBLIC bool is_ready(const rcl_wait_set_t &wait_set)=0
Check if the Waitable is ready.
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_subscriptions()
Get the number of ready subscriptions.
virtual RCLCPP_PUBLIC size_t get_number_of_ready_services()
Get the number of ready services.
virtual RCLCPP_PUBLIC void clear_on_ready_callback()=0
Unset any callback registered via set_on_ready_callback.
virtual RCLCPP_PUBLIC std::shared_ptr< void > take_data()=0
Take the data so that it can be consumed with execute.
Versions of rosidl_typesupport_cpp::get_message_type_support_handle that handle adapted types.
Container for subscription's, guard condition's, etc to be waited on.