15 #ifndef RCLCPP__NODE_INTERFACES__NODE_BASE_HPP_ 16 #define RCLCPP__NODE_INTERFACES__NODE_BASE_HPP_ 29 namespace node_interfaces
40 const std::string & node_name,
41 const std::string & namespace_,
42 rclcpp::context::Context::SharedPtr context);
60 rclcpp::context::Context::SharedPtr
75 std::shared_ptr<rcl_node_t>
80 std::shared_ptr<const rcl_node_t>
85 rclcpp::callback_group::CallbackGroup::SharedPtr
90 rclcpp::callback_group::CallbackGroup::SharedPtr
100 const std::vector<rclcpp::callback_group::CallbackGroup::WeakPtr> &
115 std::unique_lock<std::recursive_mutex>
121 rclcpp::context::Context::SharedPtr context_;
123 std::shared_ptr<rcl_node_t> node_handle_;
125 rclcpp::callback_group::CallbackGroup::SharedPtr default_callback_group_;
126 std::vector<rclcpp::callback_group::CallbackGroup::WeakPtr> callback_groups_;
128 std::atomic_bool associated_with_executor_;
131 mutable std::recursive_mutex notify_guard_condition_mutex_;
133 bool notify_guard_condition_is_valid_;
139 #endif // RCLCPP__NODE_INTERFACES__NODE_BASE_HPP_ virtual rclcpp::callback_group::CallbackGroup::SharedPtr create_callback_group(rclcpp::callback_group::CallbackGroupType group_type)
Create and return a callback group.
virtual bool callback_group_in_node(rclcpp::callback_group::CallbackGroup::SharedPtr group)
Return true if the given callback group is associated with this node.
NodeBase(const std::string &node_name, const std::string &namespace_, rclcpp::context::Context::SharedPtr context)
virtual std::unique_lock< std::recursive_mutex > acquire_notify_guard_condition_lock() const
Acquire and return a scoped lock that protects the notify guard condition.
#define RCLCPP_DISABLE_COPY(...)
Definition: macros.hpp:26
#define RCLCPP_SMART_PTR_ALIASES_ONLY(...)
Definition: macros.hpp:66
CallbackGroupType
Definition: callback_group.hpp:43
Definition: allocator_common.hpp:24
virtual rclcpp::context::Context::SharedPtr get_context()
Return the context of the node.
virtual std::shared_ptr< rcl_node_t > get_shared_rcl_node_handle()
Return the rcl_node_t node handle in a std::shared_ptr.
rcl_guard_condition_t rcl_get_zero_initialized_guard_condition(void)
Implementation of the NodeBase part of the Node API.
Definition: node_base.hpp:33
virtual const std::vector< rclcpp::callback_group::CallbackGroup::WeakPtr > & get_callback_groups() const
Return list of callback groups associated with this node.
Pure virtual interface class for the NodeBase part of the Node API.
Definition: node_base_interface.hpp:36
virtual const char * get_name() const
Return the name of the node.
virtual rcl_node_t * get_rcl_node_handle()
Return the rcl_node_t node handle (non-const version).
virtual rclcpp::callback_group::CallbackGroup::SharedPtr get_default_callback_group()
Return the default callback group.
#define RCLCPP_PUBLIC
Definition: visibility_control.hpp:50
virtual std::atomic_bool & get_associated_with_executor_atomic()
Return the atomic bool which is used to ensure only one executor is used.
virtual const char * get_namespace() const
Return the namespace of the node.
virtual rcl_guard_condition_t * get_notify_guard_condition()
Return guard condition that should be notified when the internal node state changes.