Skip to content

Commit

Permalink
Implement stubs for new 'rmw_count_*' functions (#100)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Hoinkis <simon.hoinkis@apex.ai>
  • Loading branch information
mossmaurice committed Oct 25, 2023
1 parent 46a43ea commit 0f3a1b3
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions rmw_iceoryx_cpp/src/rmw_count.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,46 @@ rmw_count_subscribers(
return RMW_RET_OK;
}

rmw_ret_t
rmw_count_services(
const rmw_node_t * node,
const char * service_name,
size_t * count)
{
RCUTILS_CHECK_ARGUMENT_FOR_NULL(node, RMW_RET_ERROR);
RCUTILS_CHECK_ARGUMENT_FOR_NULL(service_name, RMW_RET_ERROR);
RCUTILS_CHECK_ARGUMENT_FOR_NULL(count, RMW_RET_ERROR);

RMW_CHECK_TYPE_IDENTIFIERS_MATCH(
rmw_count_subscribers
: node, node->implementation_identifier,
rmw_get_implementation_identifier(), return RMW_RET_ERROR);

/// @todo There is no API to find out which 'ServiceDescription' is offered by which node
RMW_SET_ERROR_MSG("rmw_count_services is not supported in iceoryx");
return RMW_RET_UNSUPPORTED;
}

rmw_ret_t
rmw_count_clients(
const rmw_node_t * node,
const char * service_name,
size_t * count)
{
RCUTILS_CHECK_ARGUMENT_FOR_NULL(node, RMW_RET_ERROR);
RCUTILS_CHECK_ARGUMENT_FOR_NULL(service_name, RMW_RET_ERROR);
RCUTILS_CHECK_ARGUMENT_FOR_NULL(count, RMW_RET_ERROR);

RMW_CHECK_TYPE_IDENTIFIERS_MATCH(
rmw_count_subscribers
: node, node->implementation_identifier,
rmw_get_implementation_identifier(), return RMW_RET_ERROR);

/// @todo There is no API to find out which 'ServiceDescription' is offered by which node
RMW_SET_ERROR_MSG("rmw_count_clients is not supported in iceoryx");
return RMW_RET_UNSUPPORTED;
}

rmw_ret_t
rmw_subscription_count_matched_publishers(
const rmw_subscription_t * subscription,
Expand Down

0 comments on commit 0f3a1b3

Please sign in to comment.