Skip to content

Commit

Permalink
Add function for getting clients by node (#179)
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Perron <[email protected]>
  • Loading branch information
jacobperron authored Jul 9, 2019
1 parent 2250b3e commit 9f2e181
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions rmw/include/rmw/get_node_info_and_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,41 @@ rmw_get_service_names_and_types_by_node(
const char * node_namespace,
rmw_names_and_types_t * service_names_and_types);

/// Return a list of service client topic names and their types.
/**
* This function returns a list of service client topic names and their types.
*
* The node parameter must not be `NULL`, and must point to a valid node.
*
* The topic_names_and_types parameter must be allocated and zero initialized.
* The topic_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.
*
* \param[in] node the handle to the node being used to query the ROS graph
* \param[in] allocator allocator to be used when allocating space for strings
* \param[in] node_name the name of the node to get information for
* \param[in] node_namespace the namespace of the node to get information for
* \param[out] topic_names_and_types list of topic names and their types the
* node_name has created a service client for
* \return `RMW_RET_OK` if the query was successful, or
* \return `RMW_RET_INVALID_ARGUMENT` if the node is invalid, or
* \return `RMW_RET_INVALID_ARGUMENT` if any arguments are invalid, or
* \return `RMW_RET_BAD_ALLOC` if memory allocation fails, or
* \return `RMW_RET_ERROR` if an unspecified error occurs.
*/
RMW_PUBLIC
RMW_WARN_UNUSED
rmw_ret_t
rmw_get_client_names_and_types_by_node(
const rmw_node_t * node,
rcutils_allocator_t * allocator,
const char * node_name,
const char * node_namespace,
rmw_names_and_types_t * service_names_and_types);

#ifdef __cplusplus
}
#endif
Expand Down

0 comments on commit 9f2e181

Please sign in to comment.