15 #ifndef RCLCPP__MEMORY_STRATEGY_HPP_
16 #define RCLCPP__MEMORY_STRATEGY_HPP_
24 #include "rclcpp/any_executable.hpp"
25 #include "rclcpp/macros.hpp"
26 #include "rclcpp/node_interfaces/node_base_interface.hpp"
27 #include "rclcpp/visibility_control.hpp"
28 #include "rclcpp/waitable.hpp"
32 namespace memory_strategy
41 class RCLCPP_PUBLIC [[deprecated("The executor does not used this anymore")]]
MemoryStrategy
45 using WeakCallbackGroupsToNodesMap = std::map<rclcpp::CallbackGroup::WeakPtr,
46 rclcpp::node_interfaces::NodeBaseInterface::WeakPtr,
47 std::owner_less<rclcpp::CallbackGroup::WeakPtr>>;
51 virtual bool collect_entities(
const WeakCallbackGroupsToNodesMap & weak_groups_to_nodes) = 0;
53 virtual size_t number_of_ready_subscriptions()
const = 0;
54 virtual size_t number_of_ready_services()
const = 0;
55 virtual size_t number_of_ready_clients()
const = 0;
56 virtual size_t number_of_ready_events()
const = 0;
57 virtual size_t number_of_ready_timers()
const = 0;
58 virtual size_t number_of_guard_conditions()
const = 0;
59 virtual size_t number_of_waitables()
const = 0;
61 virtual void add_waitable_handle(
const rclcpp::Waitable::SharedPtr & waitable) = 0;
62 virtual bool add_handles_to_wait_set(
rcl_wait_set_t * wait_set) = 0;
63 virtual void clear_handles() = 0;
73 get_next_subscription(
75 const WeakCallbackGroupsToNodesMap & weak_groups_to_nodes) = 0;
80 const WeakCallbackGroupsToNodesMap & weak_groups_to_nodes) = 0;
85 const WeakCallbackGroupsToNodesMap & weak_groups_to_nodes) = 0;
90 const WeakCallbackGroupsToNodesMap & weak_groups_to_nodes) = 0;
95 const WeakCallbackGroupsToNodesMap & weak_groups_to_nodes) = 0;
100 static rclcpp::SubscriptionBase::SharedPtr
101 get_subscription_by_handle(
102 const std::shared_ptr<const rcl_subscription_t> & subscriber_handle,
103 const WeakCallbackGroupsToNodesMap & weak_groups_to_nodes);
105 static rclcpp::ServiceBase::SharedPtr
106 get_service_by_handle(
107 const std::shared_ptr<const rcl_service_t> & service_handle,
108 const WeakCallbackGroupsToNodesMap & weak_groups_to_nodes);
110 static rclcpp::ClientBase::SharedPtr
111 get_client_by_handle(
112 const std::shared_ptr<const rcl_client_t> & client_handle,
113 const WeakCallbackGroupsToNodesMap & weak_groups_to_nodes);
115 static rclcpp::TimerBase::SharedPtr
117 const std::shared_ptr<const rcl_timer_t> & timer_handle,
118 const WeakCallbackGroupsToNodesMap & weak_groups_to_nodes);
120 static rclcpp::node_interfaces::NodeBaseInterface::SharedPtr
122 const rclcpp::CallbackGroup::SharedPtr & group,
123 const WeakCallbackGroupsToNodesMap & weak_groups_to_nodes);
125 static rclcpp::CallbackGroup::SharedPtr
126 get_group_by_subscription(
127 const rclcpp::SubscriptionBase::SharedPtr & subscription,
128 const WeakCallbackGroupsToNodesMap & weak_groups_to_nodes);
130 static rclcpp::CallbackGroup::SharedPtr
131 get_group_by_service(
132 const rclcpp::ServiceBase::SharedPtr & service,
133 const WeakCallbackGroupsToNodesMap & weak_groups_to_nodes);
135 static rclcpp::CallbackGroup::SharedPtr
137 const rclcpp::ClientBase::SharedPtr & client,
138 const WeakCallbackGroupsToNodesMap & weak_groups_to_nodes);
140 static rclcpp::CallbackGroup::SharedPtr
142 const rclcpp::TimerBase::SharedPtr & timer,
143 const WeakCallbackGroupsToNodesMap & weak_groups_to_nodes);
145 static rclcpp::CallbackGroup::SharedPtr
146 get_group_by_waitable(
147 const rclcpp::Waitable::SharedPtr & waitable,
148 const WeakCallbackGroupsToNodesMap & weak_groups_to_nodes);
rcutils_allocator_t rcl_allocator_t
Encapsulation of an allocator.
A condition that can be waited on in a single wait set and asynchronously triggered.
Delegate for handling memory allocations while the Executor is executing.
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.