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 WeakCallbackGroupsToNodesMap & weak_groups_to_nodes) override
154  {
155  bool has_invalid_weak_groups_or_nodes = false;
156  for (const auto & pair : weak_groups_to_nodes) {
157  auto group = pair.first.lock();
158  auto node = pair.second.lock();
159  if (group == nullptr || node == nullptr) {
160  has_invalid_weak_groups_or_nodes = true;
161  continue;
162  }
163  if (!group || !group->can_be_taken_from().load()) {
164  continue;
165  }
166  group->find_subscription_ptrs_if(
167  [this](const rclcpp::SubscriptionBase::SharedPtr & subscription) {
168  subscription_handles_.push_back(subscription->get_subscription_handle());
169  return false;
170  });
171  group->find_service_ptrs_if(
172  [this](const rclcpp::ServiceBase::SharedPtr & service) {
173  service_handles_.push_back(service->get_service_handle());
174  return false;
175  });
176  group->find_client_ptrs_if(
177  [this](const rclcpp::ClientBase::SharedPtr & client) {
178  client_handles_.push_back(client->get_client_handle());
179  return false;
180  });
181  group->find_timer_ptrs_if(
182  [this](const rclcpp::TimerBase::SharedPtr & timer) {
183  timer_handles_.push_back(timer->get_timer_handle());
184  return false;
185  });
186  group->find_waitable_ptrs_if(
187  [this](const rclcpp::Waitable::SharedPtr & waitable) {
188  waitable_handles_.push_back(waitable);
189  return false;
190  });
191  }
192 
193  return has_invalid_weak_groups_or_nodes;
194  }
195 
196  void add_waitable_handle(const rclcpp::Waitable::SharedPtr & waitable) override
197  {
198  if (nullptr == waitable) {
199  throw std::runtime_error("waitable object unexpectedly nullptr");
200  }
201  waitable_handles_.push_back(waitable);
202  }
203 
204  bool add_handles_to_wait_set(rcl_wait_set_t * wait_set) override
205  {
206  for (auto subscription : subscription_handles_) {
207  if (rcl_wait_set_add_subscription(wait_set, subscription.get(), NULL) != RCL_RET_OK) {
209  "rclcpp",
210  "Couldn't add subscription to wait set: %s", rcl_get_error_string().str);
211  return false;
212  }
213  }
214 
215  for (auto client : client_handles_) {
216  if (rcl_wait_set_add_client(wait_set, client.get(), NULL) != RCL_RET_OK) {
218  "rclcpp",
219  "Couldn't add client to wait set: %s", rcl_get_error_string().str);
220  return false;
221  }
222  }
223 
224  for (auto service : service_handles_) {
225  if (rcl_wait_set_add_service(wait_set, service.get(), NULL) != RCL_RET_OK) {
227  "rclcpp",
228  "Couldn't add service to wait set: %s", rcl_get_error_string().str);
229  return false;
230  }
231  }
232 
233  for (auto timer : timer_handles_) {
234  if (rcl_wait_set_add_timer(wait_set, timer.get(), NULL) != RCL_RET_OK) {
236  "rclcpp",
237  "Couldn't add timer to wait set: %s", rcl_get_error_string().str);
238  return false;
239  }
240  }
241 
242  for (auto guard_condition : guard_conditions_) {
243  if (rcl_wait_set_add_guard_condition(wait_set, guard_condition, NULL) != RCL_RET_OK) {
245  "rclcpp",
246  "Couldn't add guard_condition to wait set: %s",
247  rcl_get_error_string().str);
248  return false;
249  }
250  }
251 
252  for (auto waitable : waitable_handles_) {
253  if (!waitable->add_to_wait_set(wait_set)) {
255  "rclcpp",
256  "Couldn't add waitable to wait set: %s", rcl_get_error_string().str);
257  return false;
258  }
259  }
260  return true;
261  }
262 
263  void
265  rclcpp::AnyExecutable & any_exec,
266  const WeakCallbackGroupsToNodesMap & weak_groups_to_nodes) override
267  {
268  auto it = subscription_handles_.begin();
269  while (it != subscription_handles_.end()) {
270  auto subscription = get_subscription_by_handle(*it, weak_groups_to_nodes);
271  if (subscription) {
272  // Find the group for this handle and see if it can be serviced
273  auto group = get_group_by_subscription(subscription, weak_groups_to_nodes);
274  if (!group) {
275  // Group was not found, meaning the subscription is not valid...
276  // Remove it from the ready list and continue looking
277  it = subscription_handles_.erase(it);
278  continue;
279  }
280  if (!group->can_be_taken_from().load()) {
281  // Group is mutually exclusive and is being used, so skip it for now
282  // Leave it to be checked next time, but continue searching
283  ++it;
284  continue;
285  }
286  // Otherwise it is safe to set and return the any_exec
287  any_exec.subscription = subscription;
288  any_exec.callback_group = group;
289  any_exec.node_base = get_node_by_group(group, weak_groups_to_nodes);
290  subscription_handles_.erase(it);
291  return;
292  }
293  // Else, the subscription is no longer valid, remove it and continue
294  it = subscription_handles_.erase(it);
295  }
296  }
297 
298  void
300  rclcpp::AnyExecutable & any_exec,
301  const WeakCallbackGroupsToNodesMap & weak_groups_to_nodes) override
302  {
303  auto it = service_handles_.begin();
304  while (it != service_handles_.end()) {
305  auto service = get_service_by_handle(*it, weak_groups_to_nodes);
306  if (service) {
307  // Find the group for this handle and see if it can be serviced
308  auto group = get_group_by_service(service, weak_groups_to_nodes);
309  if (!group) {
310  // Group was not found, meaning the service is not valid...
311  // Remove it from the ready list and continue looking
312  it = service_handles_.erase(it);
313  continue;
314  }
315  if (!group->can_be_taken_from().load()) {
316  // Group is mutually exclusive and is being used, so skip it for now
317  // Leave it to be checked next time, but continue searching
318  ++it;
319  continue;
320  }
321  // Otherwise it is safe to set and return the any_exec
322  any_exec.service = service;
323  any_exec.callback_group = group;
324  any_exec.node_base = get_node_by_group(group, weak_groups_to_nodes);
325  service_handles_.erase(it);
326  return;
327  }
328  // Else, the service is no longer valid, remove it and continue
329  it = service_handles_.erase(it);
330  }
331  }
332 
333  void
335  rclcpp::AnyExecutable & any_exec,
336  const WeakCallbackGroupsToNodesMap & weak_groups_to_nodes) override
337  {
338  auto it = client_handles_.begin();
339  while (it != client_handles_.end()) {
340  auto client = get_client_by_handle(*it, weak_groups_to_nodes);
341  if (client) {
342  // Find the group for this handle and see if it can be serviced
343  auto group = get_group_by_client(client, weak_groups_to_nodes);
344  if (!group) {
345  // Group was not found, meaning the service is not valid...
346  // Remove it from the ready list and continue looking
347  it = client_handles_.erase(it);
348  continue;
349  }
350  if (!group->can_be_taken_from().load()) {
351  // Group is mutually exclusive and is being used, so skip it for now
352  // Leave it to be checked next time, but continue searching
353  ++it;
354  continue;
355  }
356  // Otherwise it is safe to set and return the any_exec
357  any_exec.client = client;
358  any_exec.callback_group = group;
359  any_exec.node_base = get_node_by_group(group, weak_groups_to_nodes);
360  client_handles_.erase(it);
361  return;
362  }
363  // Else, the service is no longer valid, remove it and continue
364  it = client_handles_.erase(it);
365  }
366  }
367 
368  void
370  rclcpp::AnyExecutable & any_exec,
371  const WeakCallbackGroupsToNodesMap & weak_groups_to_nodes) override
372  {
373  auto it = timer_handles_.begin();
374  while (it != timer_handles_.end()) {
375  auto timer = get_timer_by_handle(*it, weak_groups_to_nodes);
376  if (timer) {
377  // Find the group for this handle and see if it can be serviced
378  auto group = get_group_by_timer(timer, weak_groups_to_nodes);
379  if (!group) {
380  // Group was not found, meaning the timer is not valid...
381  // Remove it from the ready list and continue looking
382  it = timer_handles_.erase(it);
383  continue;
384  }
385  if (!group->can_be_taken_from().load()) {
386  // Group is mutually exclusive and is being used, so skip it for now
387  // Leave it to be checked next time, but continue searching
388  ++it;
389  continue;
390  }
391  // Otherwise it is safe to set and return the any_exec
392  any_exec.timer = timer;
393  any_exec.callback_group = group;
394  any_exec.node_base = get_node_by_group(group, weak_groups_to_nodes);
395  timer_handles_.erase(it);
396  return;
397  }
398  // Else, the service is no longer valid, remove it and continue
399  it = timer_handles_.erase(it);
400  }
401  }
402 
403  void
405  rclcpp::AnyExecutable & any_exec,
406  const WeakCallbackGroupsToNodesMap & weak_groups_to_nodes) override
407  {
408  auto it = waitable_handles_.begin();
409  while (it != waitable_handles_.end()) {
410  auto waitable = *it;
411  if (waitable) {
412  // Find the group for this handle and see if it can be serviced
413  auto group = get_group_by_waitable(waitable, weak_groups_to_nodes);
414  if (!group) {
415  // Group was not found, meaning the waitable is not valid...
416  // Remove it from the ready list and continue looking
417  it = waitable_handles_.erase(it);
418  continue;
419  }
420  if (!group->can_be_taken_from().load()) {
421  // Group is mutually exclusive and is being used, so skip it for now
422  // Leave it to be checked next time, but continue searching
423  ++it;
424  continue;
425  }
426  // Otherwise it is safe to set and return the any_exec
427  any_exec.waitable = waitable;
428  any_exec.callback_group = group;
429  any_exec.node_base = get_node_by_group(group, weak_groups_to_nodes);
430  waitable_handles_.erase(it);
431  return;
432  }
433  // Else, the waitable is no longer valid, remove it and continue
434  it = waitable_handles_.erase(it);
435  }
436  }
437 
439  {
440  return rclcpp::allocator::get_rcl_allocator<void *, VoidAlloc>(*allocator_.get());
441  }
442 
443  size_t number_of_ready_subscriptions() const override
444  {
445  size_t number_of_subscriptions = subscription_handles_.size();
446  for (auto waitable : waitable_handles_) {
447  number_of_subscriptions += waitable->get_number_of_ready_subscriptions();
448  }
449  return number_of_subscriptions;
450  }
451 
452  size_t number_of_ready_services() const override
453  {
454  size_t number_of_services = service_handles_.size();
455  for (auto waitable : waitable_handles_) {
456  number_of_services += waitable->get_number_of_ready_services();
457  }
458  return number_of_services;
459  }
460 
461  size_t number_of_ready_events() const override
462  {
463  size_t number_of_events = 0;
464  for (auto waitable : waitable_handles_) {
465  number_of_events += waitable->get_number_of_ready_events();
466  }
467  return number_of_events;
468  }
469 
470  size_t number_of_ready_clients() const override
471  {
472  size_t number_of_clients = client_handles_.size();
473  for (auto waitable : waitable_handles_) {
474  number_of_clients += waitable->get_number_of_ready_clients();
475  }
476  return number_of_clients;
477  }
478 
479  size_t number_of_guard_conditions() const override
480  {
481  size_t number_of_guard_conditions = guard_conditions_.size();
482  for (auto waitable : waitable_handles_) {
483  number_of_guard_conditions += waitable->get_number_of_ready_guard_conditions();
484  }
486  }
487 
488  size_t number_of_ready_timers() const override
489  {
490  size_t number_of_timers = timer_handles_.size();
491  for (auto waitable : waitable_handles_) {
492  number_of_timers += waitable->get_number_of_ready_timers();
493  }
494  return number_of_timers;
495  }
496 
497  size_t number_of_waitables() const override
498  {
499  return waitable_handles_.size();
500  }
501 
502 private:
503  template<typename T>
504  using VectorRebind =
506 
507  VectorRebind<const rcl_guard_condition_t *> guard_conditions_;
508 
509  VectorRebind<std::shared_ptr<const rcl_subscription_t>> subscription_handles_;
510  VectorRebind<std::shared_ptr<const rcl_service_t>> service_handles_;
511  VectorRebind<std::shared_ptr<const rcl_client_t>> client_handles_;
512  VectorRebind<std::shared_ptr<const rcl_timer_t>> timer_handles_;
513  VectorRebind<std::shared_ptr<Waitable>> waitable_handles_;
514 
515  std::shared_ptr<VoidAlloc> allocator_;
516 };
517 
518 } // namespace allocator_memory_strategy
519 } // namespace memory_strategies
520 } // namespace rclcpp
521 
522 #endif // RCLCPP__STRATEGIES__ALLOCATOR_MEMORY_STRATEGY_HPP_
rclcpp::memory_strategy::MemoryStrategy
Delegate for handling memory allocations while the Executor is executing.
Definition: memory_strategy.hpp:42
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::number_of_ready_subscriptions
size_t number_of_ready_subscriptions() const override
Definition: allocator_memory_strategy.hpp:443
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::number_of_ready_services
size_t number_of_ready_services() const override
Definition: allocator_memory_strategy.hpp:452
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::number_of_ready_clients
size_t number_of_ready_clients() const override
Definition: allocator_memory_strategy.hpp:470
std::shared_ptr< VoidAlloc >
rclcpp::AnyExecutable::node_base
rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_base
Definition: any_executable.hpp:49
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::number_of_ready_timers
size_t number_of_ready_timers() const override
Definition: allocator_memory_strategy.hpp:488
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:479
rcl_wait_set_add_timer
rcl_ret_t rcl_wait_set_add_timer(rcl_wait_set_t *wait_set, const rcl_timer_t *timer, size_t *index)
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)
rcl_wait_set_add_guard_condition
rcl_ret_t rcl_wait_set_add_guard_condition(rcl_wait_set_t *wait_set, const rcl_guard_condition_t *guard_condition, size_t *index)
rclcpp::memory_strategy::MemoryStrategy::get_group_by_timer
static rclcpp::CallbackGroup::SharedPtr get_group_by_timer(rclcpp::TimerBase::SharedPtr timer, const WeakCallbackGroupsToNodesMap &weak_groups_to_nodes)
rcl_guard_condition_t
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::get_next_subscription
void get_next_subscription(rclcpp::AnyExecutable &any_exec, const WeakCallbackGroupsToNodesMap &weak_groups_to_nodes) override
Definition: allocator_memory_strategy.hpp:264
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:461
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::collect_entities
bool collect_entities(const WeakCallbackGroupsToNodesMap &weak_groups_to_nodes) override
Definition: allocator_memory_strategy.hpp:153
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
rcl_wait_set_t::services
const rcl_service_t ** services
RCLCPP_SMART_PTR_DEFINITIONS
#define RCLCPP_SMART_PTR_DEFINITIONS(...)
Definition: macros.hpp:36
allocator_common.hpp
rclcpp::memory_strategy::MemoryStrategy::get_group_by_service
static rclcpp::CallbackGroup::SharedPtr get_group_by_service(rclcpp::ServiceBase::SharedPtr service, const WeakCallbackGroupsToNodesMap &weak_groups_to_nodes)
RCUTILS_LOG_ERROR_NAMED
#define RCUTILS_LOG_ERROR_NAMED(name,...)
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 WeakCallbackGroupsToNodesMap &weak_groups_to_nodes)
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::get_next_client
void get_next_client(rclcpp::AnyExecutable &any_exec, const WeakCallbackGroupsToNodesMap &weak_groups_to_nodes) override
Definition: allocator_memory_strategy.hpp:334
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
allocator.h
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::VoidAlloc
typename VoidAllocTraits::allocator_type VoidAlloc
Definition: allocator_memory_strategy.hpp:52
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 WeakCallbackGroupsToNodesMap &weak_groups_to_nodes)
rcl_wait_set_t
rclcpp::AnyExecutable
Definition: any_executable.hpp:33
std::runtime_error
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)
std::map< rclcpp::CallbackGroup::WeakPtr, rclcpp::node_interfaces::NodeBaseInterface::WeakPtr, std::owner_less< rclcpp::CallbackGroup::WeakPtr > >
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::get_next_timer
void get_next_timer(rclcpp::AnyExecutable &any_exec, const WeakCallbackGroupsToNodesMap &weak_groups_to_nodes) override
Definition: allocator_memory_strategy.hpp:369
rclcpp::AnyExecutable::subscription
rclcpp::SubscriptionBase::SharedPtr subscription
Definition: any_executable.hpp:42
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 WeakCallbackGroupsToNodesMap &weak_groups_to_nodes)
rcl_wait_set_add_client
rcl_ret_t rcl_wait_set_add_client(rcl_wait_set_t *wait_set, const rcl_client_t *client, size_t *index)
rcutils_allocator_t
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:204
rcl_wait_set_t::clients
const rcl_client_t ** clients
visibility_control.hpp
std
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 WeakCallbackGroupsToNodesMap &weak_groups_to_nodes)
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_waitable
void get_next_waitable(rclcpp::AnyExecutable &any_exec, const WeakCallbackGroupsToNodesMap &weak_groups_to_nodes) override
Definition: allocator_memory_strategy.hpp:404
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:497
rclcpp::AnyExecutable::callback_group
rclcpp::CallbackGroup::SharedPtr callback_group
Definition: any_executable.hpp:48
rclcpp::AnyExecutable::service
rclcpp::ServiceBase::SharedPtr service
Definition: any_executable.hpp:44
types.h
rcl_wait_set_add_service
rcl_ret_t rcl_wait_set_add_service(rcl_wait_set_t *wait_set, const rcl_service_t *service, size_t *index)
rclcpp::memory_strategy::MemoryStrategy::get_group_by_subscription
static rclcpp::CallbackGroup::SharedPtr get_group_by_subscription(rclcpp::SubscriptionBase::SharedPtr subscription, const WeakCallbackGroupsToNodesMap &weak_groups_to_nodes)
RCL_RET_OK
#define RCL_RET_OK
rclcpp::memory_strategy::MemoryStrategy::get_group_by_client
static rclcpp::CallbackGroup::SharedPtr get_group_by_client(rclcpp::ClientBase::SharedPtr client, const WeakCallbackGroupsToNodesMap &weak_groups_to_nodes)
rcl_wait_set_add_subscription
rcl_ret_t rcl_wait_set_add_subscription(rcl_wait_set_t *wait_set, const rcl_subscription_t *subscription, size_t *index)
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::get_next_service
void get_next_service(rclcpp::AnyExecutable &any_exec, const WeakCallbackGroupsToNodesMap &weak_groups_to_nodes) override
Definition: allocator_memory_strategy.hpp:299
rclcpp::memory_strategy::MemoryStrategy::get_group_by_waitable
static rclcpp::CallbackGroup::SharedPtr get_group_by_waitable(rclcpp::Waitable::SharedPtr waitable, const WeakCallbackGroupsToNodesMap &weak_groups_to_nodes)
rclcpp::AnyExecutable::client
rclcpp::ClientBase::SharedPtr client
Definition: any_executable.hpp:45
rclcpp::memory_strategy::MemoryStrategy::get_node_by_group
static rclcpp::node_interfaces::NodeBaseInterface::SharedPtr get_node_by_group(rclcpp::CallbackGroup::SharedPtr group, const WeakCallbackGroupsToNodesMap &weak_groups_to_nodes)
memory_strategy.hpp
rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy::get_allocator
rcl_allocator_t get_allocator() override
Definition: allocator_memory_strategy.hpp:438
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:196