15 #include "rclcpp/node_interfaces/node_waitables.hpp"
22 : node_base_(node_base)
25 NodeWaitables::~NodeWaitables()
29 NodeWaitables::add_waitable(
30 rclcpp::Waitable::SharedPtr waitable_ptr,
31 rclcpp::CallbackGroup::SharedPtr group)
41 group->add_waitable(waitable_ptr);
46 group->trigger_notify_guard_condition();
48 throw std::runtime_error(
49 std::string(
"failed to notify wait set on waitable creation: ") + ex.what());
55 rclcpp::Waitable::SharedPtr waitable_ptr,
56 rclcpp::CallbackGroup::SharedPtr group) noexcept
59 if (!node_base_->callback_group_in_node(group)) {
62 group->remove_waitable(waitable_ptr);
64 node_base_->get_default_callback_group()->remove_waitable(waitable_ptr);
Thrown when a callback group is missing from the node, when it wants to utilize the group.
Created when the return code does not match one of the other specialized exceptions.
Pure virtual interface class for the NodeBase part of the Node API.
virtual RCLCPP_PUBLIC void trigger_notify_guard_condition()=0
Trigger the guard condition that notifies of internal node state changes.
virtual RCLCPP_PUBLIC bool callback_group_in_node(rclcpp::CallbackGroup::SharedPtr group)=0
Return true if the given callback group is associated with this node.
virtual RCLCPP_PUBLIC rclcpp::CallbackGroup::SharedPtr get_default_callback_group()=0
Return the default callback group.
Implementation of the NodeWaitables part of the Node API.
RCLCPP_PUBLIC void remove_waitable(rclcpp::Waitable::SharedPtr waitable_ptr, rclcpp::CallbackGroup::SharedPtr group) noexcept override