diff --git a/rclcpp/include/rclcpp/node_interfaces/node_graph_interface.hpp b/rclcpp/include/rclcpp/node_interfaces/node_graph_interface.hpp index a548579585..c1fe5d71c5 100644 --- a/rclcpp/include/rclcpp/node_interfaces/node_graph_interface.hpp +++ b/rclcpp/include/rclcpp/node_interfaces/node_graph_interface.hpp @@ -29,6 +29,8 @@ #include "rcl/graph.h" #include "rcl/guard_condition.h" +#include "rmw/impl/cpp/buffer_backend_metadata.hpp" + #include "rclcpp/event.hpp" #include "rclcpp/macros.hpp" #include "rclcpp/node_interfaces/detail/node_interfaces_helpers.hpp" @@ -69,6 +71,9 @@ class TopicEndpointInfo topic_type_ = info.topic_type; std::copy(info.endpoint_gid, info.endpoint_gid + RMW_GID_STORAGE_SIZE, endpoint_gid_.begin()); + + buffer_backend_metadata_ = + rmw::impl::cpp::parse_buffer_backend_metadata(info.buffer_backend_metadata); } /// Get a mutable reference to the node name. @@ -141,6 +146,16 @@ class TopicEndpointInfo const rosidl_type_hash_t & topic_type_hash() const; + /// Get a mutable reference to the buffer backend metadata. + RCLCPP_PUBLIC + std::map & + buffer_backend_metadata(); + + /// Get a const reference to the buffer backend metadata. + RCLCPP_PUBLIC + const std::map & + buffer_backend_metadata() const; + private: std::string node_name_; std::string node_namespace_; @@ -149,6 +164,7 @@ class TopicEndpointInfo std::array endpoint_gid_; rclcpp::QoS qos_profile_; rosidl_type_hash_t topic_type_hash_; + std::map buffer_backend_metadata_; }; /** diff --git a/rclcpp/src/rclcpp/node_interfaces/node_graph.cpp b/rclcpp/src/rclcpp/node_interfaces/node_graph.cpp index a7b28733d2..749758241a 100644 --- a/rclcpp/src/rclcpp/node_interfaces/node_graph.cpp +++ b/rclcpp/src/rclcpp/node_interfaces/node_graph.cpp @@ -956,6 +956,18 @@ rclcpp::TopicEndpointInfo::topic_type_hash() const return topic_type_hash_; } +std::map & +rclcpp::TopicEndpointInfo::buffer_backend_metadata() +{ + return buffer_backend_metadata_; +} + +const std::map & +rclcpp::TopicEndpointInfo::buffer_backend_metadata() const +{ + return buffer_backend_metadata_; +} + std::string & rclcpp::ServiceEndpointInfo::node_name() {