rmw_dds_common  master
Define a common interface between DDS implementations of ROS middleware.
Typedefs | Functions
Introspection_api

Methods used to introspect the GraphCache. More...

Typedefs

using rmw_dds_common::GraphCache::DemangleFunctionT = std::function< std::string(const std::string &)>
 

Functions

rmw_ret_t rmw_dds_common::GraphCache::get_writer_count (const std::string &topic_name, size_t *count) const
 Get the number of publishers of a topic. More...
 
rmw_ret_t rmw_dds_common::GraphCache::get_reader_count (const std::string &topic_name, size_t *count) const
 Get the number of subscriptions of a topic. More...
 
rmw_ret_t rmw_dds_common::GraphCache::get_writers_info_by_topic (const std::string &topic_name, DemangleFunctionT demangle_type, rcutils_allocator_t *allocator, rmw_topic_endpoint_info_array_t *endpoints_info) const
 Get an array with information about the writers in a topic. More...
 
rmw_ret_t rmw_dds_common::GraphCache::get_readers_info_by_topic (const std::string &topic_name, DemangleFunctionT demangle_type, rcutils_allocator_t *allocator, rmw_topic_endpoint_info_array_t *endpoints_info) const
 Get an array with information about the readers in a topic. More...
 
rmw_ret_t rmw_dds_common::GraphCache::get_names_and_types (DemangleFunctionT demangle_topic, DemangleFunctionT demangle_type, rcutils_allocator_t *allocator, rmw_names_and_types_t *topic_names_and_types) const
 Get all the topic names and types. More...
 
rmw_ret_t rmw_dds_common::GraphCache::get_writer_names_and_types_by_node (const std::string &node_name, const std::string &namespace_, DemangleFunctionT demangle_topic, DemangleFunctionT demangle_type, rcutils_allocator_t *allocator, rmw_names_and_types_t *topic_names_and_types) const
 Get the topic names and types that a node is publishing. More...
 
rmw_ret_t rmw_dds_common::GraphCache::get_reader_names_and_types_by_node (const std::string &node_name, const std::string &namespace_, DemangleFunctionT demangle_topic, DemangleFunctionT demangle_type, rcutils_allocator_t *allocator, rmw_names_and_types_t *topic_names_and_types) const
 Get the topic names and types that a node is subscribing. More...
 
size_t rmw_dds_common::GraphCache::get_number_of_nodes () const
 Get the number of nodes that have been discovered. More...
 
rmw_ret_t rmw_dds_common::GraphCache::get_node_names (rcutils_string_array_t *node_names, rcutils_string_array_t *node_namespaces, rcutils_string_array_t *enclaves, rcutils_allocator_t *allocator) const
 Copy the names and namespaces of the discovered nodes. More...
 

Detailed Description

Methods used to introspect the GraphCache.

Typedef Documentation

◆ DemangleFunctionT

Function Documentation

◆ get_writer_count()

rmw_ret_t rmw_dds_common::GraphCache::get_writer_count ( const std::string topic_name,
size_t *  count 
) const

Get the number of publishers of a topic.

Parameters
[in]topic_nameName of the topic.
[out]countThe result will be populated there.
Returns
RMW_RET_INVALID_ARGUMENT if count is nullptr, or
RMW_RET_ERROR if an unexpected error take place, or
RMW_RET_OK.

◆ get_reader_count()

rmw_ret_t rmw_dds_common::GraphCache::get_reader_count ( const std::string topic_name,
size_t *  count 
) const

Get the number of subscriptions of a topic.

Parameters
[in]topic_nameName of the topic.
[out]countThe result will be populated there.
Returns
RMW_RET_INVALID_ARGUMENT if count is nullptr, or
RMW_RET_ERROR if an unexpected error take place, or
RMW_RET_OK.

◆ get_writers_info_by_topic()

rmw_ret_t rmw_dds_common::GraphCache::get_writers_info_by_topic ( const std::string topic_name,
DemangleFunctionT  demangle_type,
rcutils_allocator_t allocator,
rmw_topic_endpoint_info_array_t endpoints_info 
) const

Get an array with information about the writers in a topic.

Parameters
[in]topic_nameName of the topic.
[in]demangle_typeFunction that takes a type names and return it demangled.
[in]allocatorUsed to allocate memory.
[out]endpoints_infoArray with the writers information.
Returns
RMW_RET_INVALID_ARGUMENT if count is nullptr, or
RMW_RET_ERROR if an unexpected error take place, or
RMW_RET_OK.

◆ get_readers_info_by_topic()

rmw_ret_t rmw_dds_common::GraphCache::get_readers_info_by_topic ( const std::string topic_name,
DemangleFunctionT  demangle_type,
rcutils_allocator_t allocator,
rmw_topic_endpoint_info_array_t endpoints_info 
) const

