15 #ifndef RCLCPP__MESSAGE_MEMORY_STRATEGY_HPP_ 16 #define RCLCPP__MESSAGE_MEMORY_STRATEGY_HPP_ 27 namespace message_memory_strategy
32 template<
typename MessageT,
typename Alloc = std::allocator<
void>>
55 return std::make_shared<MessageMemoryStrategy<MessageT, Alloc>>(std::make_shared<Alloc>());
79 #endif // RCLCPP__MESSAGE_MEMORY_STRATEGY_HPP_ Default allocation strategy for messages received by subscriptions.
Definition: message_memory_strategy.hpp:33
virtual std::shared_ptr< MessageT > borrow_message()
By default, dynamically allocate a new message.
Definition: message_memory_strategy.hpp:60
allocator::Deleter< MessageAlloc, MessageT > MessageDeleter
Definition: message_memory_strategy.hpp:40
Definition: allocator_common.hpp:24
virtual void return_message(std::shared_ptr< MessageT > &msg)
Release ownership of the message, which will deallocate it if it has no more owners.
Definition: message_memory_strategy.hpp:67
static SharedPtr create_default()
Default factory method.
Definition: message_memory_strategy.hpp:53
typename std::allocator_traits< Alloc >::template rebind_traits< T > AllocRebind
Definition: allocator_common.hpp:30
#define RCLCPP_SMART_PTR_DEFINITIONS(...)
Definition: macros.hpp:36
allocator::AllocRebind< MessageT, std::allocator< void > > MessageAllocTraits
Definition: message_memory_strategy.hpp:38
std::shared_ptr< MessageAlloc > message_allocator_
Definition: message_memory_strategy.hpp:72
MessageDeleter message_deleter_
Definition: message_memory_strategy.hpp:73
typename std::conditional< std::is_same< typename std::allocator_traits< Alloc >::template rebind_alloc< T >, typename std::allocator< void >::template rebind< T >::other >::value, std::default_delete< T >, AllocatorDeleter< Alloc > >::type Deleter
Definition: allocator_deleter.hpp:101
MessageMemoryStrategy(std::shared_ptr< Alloc > allocator)
Definition: message_memory_strategy.hpp:47
typename MessageAllocTraits::allocator_type MessageAlloc
Definition: message_memory_strategy.hpp:39