rclcpp
master
C++ ROS Client Library API
|
Go to the documentation of this file.
15 #ifndef RCLCPP__ALLOCATOR__ALLOCATOR_COMMON_HPP_
16 #define RCLCPP__ALLOCATOR__ALLOCATOR_COMMON_HPP_
29 template<
typename T,
typename Alloc>
32 template<
typename Alloc>
35 auto typed_allocator =
static_cast<Alloc *
>(untyped_allocator);
36 if (!typed_allocator) {
42 template<
typename T,
typename Alloc>
45 auto typed_allocator =
static_cast<Alloc *
>(untyped_allocator);
46 if (!typed_allocator) {
49 auto typed_ptr =
static_cast<T *
>(untyped_pointer);
53 template<
typename T,
typename Alloc>
56 auto typed_allocator =
static_cast<Alloc *
>(untyped_allocator);
57 if (!typed_allocator) {
60 auto typed_ptr =
static_cast<T *
>(untyped_pointer);
75 rcl_allocator.
allocate = &retyped_allocate<Alloc>;
76 rcl_allocator.
deallocate = &retyped_deallocate<T, Alloc>;
77 rcl_allocator.
reallocate = &retyped_reallocate<T, Alloc>;
78 rcl_allocator.
state = &allocator;
99 #endif // RCLCPP__ALLOCATOR__ALLOCATOR_COMMON_HPP_
#define rcl_get_default_allocator
This header provides the get_node_base_interface() template function.
Definition: allocator_common.hpp:24
typename std::allocator_traits< Alloc >::template rebind_traits< T > AllocRebind
Definition: allocator_common.hpp:30
void * retyped_allocate(size_t size, void *untyped_allocator)
Definition: allocator_common.hpp:33
void *(* reallocate)(void *pointer, size_t size, void *state)
rcl_allocator_t get_rcl_allocator(Alloc &allocator)
Definition: allocator_common.hpp:71
void * retyped_reallocate(void *untyped_pointer, size_t size, void *untyped_allocator)
Definition: allocator_common.hpp:54
void(* deallocate)(void *pointer, void *state)
void *(* allocate)(size_t size, void *state)
void retyped_deallocate(void *untyped_pointer, void *untyped_allocator)
Definition: allocator_common.hpp:43