From 54667ffbb30be2c17b4889028c8405a403e84b3c Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Mon, 20 Apr 2020 14:31:35 -0500 Subject: [PATCH] Update docs per reviewers Signed-off-by: Michael Carroll --- rmw/include/rmw/message_sequence.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/rmw/include/rmw/message_sequence.h b/rmw/include/rmw/message_sequence.h index 35e857ae..d8e2bad5 100644 --- a/rmw/include/rmw/message_sequence.h +++ b/rmw/include/rmw/message_sequence.h @@ -85,10 +85,17 @@ RMW_PUBLIC rmw_ret_t rmw_message_sequence_fini(rmw_message_sequence_t * sequence); +/// Return an rmw_message_info_sequence_t struct with members initialized to `NULL` RMW_PUBLIC rmw_message_info_sequence_t rmw_get_zero_initialized_message_info_sequence(void); +/// Initialize an rmw_message_info_sequence_t object. +/** + * \param[inout] sequence sequence object to be initialized. + * \param[in] size capacity of the sequence to be allocated. + * \param[in] allocator the allcator used to allocate memory. + */ RMW_PUBLIC rmw_ret_t rmw_message_info_sequence_init( @@ -96,6 +103,15 @@ rmw_message_info_sequence_init( size_t size, rcutils_allocator_t * allocator); +/// Finalize an rmw_message_sequence_t object. +/** + * The rmw_message_sequence_t struct has members which require memory to be allocated to them + * before setting values. + * This function reclaims any allocated resources within the object and zeroes out all other + * members. + * + * \param[inout] sequence sequence object to be finalized. + */ RMW_PUBLIC rmw_ret_t rmw_message_info_sequence_fini(rmw_message_info_sequence_t * sequence);