Function rmw_destroy_subscription
Defined in File rmw.h
Function Documentation
-
rmw_ret_t rmw_destroy_subscription(rmw_node_t *node, rmw_subscription_t *subscription)
Finalize a given subscription handle, reclaim the resources, and deallocate the subscription handle. This function will return early if a logical error, namely
RMW_RET_INVALID_ARGUMENT
orRMW_RET_INCORRECT_RMW_IMPLEMENTATION
, ensues, leaving the given subscription handle unchanged. Otherwise, it will proceed despite errors, freeing as many resources as it can, including the subscription handle, and returnRMW_RET_ERROR
. Usage of a deallocated subscription handle is undefined behavior.Attribute
Adherence
Allocates Memory
No
Thread-Safe
No
Uses Atomics
Maybe [1]
Lock-Free
Maybe [1]
- Pre:
Given node must be the one the subscription was registered with.
- Parameters:
node – [in] Handle to node with which the given subscription is registered
subscription – [in] Handle to subscription to be finalized
- Returns:
RMW_RET_OK
if successful, or- Returns:
RMW_RET_INVALID_ARGUMENT
if node or subscription isNULL
, or- Returns:
RMW_RET_INCORRECT_RMW_IMPLEMENTATION
if node or subscription implementation identifier does not match, or- Returns:
RMW_RET_ERROR
if an unexpected error occurs.