rclcpp  master
C++ ROS Client Library API
allocator_memory_strategy.hpp
Go to the documentation of this file.
1 // Copyright 2015 Open Source Robotics Foundation, Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef RCLCPP__STRATEGIES__ALLOCATOR_MEMORY_STRATEGY_HPP_
16 #define RCLCPP__STRATEGIES__ALLOCATOR_MEMORY_STRATEGY_HPP_
17 
18 #include <memory>
19 #include <vector>
20 
21 #include "rcl/allocator.h"
22 
25 #include "rclcpp/node.hpp"
27 
28 #include "rcutils/logging_macros.h"
29 
30 #include "rmw/types.h"
31 
32 namespace rclcpp
33 {
34 namespace memory_strategies
35 {
36 namespace allocator_memory_strategy
37 {
38 
40 
45 template<typename Alloc = std::allocator<void>>
47 {
48 public:
50 
51  using VoidAllocTraits = typename allocator::AllocRebind<void *, Alloc>;
52  using VoidAlloc = typename VoidAllocTraits::allocator_type;
53 
54  explicit AllocatorMemoryStrategy(std::shared_ptr<Alloc> allocator)
55  {
56  allocator_ = std::make_shared<VoidAlloc>(*allocator.get());
57  }
58 
60  {
61  allocator_ = std::make_shared<VoidAlloc>();
62  }
63 
64  void add_guard_condition(const rcl_guard_condition_t * guard_condition) override
65  {
66  for (const auto & existing_guard_condition : guard_conditions_) {
67  if (existing_guard_condition == guard_condition) {
68  return;
69  }
70  }
71  guard_conditions_.push_back(guard_condition);
72  }
73 
74  void remove_guard_condition(const rcl_guard_condition_t * guard_condition) override
75  {
76  for (auto it = guard_conditions_.begin(); it != guard_conditions_.end(); ++it) {
77  if (*it == guard_condition) {
78  guard_conditions_.erase(it);
79  break;
80  }
81  }
82  }
83 
84  void clear_handles() override
85  {
86  subscription_handles_.clear();
87  service_handles_.clear();
88  client_handles_.clear();
89  timer_handles_.clear();
90  waitable_handles_.clear();
91  }
92 
93  void remove_null_handles(rcl_wait_set_t * wait_set) override
94  {
95  // TODO(jacobperron): Check if wait set sizes are what we expect them to be?
96  // e.g. wait_set->size_of_clients == client_handles_.size()
97 
98  // Important to use subscription_handles_.size() instead of wait set's size since
99  // there may be more subscriptions in the wait set due to Waitables added to the end.
100  // The same logic applies for other entities.
101  for (size_t i = 0; i < subscription_handles_.size(); ++i) {
102  if (!wait_set->subscriptions[i]) {
103  subscription_handles_[i].reset();
104  }
105  }
106  for (size_t i = 0; i < service_handles_.size(); ++i) {
107  if (!wait_set->services[i]) {
108  service_handles_[i].reset();
109  }
110  }
111  for (size_t i = 0; i < client_handles_.size(); ++i) {
112  if (!wait_set->clients[i]) {
113  client_handles_[i].reset();
114  }
115  }
116  for (size_t i = 0; i < timer_handles_.size(); ++i) {
117  if (!wait_set->timers[i]) {
118  timer_handles_[i].reset();
119  }
120  }
121  for (size_t i = 0; i < waitable_handles_.size(); ++i) {
122  if (!waitable_handles_[i]->is_ready(wait_set)) {
123  waitable_handles_[i].reset();
124  }
125  }
126 
127  subscription_handles_.erase(
128  std::remove(subscription_handles_.begin(), subscription_handles_.end(), nullptr),
129  subscription_handles_.end()
130  );
131 
132  service_handles_.erase(
133  std::remove(service_handles_.begin(), service_handles_.end(), nullptr),
134  service_handles_.end()
135  );
136 
137  client_handles_.erase(
138  std::remove(client_handles_.begin(), client_handles_.end(), nullptr),
139  client_handles_.end()
140  );
141 
142  timer_handles_.erase(
143  std::remove(timer_handles_.begin(), timer_handles_.end(), nullptr),
144  timer_handles_.end()
145  );
146 
147  waitable_handles_.erase(
148  std::remove(waitable_handles_.begin(), waitable_handles_.end(), nullptr),
149  waitable_handles_.end()
150  );
151  }
152 
153  bool collect_entities(const WeakNodeList & weak_nodes) override
154  {
155  bool has_invalid_weak_nodes = false;
156  for (auto & weak_node : weak_nodes) {
157  auto node = weak_node.lock();
158  if (!node) {
159  has_invalid_weak_nodes = true;
160  continue;
161  }
162  for (auto & weak_group : node->get_callback_groups()) {
163  auto group = weak_group.lock();
164  if (!group || !group->can_be_taken_from().load()) {
165  continue;
166  }
167  group->find_subscription_ptrs_if(
168  [this](const rclcpp::SubscriptionBase::SharedPtr & subscription) {
169  subscription_handles_.push_back(subscription->get_subscription_handle());
170  return false;
171  });
172  group->find_service_ptrs_if(
173  [this](const rclcpp::ServiceBase::SharedPtr & service) {
174  service_handles_.push_back(service->get_service_handle());
175  return false;
176  });
177  group->find_client_ptrs_if(
178  [this](const rclcpp::ClientBase::SharedPtr & client) {
179  client_handles_.push_back(client->get_client_handle());
180  return false;
181  });
182  group->find_timer_ptrs_if(
183  [this](const rclcpp::TimerBase::SharedPtr & timer) {
184  timer_handles_.push_back(timer->get_timer_handle());
185  return false;
186  });
187  group->find_waitable_ptrs_if(
188  [this](const rclcpp::Waitable::SharedPtr & waitable) {
189  waitable_handles_.push_back(waitable);
190  return false;
191  });
192  }
193  }
194  return has_invalid_weak_nodes;
195  }
196 
197  void add_waitable_handle(const rclcpp::Waitable::SharedPtr & waitable) override
198  {
199  if (nullptr == waitable) {
200  throw std::runtime_error("waitable object unexpectedly nullptr");
201  }
202  waitable_handles_.push_back(waitable);
203  }
204 
205  bool add_handles_to_wait_set(rcl_wait_set_t * wait_set) override
206  {
207  for (auto subscription : subscription_handles_) {
208  if (rcl_wait_set_add_subscription(wait_set, subscription.get(), NULL) != RCL_RET_OK) {
210  "rclcpp",
211  "Couldn't add subscription to wait set: %s", rcl_get_error_string().str);
212  return false;
213  }
214  }
215 
216  for (auto client : client_handles_) {
217  if (rcl_wait_set_add_client(wait_set, client.get(), NULL) != RCL_RET_OK) {
219  "rclcpp",
220  "Couldn't add client to wait set: %s", rcl_get_error_string().str);
221  return false;
222  }
223  }
224 
225  for (auto service : service_handles_) {
226  if (rcl_wait_set_add_service(wait_set, service.get(), NULL) != RCL_RET_OK) {
228  "rclcpp",
229  "Couldn't add service to wait set: %s", rcl_get_error_string().str);
230  return false;
231  }
232  }
233 
234  for (auto timer : timer_handles_) {
235  if (rcl_wait_set_add_timer(wait_set, timer.get(), NULL) != RCL_RET_OK) {
237  "rclcpp",
238  "Couldn't add timer to wait set: %s", rcl_get_error_string().str);
239  return false;
240  }
241  }
242 
243  for (auto guard_condition : guard_conditions_) {
244  if (rcl_wait_set_add_guard_condition(wait_set, guard_condition, NULL) != RCL_RET_OK) {
246  "rclcpp",
247  "Couldn't add guard_condition to wait set: %s",
248  rcl_get_error_string().str);
249  return false;
250  }
251  }
252 
253  for (auto waitable : waitable_handles_) {
254  if (!waitable->add_to_wait_set(wait_set)) {
256  "rclcpp",
257  "Couldn't add waitable to wait set: %s", rcl_get_error_string().str);
258  return false;
259  }
260  }
261  return true;
262  }
263 
264  void
266  rclcpp::AnyExecutable & any_exec,
267  const WeakNodeList & weak_nodes) override
268  {
269  auto it = subscription_handles_.begin();
270  while (it != subscription_handles_.end()) {
271  auto subscription = get_subscription_by_handle(*it, weak_nodes);
272  if (subscription) {
273  // Find the group for this handle and see if it can be serviced
274  auto group = get_group_by_subscription(subscription, weak_nodes);
275  if (!group) {
276  // Group was not found, meaning the subscription is not valid...
277  // Remove it from the ready list and continue looking
278  it = subscription_handles_.erase(it);
279  continue;
280  }
281  if (!group->can_be_taken_from().load()) {
282  // Group is mutually exclusive and is being used, so skip it for now
283  // Leave it to be checked next time, but continue searching
284  ++it;
285  continue;
286  }
287  // Otherwise it is safe to set and return the any_exec
288  any_exec.subscription = subscription;
289  any_exec.callback_group = group;
290  any_exec.node_base = get_node_by_group(group, weak_nodes);
291  subscription_handles_.erase(it);
292  return;
293  }
294  // Else, the subscription is no longer valid, remove it and continue
295  it = subscription_handles_.erase(it);
296  }
297  }
298 
299  void
301  rclcpp::AnyExecutable & any_exec,
302  const WeakNodeList & weak_nodes) override
303  {
304  auto it = service_handles_.begin();
305  while (it != service_handles_.end()) {
306  auto service = get_service_by_handle(*it, weak_nodes);
307  if (service) {
308  // Find the group for this handle and see if it can be serviced
309  auto group = get_group_by_service(service, weak_nodes);
310  if (!group) {
311  // Group was not found, meaning the service is not valid...
312  // Remove it from the ready list and continue looking
313  it = service_handles_.erase(it);
314  continue;
315  }
316  if (!group->can_be_taken_from().load()) {
317  // Group is mutually exclusive and is being used, so skip it for now
318  // Leave it to be checked next time, but continue searching
319  ++it;
320  continue;
321  }
322  // Otherwise it is safe to set and return the any_exec
323  any_exec.service = service;
324  any_exec.callback_group = group;
325  any_exec.node_base = get_node_by_group(group, weak_nodes);
326  service_handles_.erase(it);
327  return;
328  }
329  // Else, the service is no longer valid, remove it and continue
330  it = service_handles_.erase(it);
331  }
332  }
333 
334  void
335  get_next_client(rclcpp::AnyExecutable & any_exec, const WeakNodeList & weak_nodes) override
336  {
337  auto it = client_handles_.begin();
338  while (it != client_handles_.end()) {
339  auto client = get_client_by_handle(*it, weak_nodes);
340  if (client) {
341  // Find the group for this handle and see if it can be serviced
342  auto group = get_group_by_client(client, weak_nodes);
343  if (!group) {
344  // Group was not found, meaning the service is not valid...
345  // Remove it from the ready list and continue looking
346  it = client_handles_.erase(it);
347  continue;
348  }
349  if (!group->can_be_taken_from().load()) {
350  // Group is mutually exclusive and is being used, so skip it for now
351  // Leave it to be checked next time, but continue searching
352  ++it;
353  continue;
354  }
355  // Otherwise it is safe to set and return the any_exec
356  any_exec.client = client;
357  any_exec.callback_group = group;
358  any_exec.node_base = get_node_by_group(group, weak_nodes);
359  client_handles_.erase(it);
360  return;
361  }
362  // Else, the service is no longer valid, remove it and continue
363  it = client_handles_.erase(it);
364  }
365  }
366 
367  void
369  rclcpp::AnyExecutable & any_exec,
370  const WeakNodeList & weak_nodes) override
371  {
372  auto it = timer_handles_.begin();
373  while (it != timer_handles_.end()) {
374  auto timer = get_timer_by_handle(*it, weak_nodes);
375  if (timer) {
376  // Find the group for this handle and see if it can be serviced
377  auto group = get_group_by_timer(timer, weak_nodes);
378  if (!group) {
379  // Group was not found, meaning the timer is not valid...
380  // Remove it from the ready list and continue looking
381  it = timer_handles_.erase(it);
382  continue;
383  }
384  if (!group->can_be_taken_from().load()) {
385  // Group is mutually exclusive and is being used, so skip it for now
386  // Leave it to be checked next time, but continue searching
387  ++it;
388  continue;
389  }
390  // Otherwise it is safe to set and return the any_exec
391  any_exec.timer = timer;
392  any_exec.callback_group = group;
393  any_exec.node_base = get_node_by_group(group, weak_nodes);
394  timer_handles_.erase(it);
395  return;
396  }
397  // Else, the service is no longer valid, remove it and continue
398  it = timer_handles_.erase(it);
399  }
400  }
401 
402  void
403  get_next_waitable(rclcpp::AnyExecutable & any_exec, const WeakNodeList & weak_nodes) override
404  {
405  auto it = waitable_handles_.begin();
406  while (it != waitable_handles_.end()) {
407  auto waitable = *it;
408  if (waitable) {
409  // Find the group for this handle and see if it can be serviced
410  auto group = get_group_by_waitable(waitable, weak_nodes);
411  if (!group) {
412  // Group was not found, meaning the waitable is not valid...
413  // Remove it from the ready list and continue looking
414  it = waitable_handles_.erase(it);
415  continue;
416  }
417  if (!group->can_be_taken_from().load()) {
418  // Group is mutually exclusive and is being used, so skip it for now
419  // Leave it to be checked next time, but continue searching
420  ++it;
421  continue;
422  }
423  // Otherwise it is safe to set and return the any_exec
424  any_exec.waitable = waitable;
425  any_exec.callback_group = group;
426  any_exec.node_base = get_node_by_group(group, weak_nodes);
427  waitable_handles_.erase(it);
428  return;
429  }
430  // Else, the waitable is no longer valid, remove it and continue
431  it = waitable_handles_.erase(it);
432  }
433  }
434 
435  rcl_allocator_t get_allocator() override
436  {
437  return rclcpp::allocator::get_rcl_allocator<void *, VoidAlloc>(*allocator_.get());
438  }
439 
440  size_t number_of_ready_subscriptions() const override
441  {
442  size_t number_of_subscriptions = subscription_handles_.size();
443  for (auto waitable : waitable_handles_) {
444  number_of_subscriptions += waitable->get_number_of_ready_subscriptions();
445  }
446  return number_of_subscriptions;
447  }
448 
449  size_t number_of_ready_services() const override
450  {
451  size_t number_of_services = service_handles_.size();
452  for (auto waitable : waitable_handles_) {
453  number_of_services += waitable->get_number_of_ready_services();
454  }
455  return number_of_services;
456  }
457 
458  size_t number_of_ready_events() const override
459  {
460  size_t number_of_events = 0;
461  for (auto waitable : waitable_handles_) {
462  number_of_events += waitable->get_number_of_ready_events();
463  }
464  return number_of_events;
465  }
466 
467  size_t number_of_ready_clients() const override
468  {
469  size_t number_of_clients = client_handles_.size();
470  for (auto waitable : waitable_handles_) {
471  number_of_clients += waitable->get_number_of_ready_clients();
472  }
473  return number_of_clients;
474  }
475 
476  size_t number_of_guard_conditions() const override
477  {
478  size_t number_of_guard_conditions = guard_conditions_.size();
479  for (auto waitable : waitable_handles_) {
480  number_of_guard_conditions += waitable->get_number_of_ready_guard_conditions();
481  }
483  }
484 
485  size_t number_of_ready_timers() const override
486  {
487  size_t number_of_timers = timer_handles_.size();
488  for (auto waitable : waitable_handles_) {
489  number_of_timers += waitable->get_number_of_ready_timers();
490  }
491  return number_of_timers;
492  }
493 
494  size_t number_of_waitables() const override
495  {
496  return waitable_handles_.size();
497  }
498 
499 private:
500  template<typename T>
501  using VectorRebind =
503 
504  VectorRebind<const rcl_guard_condition_t *> guard_conditions_;
505 
506  VectorRebind<std::shared_ptr<const rcl_subscription_t>> subscription_handles_;
507  VectorRebind<std::shared_ptr<const rcl_service_t>> service_handles_;
508  VectorRebind<std::shared_ptr<const rcl_client_t>> client_handles_;
509  VectorRebind<std::shared_ptr<const rcl_timer_t>> timer_handles_;
510  VectorRebind<std::shared_ptr<Waitable>> waitable_handles_;
511 
512  std::shared_ptr<VoidAlloc> allocator_;
513 };
514 
515 } // namespace allocator_memory_strategy
516 } // namespace memory_strategies
517 } // namespace rclcpp
518 
519 #endif // RCLCPP__STRATEGIES__ALLOCATOR_MEMORY_STRATEGY_HPP_
rclcpp::memory_strategy::MemoryStrategy::get_group_by_timer
static rclcpp::CallbackGroup::SharedPtr get_group_by_timer(rclcpp::TimerBase::SharedPtr timer, const WeakNodeList &weak_nodes)
rclcpp::memory_strategy::MemoryStrategy
Delegate for handling memory allocations while the Executor is executing.
Definition: memory_strategy.hpp:41
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::number_of_ready_subscriptions
size_t number_of_ready_subscriptions() const override
Definition: allocator_memory_strategy.hpp:440
rclcpp::memory_strategy::MemoryStrategy::get_client_by_handle
static rclcpp::ClientBase::SharedPtr get_client_by_handle(std::shared_ptr< const rcl_client_t > client_handle, const WeakNodeList &weak_nodes)
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::number_of_ready_services
size_t number_of_ready_services() const override
Definition: allocator_memory_strategy.hpp:449
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::number_of_ready_clients
size_t number_of_ready_clients() const override
Definition: allocator_memory_strategy.hpp:467
std::shared_ptr< VoidAlloc >
std::list< rclcpp::node_interfaces::NodeBaseInterface::WeakPtr >
rclcpp::AnyExecutable::node_base
rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_base
Definition: any_executable.hpp:49
rclcpp::memory_strategy::MemoryStrategy::get_timer_by_handle
static rclcpp::TimerBase::SharedPtr get_timer_by_handle(std::shared_ptr< const rcl_timer_t > timer_handle, const WeakNodeList &weak_nodes)
rclcpp::memory_strategy::MemoryStrategy::get_node_by_group
static rclcpp::node_interfaces::NodeBaseInterface::SharedPtr get_node_by_group(rclcpp::CallbackGroup::SharedPtr group, const WeakNodeList &weak_nodes)
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::number_of_ready_timers
size_t number_of_ready_timers() const override
Definition: allocator_memory_strategy.hpp:485
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::AllocatorMemoryStrategy
AllocatorMemoryStrategy()
Definition: allocator_memory_strategy.hpp:59
std::vector
node.hpp
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::number_of_guard_conditions
size_t number_of_guard_conditions() const override
Definition: allocator_memory_strategy.hpp:476
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy
Delegate for handling memory allocations while the Executor is executing.
Definition: allocator_memory_strategy.hpp:46
std::shared_ptr::get
T get(T... args)
rclcpp::memory_strategy::MemoryStrategy::get_service_by_handle
static rclcpp::ServiceBase::SharedPtr get_service_by_handle(std::shared_ptr< const rcl_service_t > service_handle, const WeakNodeList &weak_nodes)
rcl_guard_condition_t
logging_macros.h
rcl_wait_set_t::timers
const rcl_timer_t ** timers
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::remove_null_handles
void remove_null_handles(rcl_wait_set_t *wait_set) override
Definition: allocator_memory_strategy.hpp:93
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::number_of_ready_events
size_t number_of_ready_events() const override
Definition: allocator_memory_strategy.hpp:458
rclcpp::memory_strategy::MemoryStrategy::get_group_by_service
static rclcpp::CallbackGroup::SharedPtr get_group_by_service(rclcpp::ServiceBase::SharedPtr service, const WeakNodeList &weak_nodes)
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::add_guard_condition
void add_guard_condition(const rcl_guard_condition_t *guard_condition) override
Definition: allocator_memory_strategy.hpp:64
rclcpp
This header provides the get_node_base_interface() template function.
Definition: allocator_common.hpp:24
rclcpp::memory_strategy::MemoryStrategy::get_subscription_by_handle
static rclcpp::SubscriptionBase::SharedPtr get_subscription_by_handle(std::shared_ptr< const rcl_subscription_t > subscriber_handle, const WeakNodeList &weak_nodes)
rcl_wait_set_t::services
const rcl_service_t ** services
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::get_next_waitable
void get_next_waitable(rclcpp::AnyExecutable &any_exec, const WeakNodeList &weak_nodes) override
Definition: allocator_memory_strategy.hpp:403
RCLCPP_SMART_PTR_DEFINITIONS
#define RCLCPP_SMART_PTR_DEFINITIONS(...)
Definition: macros.hpp:36
allocator_common.hpp
RCUTILS_LOG_ERROR_NAMED
#define RCUTILS_LOG_ERROR_NAMED(name,...)
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::get_next_client
void get_next_client(rclcpp::AnyExecutable &any_exec, const WeakNodeList &weak_nodes) override
Definition: allocator_memory_strategy.hpp:335
rcl_wait_set_t::subscriptions
const rcl_subscription_t ** subscriptions
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::VoidAllocTraits
typename allocator::AllocRebind< void *, Alloc > VoidAllocTraits
Definition: allocator_memory_strategy.hpp:51
rclcpp::allocator::AllocRebind
typename std::allocator_traits< Alloc >::template rebind_traits< T > AllocRebind
Definition: allocator_common.hpp:30
rclcpp::memory_strategy::MemoryStrategy::get_group_by_subscription
static rclcpp::CallbackGroup::SharedPtr get_group_by_subscription(rclcpp::SubscriptionBase::SharedPtr subscription, const WeakNodeList &weak_nodes)
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::get_next_service
void get_next_service(rclcpp::AnyExecutable &any_exec, const WeakNodeList &weak_nodes) override
Definition: allocator_memory_strategy.hpp:300
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::VoidAlloc
typename VoidAllocTraits::allocator_type VoidAlloc
Definition: allocator_memory_strategy.hpp:52
rcl_wait_set_t
rclcpp::AnyExecutable
Definition: any_executable.hpp:33
std::runtime_error
rclcpp::memory_strategy::MemoryStrategy::get_group_by_client
static rclcpp::CallbackGroup::SharedPtr get_group_by_client(rclcpp::ClientBase::SharedPtr client, const WeakNodeList &weak_nodes)
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::remove_guard_condition
void remove_guard_condition(const rcl_guard_condition_t *guard_condition) override
Definition: allocator_memory_strategy.hpp:74
rclcpp::AnyExecutable::waitable
rclcpp::Waitable::SharedPtr waitable
Definition: any_executable.hpp:46
std::remove
T remove(T... args)
rclcpp::AnyExecutable::subscription
rclcpp::SubscriptionBase::SharedPtr subscription
Definition: any_executable.hpp:42
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::add_handles_to_wait_set
bool add_handles_to_wait_set(rcl_wait_set_t *wait_set) override
Definition: allocator_memory_strategy.hpp:205
rcl_wait_set_t::clients
const rcl_client_t ** clients
visibility_control.hpp
std
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::collect_entities
bool collect_entities(const WeakNodeList &weak_nodes) override
Definition: allocator_memory_strategy.hpp:153
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::clear_handles
void clear_handles() override
Definition: allocator_memory_strategy.hpp:84
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::get_next_subscription
void get_next_subscription(rclcpp::AnyExecutable &any_exec, const WeakNodeList &weak_nodes) override
Definition: allocator_memory_strategy.hpp:265
rclcpp::AnyExecutable::timer
rclcpp::TimerBase::SharedPtr timer
Definition: any_executable.hpp:43
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::number_of_waitables
size_t number_of_waitables() const override
Definition: allocator_memory_strategy.hpp:494
rclcpp::AnyExecutable::callback_group
rclcpp::CallbackGroup::SharedPtr callback_group
Definition: any_executable.hpp:48
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::get_next_timer
void get_next_timer(rclcpp::AnyExecutable &any_exec, const WeakNodeList &weak_nodes) override
Definition: allocator_memory_strategy.hpp:368
rclcpp::memory_strategy::MemoryStrategy::get_group_by_waitable
static rclcpp::CallbackGroup::SharedPtr get_group_by_waitable(rclcpp::Waitable::SharedPtr waitable, const WeakNodeList &weak_nodes)
rclcpp::AnyExecutable::service
rclcpp::ServiceBase::SharedPtr service
Definition: any_executable.hpp:44
types.h
rclcpp::AnyExecutable::client
rclcpp::ClientBase::SharedPtr client
Definition: any_executable.hpp:45
memory_strategy.hpp
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::get_allocator
rcl_allocator_t get_allocator() override
Definition: allocator_memory_strategy.hpp:435
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::add_waitable_handle
void add_waitable_handle(const rclcpp::Waitable::SharedPtr &waitable) override
Definition: allocator_memory_strategy.hpp:197