36 typedef void* (*allocator_t)(size_t);
80 template<typename Message, typename Enable = ::std::enable_if_t<::ros::message_traits::IsMessage<Message>::value>>
86 const auto len =
static_cast<uint32_t
>(::ros::serialization::serializationLength(msg));
87 const auto buf =
static_cast<uint8_t*
>(allocator(len));
90 ::ros::serialization::serialize(s, msg);
Utilities for working with ROS message files.
uint8_t * outputRosMessage(allocator_t allocator, const Message &msg)
Allocate enough bytes using the given allocator and serialize the given message into it...
uint8_t * outputByteBuffer(allocator_t allocator, const uint8_t *bytes, size_t length)
Allocate enough bytes using the given allocator and copy the given bytes into the buffer...
void *(* allocator_t)(size_t)
Allocator function that should allocate a buffer of the given size on the caller side and return a po...
char * outputString(allocator_t allocator, const char *string, size_t length)
Allocate enough bytes using the given allocator and copy the given string into the buffer (including ...