Compare commits

...

2 Commits

Author SHA1 Message Date
Tomoya Fujita
f3d55684e7 move message allocator using directives to public.
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
2024-11-18 13:10:40 -08:00
Tomoya Fujita
6fb448e880 accept custom allocator for LoanedMessage.
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
2024-11-12 22:27:42 -08:00

View File

@@ -31,10 +31,10 @@ namespace rclcpp
template<typename MessageT, typename AllocatorT = std::allocator<void>>
class LoanedMessage
{
public:
using MessageAllocatorTraits = rclcpp::allocator::AllocRebind<MessageT, AllocatorT>;
using MessageAllocator = typename MessageAllocatorTraits::allocator_type;
public:
/// Constructor of the LoanedMessage class.
/**
* The constructor of this class allocates memory for a given message type
@@ -58,7 +58,7 @@ public:
*/
LoanedMessage(
const rclcpp::PublisherBase & pub,
std::allocator<MessageT> allocator)
MessageAllocator allocator)
: pub_(pub),
message_(nullptr),
message_allocator_(std::move(allocator))