15 #include "rclcpp/node_interfaces/node_services.hpp"
22 : node_base_(node_base)
25 NodeServices::~NodeServices()
29 NodeServices::add_service(
30 rclcpp::ServiceBase::SharedPtr service_base_ptr,
31 rclcpp::CallbackGroup::SharedPtr group)
41 group->add_service(service_base_ptr);
46 group->trigger_notify_guard_condition();
48 throw std::runtime_error(
49 std::string(
"failed to notify wait set on service creation: ") + ex.what());
54 NodeServices::add_client(
55 rclcpp::ClientBase::SharedPtr client_base_ptr,
56 rclcpp::CallbackGroup::SharedPtr group)
66 group->add_client(client_base_ptr);
71 group->trigger_notify_guard_condition();
73 throw std::runtime_error(
74 std::string(
"failed to notify wait set on client creation: ") + ex.what());
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.
virtual RCLCPP_PUBLIC std::string resolve_topic_or_service_name(const std::string &name, bool is_service, bool only_expand=false) const =0
Expand and remap a given topic or service name.
Implementation of the NodeServices part of the Node API.
RCLCPP_PUBLIC std::string resolve_service_name(const std::string &name, bool only_expand=false) const override
Get the remapped and expanded service name given a input name.