Function rcl_wait_set_add_subscription

Function Documentation

rcl_ret_t rcl_wait_set_add_subscription(rcl_wait_set_t *wait_set, const rcl_subscription_t *subscription, size_t *index)

Store a pointer to the given subscription in the next empty spot in the set.

This function does not guarantee that the subscription is not already in the wait set.

Also add the rmw representation to the underlying rmw array and increment the rmw array count.

Attribute

Adherence

Allocates Memory

Yes

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Parameters:
  • wait_set[inout] struct in which the subscription is to be stored

  • subscription[in] the subscription to be added to the wait set

  • index[out] the index of the added subscription in the storage container. This parameter is optional and can be set to NULL to be ignored.

Returns:

RCL_RET_OK if added successfully, or

Returns:

RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or

Returns:

RCL_RET_WAIT_SET_INVALID if the wait set is zero initialized, or

Returns:

RCL_RET_WAIT_SET_FULL if the subscription set is full, or

Returns:

RCL_RET_ERROR if an unspecified error occurs.