Skip to content

Commit e185d65

Browse files
authored
Include node namespaces in get_node_names() (#148)
* Include node namespaces in get_node_names(). * Update documentation for get_node_names. * Refinement/clarification of documentation. * wrap after sentence
1 parent e9a397d commit e185d65

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

rmw/include/rmw/rmw.h

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,12 +469,40 @@ rmw_wait(
469469
rmw_wait_set_t * wait_set,
470470
const rmw_time_t * wait_timeout);
471471

472+
/// Return a list of node name and namespaces discovered via a node.
473+
/**
474+
* This function will return a list of node names and a list of node namespaces
475+
* that are discovered via the middleware.
476+
* The two lists represent pairs of namespace and name for each discovered
477+
* node.
478+
* The lists will be the same length and the same position will refer to the
479+
* same node across lists.
480+
*
481+
* The node parameter must not be `NULL`, and must point to a valid node.
482+
*
483+
* The node_names parameter must not be `NULL`, and must point to a valid
484+
* string array.
485+
*
486+
* The node_namespaces parameter must not be `NULL`, and must point to a
487+
* valid string array.
488+
*
489+
* This function does manipulate heap memory.
490+
* This function is not thread-safe.
491+
* This function is lock-free.
492+
*
493+
* \param[in] node the handle to the node being used to query the ROS graph
494+
* \param[out] node_names a list of discovered node names
495+
* \param[out] node_namespaces a list of discovered node namespaces
496+
* \return `RMW_RET_OK` if node the query was made successfully, or
497+
* \return `RMW_RET_ERROR` if an unspecified error occurs.
498+
*/
472499
RMW_PUBLIC
473500
RMW_WARN_UNUSED
474501
rmw_ret_t
475502
rmw_get_node_names(
476503
const rmw_node_t * node,
477-
rcutils_string_array_t * node_names);
504+
rcutils_string_array_t * node_names,
505+
rcutils_string_array_t * node_namespaces);
478506

479507
RMW_PUBLIC
480508
RMW_WARN_UNUSED

0 commit comments

Comments
 (0)