Function rcl_subscription_get_publisher_count

Function Documentation

rmw_ret_t rcl_subscription_get_publisher_count(const rcl_subscription_t *subscription, size_t *publisher_count)

Get the number of publishers matched to a subscription.

Used to get the internal count of publishers matched to a subscription.

Attribute

Adherence

Allocates Memory

No

Thread-Safe

Yes

Uses Atomics

Maybe [1]

Lock-Free

Maybe [1]

[1] only if the underlying rmw doesn’t make use of this feature

Parameters:
  • subscription[in] pointer to the rcl subscription

  • publisher_count[out] number of matched publishers

Returns:

RCL_RET_OK if the count was retrieved, or

Returns:

RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or

Returns:

RCL_RET_SUBSCRIPTION_INVALID if the subscription is invalid, or

Returns:

RCL_RET_ERROR if an unspecified error occurs.