rmw
master
C API providing a middleware abstraction layer which is used to implement the rest of ROS.
|
#include "rmw/macros.h"
#include "rmw/names_and_types.h"
#include "rmw/types.h"
#include "rmw/visibility_control.h"
Go to the source code of this file.
Functions | |
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... | |
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] | node | the handle to the node being used to query the ROS graph |
[in] | allocator | allocator to be used when allocating space for strings |
[out] | service_names_and_types | list 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.