diff --git a/rclcpp/include/rclcpp/node_interfaces/node_graph_interface.hpp b/rclcpp/include/rclcpp/node_interfaces/node_graph_interface.hpp index a548579585..397e721447 100644 --- a/rclcpp/include/rclcpp/node_interfaces/node_graph_interface.hpp +++ b/rclcpp/include/rclcpp/node_interfaces/node_graph_interface.hpp @@ -69,6 +69,16 @@ class TopicEndpointInfo topic_type_ = info.topic_type; std::copy(info.endpoint_gid, info.endpoint_gid + RMW_GID_STORAGE_SIZE, endpoint_gid_.begin()); + + const char * current_key = rcutils_string_map_get_next_key( + &info.buffer_backend_metadata, nullptr); + while (current_key) { + const char * current_value = rcutils_string_map_get( + &info.buffer_backend_metadata, current_key); + buffer_backend_metadata_[current_key] = current_value ? current_value : ""; + current_key = rcutils_string_map_get_next_key( + &info.buffer_backend_metadata, current_key); + } } /// Get a mutable reference to the node name. @@ -141,6 +151,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 +169,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() {