Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Methods to retrieve matched counts on publisher and subscriber #155

Merged
merged 4 commits into from
Nov 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions rmw/include/rmw/rmw.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,24 @@ RMW_WARN_UNUSED
rmw_ret_t
rmw_publish(const rmw_publisher_t * publisher, const void * ros_message);

/// Retrieve the number of matched subscriptions to a publisher.
/**
* Query the underlying middleware to determine how many subscriptions are
* matched to a given publisher.
*
* \param[in] publisher the publisher object to inspect
* \param[out] subscription_count the number of subscriptions matched
* \return `RMW_RET_OK` if successful, or
* \return `RMW_RET_INVALID_ARGUMENT` if either argument is null, or
* \return `RMW_RET_ERROR` if an unexpected error occurs.
mjcarroll marked this conversation as resolved.
Show resolved Hide resolved
*/
RMW_PUBLIC
RMW_WARN_UNUSED
rmw_ret_t
rmw_publisher_count_matched_subscriptions(
const rmw_publisher_t * publisher,
size_t * subscription_count);

/// Publish an already serialized message.
/**
* The publisher must already be registered with the correct message type
Expand Down Expand Up @@ -267,6 +285,24 @@ RMW_WARN_UNUSED
rmw_ret_t
rmw_destroy_subscription(rmw_node_t * node, rmw_subscription_t * subscription);

/// Retrieve the number of matched publishers to a subscription.
/**
* Query the underlying middleware to determine how many publishers are
* matched to a given subscription.
*
* \param[in] subscription the subscription object to inspect
* \param[out] publisher_count the number of publishers matched
* \return `RMW_RET_OK` if successful, or
* \return `RMW_RET_INVALID_ARGUMENT` if either argument is null, or
* \return `RMW_RET_ERROR` if an unexpected error occurs.
*/
RMW_PUBLIC
RMW_WARN_UNUSED
rmw_ret_t
rmw_subscription_count_matched_publishers(
const rmw_subscription_t * subscription,
size_t * publisher_count);

RMW_PUBLIC
RMW_WARN_UNUSED
rmw_ret_t
Expand Down