Get an array with information about the readers in a topic.

Parameters
[in]topic_nameName of the topic.
[in]demangle_typeFunction that takes a type names and return it demangled.
[in]allocatorUsed to allocate memory.
[out]endpoints_infoArray with the readers information.
Returns
RMW_RET_INVALID_ARGUMENT if count is nullptr, or
RMW_RET_ERROR if an unexpected error take place, or
RMW_RET_OK.

◆ get_names_and_types()

rmw_ret_t rmw_dds_common::GraphCache::get_names_and_types ( DemangleFunctionT  demangle_topic,
DemangleFunctionT  demangle_type,
rcutils_allocator_t allocator,
rmw_names_and_types_t topic_names_and_types 
) const

Get all the topic names and types.

Parameters
[in]demangle_topicFunction that indicates how a dds topic name is demangled into a ros topic name.
[in]demangle_typeFunction that indicates how a dds type name is demangled into a ros type name.
[in]allocator.
[in,out]topic_names_and_typesA zero initialized names and types object, that will be populated with the result.
Returns
RMW_RET_NODE_NAME_NON_EXISTENT if the node doesn't exist, or
RMW_RET_INVALID_ARGUMENT if an argument is invalid, or
RMW_RET_BAD_ALLOC if an allocation failed, or
RMW_RET_ERROR if an unexpected error happened, or
RMW_RET_OK.

◆ get_writer_names_and_types_by_node()

rmw_ret_t rmw_dds_common::GraphCache::get_writer_names_and_types_by_node ( const std::string node_name,
const std::string namespace_,
DemangleFunctionT  demangle_topic,
DemangleFunctionT  demangle_type,
rcutils_allocator_t allocator,
rmw_names_and_types_t topic_names_and_types 
) const

Get the topic names and types that a node is publishing.

Parameters
[in]node_nameName of the node.
[in]node_namespaceNamespace of the node.
[in]demangle_topicFunction that indicates how a dds topic name is demangled into a ros topic name.
[in]demangle_typeFunction that indicates how a dds type name is demangled into a ros type name.
[in]allocator
[in,out]topic_names_and_typesA zero initialized names and types object, that will be populated with the result.
Returns
RMW_RET_NODE_NAME_NON_EXISTENT if the node doesn't exist, or
RMW_RET_INVALID_ARGUMENT if an argument is invalid, or
RMW_RET_BAD_ALLOC if an allocation failed, or
RMW_RET_ERROR if an unexpected error happened, or
RMW_RET_OK.

◆ get_reader_names_and_types_by_node()

rmw_ret_t rmw_dds_common::GraphCache::get_reader_names_and_types_by_node ( const std::string node_name,
const std::string namespace_,
DemangleFunctionT  demangle_topic,
DemangleFunctionT  demangle_type,
rcutils_allocator_t allocator,
rmw_names_and_types_t topic_names_and_types 
) const

Get the topic names and types that a node is subscribing.

Parameters
[in]node_nameName of the node.
[in]node_namespaceNamespace of the node.
[in]demangle_topicFunction that indicates how a dds topic name is demangled into a ros topic name.
[in]demangle_typeFunction that indicates how a dds type name is demangled into a ros type name.
[in]allocator.
[in,out]topic_names_and_typesA zero initialized names and types object, that will be populated with the result.
Returns
RMW_RET_NODE_NAME_NON_EXISTENT if the node doesn't exist, or
RMW_RET_INVALID_ARGUMENT if an argument is invalid, or
RMW_RET_BAD_ALLOC if an allocation failed, or
RMW_RET_ERROR if an unexpected error happened, or
RMW_RET_OK.

◆ get_number_of_nodes()

size_t rmw_dds_common::GraphCache::get_number_of_nodes ( ) const

Get the number of nodes that have been discovered.

Returns
RMW_RET_OK, or
RMW_RET_ERROR.

◆ get_node_names()

rmw_ret_t rmw_dds_common::GraphCache::get_node_names ( rcutils_string_array_t node_names,
rcutils_string_array_t node_namespaces,
rcutils_string_array_t enclaves,
rcutils_allocator_t allocator 
) const

Copy the names and namespaces of the discovered nodes.

Parameters
[in,out]node_namesA zero initialized string array, where the node names will be copied. Must not be nullptr.
[in,out]node_namespacesA zero initialized string array, where the node namespaces will be copied. Each item in this array corresponds to an item in the same position of node_names array. Must not be nullptr.
[in,out]enclavesA zero initialized string array, where the enclave name of the node will be copied. Each item in this array corresponds to an item in the same position of node_names array. In case is nullptr, it won't be used.
[in]allocator.
Returns
RMW_RET_OK, or
RMW_RET_INVALID_ARGUMENT, or
RMW_RET_BAD_ALLOC, or
RMW_RET_ERROR.