Function rcl_publisher_get_subscription_count

Function Documentation

rcl_ret_t rcl_publisher_get_subscription_count(const rcl_publisher_t *publisher, size_t *subscription_count)

Get the number of subscriptions matched to a publisher.

Used to get the internal count of subscriptions matched to a publisher.

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:
  • publisher[in] pointer to the rcl publisher

  • subscription_count[out] number of matched subscriptions

Returns:

RCL_RET_OK if the count was retrieved, or

Returns:

RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or

Returns:

RCL_RET_PUBLISHER_INVALID if the publisher is invalid, or

Returns:

RCL_RET_ERROR if an unspecified error occurs.