rclcpp
master
C++ ROS Client Library API
|
Go to the documentation of this file.
15 #ifndef RCLCPP__EXECUTORS__STATIC_EXECUTOR_ENTITIES_COLLECTOR_HPP_
16 #define RCLCPP__EXECUTORS__STATIC_EXECUTOR_ENTITIES_COLLECTOR_HPP_
37 typedef std::map<rclcpp::CallbackGroup::WeakPtr,
38 rclcpp::node_interfaces::NodeBaseInterface::WeakPtr,
67 rclcpp::memory_strategy::MemoryStrategy::SharedPtr memory_strategy,
121 rclcpp::CallbackGroup::SharedPtr group_ptr,
122 rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr);
132 rclcpp::CallbackGroup::SharedPtr group_ptr,
133 rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr,
143 rclcpp::CallbackGroup::SharedPtr group_ptr);
152 rclcpp::CallbackGroup::SharedPtr group_ptr,
162 rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr);
171 rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr);
249 rclcpp::SubscriptionBase::SharedPtr
258 rclcpp::TimerBase::SharedPtr
267 rclcpp::ServiceBase::SharedPtr
276 rclcpp::ClientBase::SharedPtr
285 rclcpp::Waitable::SharedPtr
297 fill_executable_list();
300 fill_memory_strategy();
309 const rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr,
319 add_callback_groups_from_nodes_associated_to_executor();
325 rclcpp::memory_strategy::MemoryStrategy::SharedPtr memory_strategy_;
332 typedef std::map<rclcpp::node_interfaces::NodeBaseInterface::WeakPtr,
335 WeakNodesToGuardConditionsMap;
336 WeakNodesToGuardConditionsMap weak_nodes_to_guard_conditions_;
348 bool initialized_ =
false;
354 #endif // RCLCPP__EXECUTORS__STATIC_EXECUTOR_ENTITIES_COLLECTOR_HPP_
bool add_node(rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr)
void init(rcl_wait_set_t *p_wait_set, rclcpp::memory_strategy::MemoryStrategy::SharedPtr memory_strategy, rcl_guard_condition_t *executor_guard_condition)
Initialize StaticExecutorEntitiesCollector.
bool add_to_wait_set(rcl_wait_set_t *wait_set) override
size_t get_number_of_clients()
Return number of clients.
Definition: static_executor_entities_collector.hpp:233
~StaticExecutorEntitiesCollector()
std::vector< rclcpp::Waitable::SharedPtr > waitable
Definition: executable_list.hpp:84
bool is_ready(rcl_wait_set_t *wait_set) override
Complete all available queued work without blocking.
std::shared_ptr< void > take_data() override
Take the data so that it can be consumed with execute.
rclcpp::Waitable::SharedPtr get_waitable(size_t i)
Definition: static_executor_entities_collector.hpp:286
size_t number_of_clients
Definition: executable_list.hpp:82
std::vector< rclcpp::CallbackGroup::WeakPtr > get_all_callback_groups()
rclcpp::TimerBase::SharedPtr get_timer(size_t i)
Definition: static_executor_entities_collector.hpp:259
Definition: waitable.hpp:29
void refresh_wait_set(std::chrono::nanoseconds timeout=std::chrono::nanoseconds(-1))
Function to add_handles_to_wait_set and wait for work and.
This header provides the get_node_base_interface() template function.
Definition: allocator_common.hpp:24
std::vector< rclcpp::ServiceBase::SharedPtr > service
Definition: executable_list.hpp:76
#define RCLCPP_PUBLIC
Definition: visibility_control.hpp:50
rclcpp::ServiceBase::SharedPtr get_service(size_t i)
Definition: static_executor_entities_collector.hpp:268
This class contains subscriptionbase, timerbase, etc. which can be used to run callbacks.
Definition: executable_list.hpp:34
std::vector< rclcpp::CallbackGroup::WeakPtr > get_manually_added_callback_groups()
Get callback groups that belong to executor.
#define RCLCPP_SMART_PTR_DEFINITIONS(...)
Definition: macros.hpp:36
void execute(std::shared_ptr< void > &data) override
Execute the waitable.
bool remove_callback_group_from_map(rclcpp::CallbackGroup::SharedPtr group_ptr, WeakCallbackGroupsToNodesMap &weak_groups_to_nodes)
Remove a callback group from the executor.
rclcpp::ClientBase::SharedPtr get_client(size_t i)
Definition: static_executor_entities_collector.hpp:277
size_t get_number_of_services()
Return number of services.
Definition: static_executor_entities_collector.hpp:225
std::vector< rclcpp::ClientBase::SharedPtr > client
Definition: executable_list.hpp:80
std::vector< rclcpp::CallbackGroup::WeakPtr > get_automatically_added_callback_groups_from_nodes()
Get callback groups that belong to executor.
bool add_callback_group(rclcpp::CallbackGroup::SharedPtr group_ptr, rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr)
Add a callback group to an executor.
std::vector< rclcpp::SubscriptionBase::SharedPtr > subscription
Definition: executable_list.hpp:68
size_t number_of_waitables
Definition: executable_list.hpp:86
rclcpp::SubscriptionBase::SharedPtr get_subscription(size_t i)
Definition: static_executor_entities_collector.hpp:250
bool is_init()
Finalize StaticExecutorEntitiesCollector to clear resources.
Definition: static_executor_entities_collector.hpp:73
size_t get_number_of_subscriptions()
Return number of subscriptions.
Definition: static_executor_entities_collector.hpp:217
std::map< rclcpp::CallbackGroup::WeakPtr, rclcpp::node_interfaces::NodeBaseInterface::WeakPtr, std::owner_less< rclcpp::CallbackGroup::WeakPtr > > WeakCallbackGroupsToNodesMap
Definition: static_executor_entities_collector.hpp:39
size_t get_number_of_ready_guard_conditions() override
Get the number of ready guard_conditions.
size_t get_number_of_waitables()
Return number of waitables.
Definition: static_executor_entities_collector.hpp:241
Definition: static_executor_entities_collector.hpp:41
size_t get_number_of_timers()
Return number of timers.
Definition: static_executor_entities_collector.hpp:209
bool remove_callback_group(rclcpp::CallbackGroup::SharedPtr group_ptr)
Remove a callback group from the executor.
size_t number_of_timers
Definition: executable_list.hpp:74
size_t number_of_services
Definition: executable_list.hpp:78
bool remove_node(rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr)
std::vector< rclcpp::TimerBase::SharedPtr > timer
Definition: executable_list.hpp:72
size_t number_of_subscriptions
Definition: executable_list.hpp:70
StaticExecutorEntitiesCollector()=default