Skip to content

Commit 0f3a1b3

Browse files
Implement stubs for new 'rmw_count_*' functions (ros2#100)
Signed-off-by: Simon Hoinkis <[email protected]>
1 parent 46a43ea commit 0f3a1b3

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

rmw_iceoryx_cpp/src/rmw_count.cpp

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,46 @@ rmw_count_subscribers(
8484
return RMW_RET_OK;
8585
}
8686

87+
rmw_ret_t
88+
rmw_count_services(
89+
const rmw_node_t * node,
90+
const char * service_name,
91+
size_t * count)
92+
{
93+
RCUTILS_CHECK_ARGUMENT_FOR_NULL(node, RMW_RET_ERROR);
94+
RCUTILS_CHECK_ARGUMENT_FOR_NULL(service_name, RMW_RET_ERROR);
95+
RCUTILS_CHECK_ARGUMENT_FOR_NULL(count, RMW_RET_ERROR);
96+
97+
RMW_CHECK_TYPE_IDENTIFIERS_MATCH(
98+
rmw_count_subscribers
99+
: node, node->implementation_identifier,
100+
rmw_get_implementation_identifier(), return RMW_RET_ERROR);
101+
102+
/// @todo There is no API to find out which 'ServiceDescription' is offered by which node
103+
RMW_SET_ERROR_MSG("rmw_count_services is not supported in iceoryx");
104+
return RMW_RET_UNSUPPORTED;
105+
}
106+
107+
rmw_ret_t
108+
rmw_count_clients(
109+
const rmw_node_t * node,
110+
const char * service_name,
111+
size_t * count)
112+
{
113+
RCUTILS_CHECK_ARGUMENT_FOR_NULL(node, RMW_RET_ERROR);
114+
RCUTILS_CHECK_ARGUMENT_FOR_NULL(service_name, RMW_RET_ERROR);
115+
RCUTILS_CHECK_ARGUMENT_FOR_NULL(count, RMW_RET_ERROR);
116+
117+
RMW_CHECK_TYPE_IDENTIFIERS_MATCH(
118+
rmw_count_subscribers
119+
: node, node->implementation_identifier,
120+
rmw_get_implementation_identifier(), return RMW_RET_ERROR);
121+
122+
/// @todo There is no API to find out which 'ServiceDescription' is offered by which node
123+
RMW_SET_ERROR_MSG("rmw_count_clients is not supported in iceoryx");
124+
return RMW_RET_UNSUPPORTED;
125+
}
126+
87127
rmw_ret_t
88128
rmw_subscription_count_matched_publishers(
89129
const rmw_subscription_t * subscription,

0 commit comments

Comments
 (0)