Function rmw_topic_endpoint_info_fini
Defined in File topic_endpoint_info.h
Function Documentation
-
rmw_ret_t rmw_topic_endpoint_info_fini(rmw_topic_endpoint_info_t *topic_endpoint_info, rcutils_allocator_t *allocator)
Finalize a topic endpoint info data structure.
This function deallocates all allocated members of the given data structure, and then zero initializes it. If a logical error, such as
RMW_RET_INVALID_ARGUMENT
, ensues, this function will return early, leaving the given data structure 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 topic endpoint info data structure is not synchronized. It is not safe to read or write
topic_endpoint
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 – [inout] Data structure to be finalized.
allocator – [in] Allocator used to populate the given
topic_endpoint_info
.
- Returns:
RMW_RET_OK
if successful, or- Returns:
RMW_RET_INVALID_ARGUMENT
iftopic_endpoint_info
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.