Go to the source code of this file.
◆ rmw_get_zero_initialized_serialized_message
Return a zero initialized serialized message struct.
◆ rmw_serialized_message_init
#define rmw_serialized_message_init |
( |
|
serialized_message, |
|
|
|
message_capacity, |
|
|
|
allocator |
|
) |
| rcutils_uint8_array_init(serialized_message, message_capacity, allocator) |
Initialize a serialized message, zero initializing its contents.
- Precondition
- Given serialized message must have been zero initialized.
- Parameters
-
[in,out] | serialized_message | a pointer to the serialized message to initialize |
[in] | message_capacity | the size of the memory to allocate |
[in] | allocator | the allocator to use for the memory allocation |
- Returns
RMW_RET_OK
if successful, or
-
RMW_RET_INVALID_ARGUMENT
if any arguments are invalid, or
-
'RMW_RET_BAD_ALLOC
if no memory could be allocated correctly, or \return
RMW_RET_ERROR` if an unexpected error occurs
◆ rmw_serialized_message_fini
Finalize a serialized message.
- Precondition
- Given serialized message must have been initialized with
rmw_serialized_message_init()
.
- Parameters
-
[in] | serialized_message | pointer to the serialized message to be cleaned up |
- Returns
RMW_RET_OK
if successful, or
-
RMW_RET_INVALID_ARGUMENT
if serialized_message is invalid, or
-
RMW_RET_ERROR
if an unexpected error occurs
◆ rmw_serialized_message_resize
Resize the internal buffer of the serialized message.
The internal buffer of the serialized message can be resized dynamically if needed. If the new size is smaller than the current capacity, then the memory is truncated.
- Precondition
- Given serialized message must have been initialized with
rmw_serialized_message_init()
.
- Warning
- Be aware that this might deallocate the memory and therefore invalidate any pointers to the internal buffer.
- Parameters
-
[in,out] | serialized_message | pointer to the serialized message to be resized |
[in] | new_size | the new size of the internal buffer |
- Returns
RMW_RET_OK
if successful, or
-
RMW_RET_INVALID_ARGUMENT
if serialized_message is invalid or new_size is set to zero, or
-
RMW_RET_BAD_ALLOC
if memory allocation failed, or
-
RMW_RET_ERROR
if an unexpected error occurs
◆ rmw_serialized_message_t