Function rmw_topic_endpoint_info_array_fini
Defined in File topic_endpoint_info_array.h
Function Documentation
-
rmw_ret_t rmw_topic_endpoint_info_array_fini(rmw_topic_endpoint_info_array_t *topic_endpoint_info_array, rcutils_allocator_t *allocator)
Finalize an array of topic endpoint information.
This function deallocates the given array storage, and then zero initializes it. If a logical error, such as
RMW_RET_INVALID_ARGUMENT
, ensues, this function will return early, leaving the given array unchanged. Otherwise, it will proceed despite errors.Attribute
Adherence
Allocates Memory
No
Thread-Safe
No
Uses Atomics
No
Lock-Free
Yes
Remark
This function sets the RMW error state on failure.
- Thread-safety
Finalization is a reentrant procedure, but:
Access to the array of topic endpoint information is not synchronized. It is not safe to read or write
topic_endpoint_info_array
during finalization.The default allocators are thread-safe objects, but any custom
allocator
may not be. Check your allocator documentation for further reference.
- Parameters:
topic_endpoint_info_array – [inout] object to be finalized.
allocator – [in] Allocator used to populate the given
topic_endpoint_info_array
.
- Pre:
Given
allocator
must be the same used to initialize the giventopic_endpoint_info_array
.- Returns:
RMW_RET_OK
if successful, or- Returns:
RMW_RET_INVALID_ARGUMENT
iftopic_endpoint_info_array
is NULL, or- Returns:
RMW_RET_INVALID_ARGUMENT
ifallocator
is invalid, by rcutils_allocator_is_valid() definition, or- Returns:
RMW_RET_ERROR
when an unspecified error occurs.