rmw  master
C API providing a middleware abstraction layer which is used to implement the rest of ROS.
get_service_names_and_types.h File Reference
#include "rmw/macros.h"
#include "rmw/names_and_types.h"
#include "rmw/types.h"
#include "rmw/visibility_control.h"
Include dependency graph for get_service_names_and_types.h:

Go to the source code of this file.


rmw_ret_t rmw_get_service_names_and_types (const rmw_node_t *node, rcutils_allocator_t *allocator, rmw_names_and_types_t *service_names_and_types)
 Return a list of service names and their types. More...

Function Documentation

◆ rmw_get_service_names_and_types()

rmw_ret_t rmw_get_service_names_and_types ( const rmw_node_t node,
rcutils_allocator_t allocator,
rmw_names_and_types_t service_names_and_types 

Return a list of service names and their types.

This function returns a list of service names in the ROS graph and their types.

The node parameter must not be NULL, and must point to a valid node.

The service_names_and_types parameter must be allocated and zero initialized. The service_names_and_types is the output for this function, and contains allocated memory. Therefore, it should be passed to rmw_names_and_types_fini() when it is no longer needed. Failing to do so will result in leaked memory.

[in]nodethe handle to the node being used to query the ROS graph
[in]allocatorallocator to be used when allocating space for strings
[out]service_names_and_typeslist of service names and their types
RMW_RET_OK if the query was successful, or
RMW_RET_INVALID_ARGUMENT if the node is invalid, or
RMW_RET_INVALID_ARGUMENT if any arguments are invalid, or
RMW_RET_BAD_ALLOC if memory allocation fails, or
RMW_RET_ERROR if an unspecified error occurs.