rmw_dds_common
master
Define a common interface between DDS implementations of ROS middleware.
|
Go to the documentation of this file.
15 #ifndef RMW_DDS_COMMON__GRAPH_CACHE_HPP_
16 #define RMW_DDS_COMMON__GRAPH_CACHE_HPP_
22 #include <unordered_map>
35 #include "rmw_dds_common/msg/gid.hpp"
36 #include "rmw_dds_common/msg/node_entities_info.hpp"
37 #include "rmw_dds_common/msg/participant_entities_info.hpp"
44 struct ParticipantInfo;
62 template<
typename CallbackT>
67 on_change_callback_ = callback;
223 rmw_dds_common::msg::ParticipantEntitiesInfo
237 rmw_dds_common::msg::ParticipantEntitiesInfo
252 rmw_dds_common::msg::ParticipantEntitiesInfo
268 rmw_dds_common::msg::ParticipantEntitiesInfo
284 rmw_dds_common::msg::ParticipantEntitiesInfo
300 rmw_dds_common::msg::ParticipantEntitiesInfo
327 size_t * count)
const;
342 size_t * count)
const;
502 decltype(std::declval<rmw_dds_common::msg::ParticipantEntitiesInfo>().node_entities_info_seq);
506 decltype(std::declval<rmw_dds_common::msg::NodeEntitiesInfo>().writer_gid_seq);
548 #endif // RMW_DDS_COMMON__GRAPH_CACHE_HPP_
rmw_ret_t 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.
rmw_ret_t get_writer_count(const std::string &topic_name, size_t *count) const
Get the number of publishers of a topic.
Graph cache data structure.
Definition: graph_cache.hpp:50
rmw_dds_common::msg::ParticipantEntitiesInfo associate_writer(const rmw_gid_t &writer_gid, const rmw_gid_t &participant_gid, const std::string &node_name, const std::string &node_namespace)
Remove a node to the graph, and get the message to be sent.
std::ostream & operator<<(std::ostream &ostream, const rmw_gid_t &gid)
Stream operator for rmw_gid_t.
void add_participant(const rmw_gid_t &participant_gid, const std::string &enclave)
Add a discovered participant to the cache.
rmw_dds_common::msg::ParticipantEntitiesInfo dissociate_reader(const rmw_gid_t &reader_gid, const rmw_gid_t &participant_gid, const std::string &node_name, const std::string &node_namespace)
Dissociate a reader from a node, and get an update message to be sent.
decltype(std::declval< rmw_dds_common::msg::NodeEntitiesInfo >().writer_gid_seq) GidSeq
Definition: graph_cache.hpp:506
EntityInfo(const std::string &topic_name, const std::string &topic_type, const rmw_gid_t &participant_gid, const rmw_qos_profile_t &qos)
Definition: graph_cache.hpp:534
rmw_ret_t 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.
rmw_qos_profile_t qos
Definition: graph_cache.hpp:532
bool remove_writer(const rmw_gid_t &gid)
Remove a data writer based on discovery.
bool remove_entity(const rmw_gid_t &gid, bool is_reader)
Remove a data reader or writer based based on discovery.
Definition: context.hpp:27
#define RMW_DDS_COMMON_PUBLIC
Definition: visibility_control.h:48
rmw_ret_t get_reader_count(const std::string &topic_name, size_t *count) const
Get the number of subscriptions of a topic.
bool add_entity(const rmw_gid_t &gid, const std::string &topic_name, const std::string &type_name, const rmw_gid_t &participant_gid, const rmw_qos_profile_t &qos, bool is_reader)
Add a data reader based on discovery.
std::string topic_type
Definition: graph_cache.hpp:530
GraphCache::NodeEntitiesInfoSeq node_entities_info_seq
Definition: graph_cache.hpp:523
bool add_reader(const rmw_gid_t &reader_gid, const std::string &topic_name, const std::string &type_name, const rmw_gid_t &participant_gid, const rmw_qos_profile_t &qos)
Add a data reader based on discovery.
rmw_ret_t 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.
rmw_dds_common::msg::ParticipantEntitiesInfo dissociate_writer(const rmw_gid_t &writer_gid, const rmw_gid_t &participant_gid, const std::string &node_name, const std::string &node_namespace)
Dissociate a writer from a node, and get an update message to be sent.
rmw_dds_common::msg::ParticipantEntitiesInfo add_node(const rmw_gid_t &participant_gid, const std::string &node_name, const std::string &node_namespace)
Add a node to the graph, and get the message to be sent.
std::string topic_name
Definition: graph_cache.hpp:529
std::string enclave
Definition: graph_cache.hpp:524
size_t get_number_of_nodes() const
Get the number of nodes that have been discovered.
void update_participant_entities(const rmw_dds_common::msg::ParticipantEntitiesInfo &msg)
Update participant info based on a received ParticipantEntitiesInfo message.
Definition: graph_cache.hpp:527
void set_on_change_callback(CallbackT &&callback)
Set a callback that will be called when the state of the object changes.
Definition: graph_cache.hpp:64
decltype(std::declval< rmw_dds_common::msg::ParticipantEntitiesInfo >().node_entities_info_seq) NodeEntitiesInfoSeq
Definition: graph_cache.hpp:502
Definition: graph_cache.hpp:521
friend std::ostream & operator<<(std::ostream &ostream, const GraphCache &topic_cache)
rmw_ret_t 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.
rmw_dds_common::msg::ParticipantEntitiesInfo associate_reader(const rmw_gid_t &reader_gid, const rmw_gid_t &participant_gid, const std::string &node_name, const std::string &node_namespace)
Associate a reader with a node, and get an update message to be sent.
rmw_dds_common::msg::ParticipantEntitiesInfo remove_node(const rmw_gid_t &participant_gid, const std::string &node_name, const std::string &node_namespace)
Remove a node to the graph, and get the message to be sent.
bool remove_reader(const rmw_gid_t &gid)
Remove a data reader based on discovery.
rmw_gid_t participant_gid
Definition: graph_cache.hpp:531
rmw_ret_t 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.
rmw_ret_t 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.
void clear_on_change_callback()
Clear previously registered "on change" callback.
bool remove_participant(const rmw_gid_t &participant_gid)
Remove a participant based on discovery.
bool add_writer(const rmw_gid_t &writer_gid, const std::string &topic_name, const std::string &type_name, const rmw_gid_t &participant_gid, const rmw_qos_profile_t &qos)
Add a data writer based on discovery.