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_topic_names_and_types (const rmw_node_t *node, rcutils_allocator_t *allocator, bool no_demangle, rmw_names_and_types_t *topic_names_and_types) |
Return all topic names and types in the ROS graph. More... | |
rmw_ret_t rmw_get_topic_names_and_types | ( | const rmw_node_t * | node, |
rcutils_allocator_t * | allocator, | ||
bool | no_demangle, | ||
rmw_names_and_types_t * | topic_names_and_types | ||
) |
Return all topic names and types in the ROS graph.
This function returns an array of all topic names and types in the ROS graph i.e. for which a publisher and/or a subscription exists, as discovered so far by the given local node.
Unless no_demangle
is true, some demangling and filtering may take place when listing topics as implemented by the middleware. Whether demangling applies or not, and how it applies, depends on the underlying implementation. See http://design.ros2.org/articles/topic_and_service_names.html for an example on how it is used in DDS and RTPS based implementations.
Attribute | Adherence |
---|---|
Allocates Memory | Yes |
Thread-Safe | Yes |
Uses Atomics | Maybe [1] |
Lock-Free | Maybe [1] |
[1] rmw implementation defined, check the implementation documentation
topic_names_and_types
while rmw_get_topic_names_and_types() uses it.allocator
may not be. Check your allocator documentation for further reference.node
must be a valid node handle, as returned by rmw_create_node(). topic_names_and_types
must be a zero-initialized array of names and types, as returned by rmw_get_zero_initialized_names_and_types().[in] | node | Node to query the ROS graph. |
[in] | allocator | Allocator to be used when populating the topic_names_and_types array. |
[in] | no_demangle | Whether to demangle all topic names following ROS conventions or not. |
[out] | topic_names_and_types | Array of topic names and their types, populated on success but left unchanged on failure. If populated, it is up to the caller to finalize this array later on using rmw_names_and_types_fini(). |
RMW_RET_OK
if the query was successful, or RMW_RET_INVALID_ARGUMENT
if node
is NULL, or RMW_RET_INVALID_ARGUMENT
if allocator
is not valid, by rcutils_allocator_is_valid() definition, or RMW_RET_INVALID_ARGUMENT
if topic_names_and_types
is NULL, or RMW_RET_INVALID_ARGUMENT
if topic_names_and_types
is not a zero-initialized array, or RMW_RET_INCORRECT_RMW_IMPLEMENTATION
if the node
implementation identifier does not match this implementation, or RMW_RET_BAD_ALLOC
if memory allocation fails, or RMW_RET_ERROR
if an unspecified error occurs.