Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions rclcpp/include/rclcpp/node_interfaces/node_graph_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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<std::string, std::string> &
buffer_backend_metadata();

/// Get a const reference to the buffer backend metadata.
RCLCPP_PUBLIC
const std::map<std::string, std::string> &
buffer_backend_metadata() const;

private:
std::string node_name_;
std::string node_namespace_;
Expand All @@ -149,6 +169,7 @@ class TopicEndpointInfo
std::array<uint8_t, RMW_GID_STORAGE_SIZE> endpoint_gid_;
rclcpp::QoS qos_profile_;
rosidl_type_hash_t topic_type_hash_;
std::map<std::string, std::string> buffer_backend_metadata_;
};

/**
Expand Down
12 changes: 12 additions & 0 deletions rclcpp/src/rclcpp/node_interfaces/node_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,18 @@ rclcpp::TopicEndpointInfo::topic_type_hash() const
return topic_type_hash_;
}

std::map<std::string, std::string> &
rclcpp::TopicEndpointInfo::buffer_backend_metadata()
{
return buffer_backend_metadata_;
}

const std::map<std::string, std::string> &
rclcpp::TopicEndpointInfo::buffer_backend_metadata() const
{
return buffer_backend_metadata_;
}

std::string &
rclcpp::ServiceEndpointInfo::node_name()
{
Expand Down