Skip to content

Commit

Permalink
stub out functions for getting pub/sub infos from topic name
Browse files Browse the repository at this point in the history
  • Loading branch information
mm318 committed Jan 3, 2020
1 parent 26bc607 commit 049f3da
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
12 changes: 12 additions & 0 deletions rclcpp/include/rclcpp/node_interfaces/node_graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@ class NodeGraph : public NodeGraphInterface
size_t
count_subscribers(const std::string & topic_name) const override;

RCLCPP_PUBLIC
std::vector<rmw_topic_info_t>
get_publishers_info_by_topic(
const std::string & topic_name,
bool no_demangle = false) const override;

RCLCPP_PUBLIC
std::vector<rmw_topic_info_t>
get_subscriptions_info_by_topic(
const std::string & topic_name,
bool no_demangle = false) const override;

RCLCPP_PUBLIC

const rcl_guard_condition_t *
Expand Down
17 changes: 17 additions & 0 deletions rclcpp/include/rclcpp/node_interfaces/node_graph_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <vector>

#include "rcl/guard_condition.h"
#include "rmw/topic_info.h"

#include "rclcpp/event.hpp"
#include "rclcpp/macros.hpp"
Expand Down Expand Up @@ -89,6 +90,22 @@ class NodeGraphInterface
size_t
count_subscribers(const std::string & topic_name) const = 0;

/// Return a vector of publisher infos publishing to a given topic.
RCLCPP_PUBLIC
virtual
std::vector<rmw_topic_info_t>
get_publishers_info_by_topic(
const std::string & topic_name,
bool no_demangle = false) const = 0;

/// Return a vector of subscription infos publishing to a given topic.
RCLCPP_PUBLIC
virtual
std::vector<rmw_topic_info_t>
get_subscriptions_info_by_topic(
const std::string & topic_name,
bool no_demangle = false) const = 0;

/// Return the rcl guard condition which is triggered when the ROS graph changes.
RCLCPP_PUBLIC
virtual
Expand Down
16 changes: 16 additions & 0 deletions rclcpp/src/rclcpp/node_interfaces/node_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,22 @@ NodeGraph::count_subscribers(const std::string & topic_name) const
return count;
}

std::vector<rmw_topic_info_t>
NodeGraph::get_publishers_info_by_topic(
const std::string & /*topic_name*/,
bool /*no_demangle*/) const
{
return std::vector<rmw_topic_info_t>();
}

std::vector<rmw_topic_info_t>
NodeGraph::get_subscriptions_info_by_topic(
const std::string & /*topic_name*/,
bool /*no_demangle*/) const
{
return std::vector<rmw_topic_info_t>();
}

const rcl_guard_condition_t *
NodeGraph::get_graph_guard_condition() const
{
Expand Down

0 comments on commit 049f3da

Please sign in to comment.