Function rmw_service_endpoint_info_fini

Function Documentation

rmw_ret_t rmw_service_endpoint_info_fini(rmw_service_endpoint_info_t *service_endpoint_info, rcutils_allocator_t *allocator)

Finalize a service endpoint info data structure.

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 service endpoint info data structure is not synchronized. It is not safe to read or write service_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:
  • service_endpoint_info[inout] Data structure to be finalized.

  • allocator[in] Allocator used to populate the given service_endpoint_info.

Returns:

RMW_RET_OK if successful, or

Returns:

RMW_RET_INVALID_ARGUMENT if service_endpoint_info is NULL, or

Returns:

RMW_RET_INVALID_ARGUMENT if allocator is invalid, by rcutils_allocator_is_valid() definition, or

Returns:

RMW_RET_ERROR when an unspecified error occurs.