rclcpp  master
C++ ROS Client Library API
Public Member Functions | List of all members
rclcpp::node_interfaces::NodeGraphInterface Class Referenceabstract

Pure virtual interface class for the NodeGraph part of the Node API. More...

#include <node_graph_interface.hpp>

Inheritance diagram for rclcpp::node_interfaces::NodeGraphInterface:
Inheritance graph
[legend]

Public Member Functions

virtual ~NodeGraphInterface ()=default
 
virtual std::map< std::string, std::vector< std::string > > get_topic_names_and_types (bool no_demangle=false) const =0
 Return a map of existing topic names to list of topic types. More...
 
virtual std::map< std::string, std::vector< std::string > > get_service_names_and_types () const =0
 Return a map of existing service names to list of service types. More...
 
virtual std::map< std::string, std::vector< std::string > > get_service_names_and_types_by_node (const std::string &node_name, const std::string &namespace_) const =0
 Return a map of existing service names to list of service types for a specific node. More...
 
virtual std::vector< std::stringget_node_names () const =0
 Return a vector of existing node names (string). More...
 
virtual std::vector< std::pair< std::string, std::string > > get_node_names_and_namespaces () const =0
 Return a vector of existing node names and namespaces (pair of string). More...
 
virtual size_t count_publishers (const std::string &topic_name) const =0
 Return the number of publishers that are advertised on a given topic. More...
 
virtual size_t count_subscribers (const std::string &topic_name) const =0
 Return the number of subscribers who have created a subscription for a given topic. More...
 
virtual const rcl_guard_condition_tget_graph_guard_condition () const =0
 Return the rcl guard condition which is triggered when the ROS graph changes. More...
 
virtual void notify_graph_change ()=0
 Notify threads waiting on graph changes. More...
 
virtual void notify_shutdown ()=0
 Notify any and all blocking node actions that shutdown has occurred. More...
 
virtual rclcpp::Event::SharedPtr get_graph_event ()=0
 Return a graph event, which will be set anytime a graph change occurs. More...
 
virtual void wait_for_graph_change (rclcpp::Event::SharedPtr event, std::chrono::nanoseconds timeout)=0
 Wait for a graph event to occur by waiting on an Event to become set. More...
 
virtual size_t count_graph_users () const =0
 Return the number of on loan graph events, see get_graph_event(). More...
 
virtual std::vector< rclcpp::TopicEndpointInfoget_publishers_info_by_topic (const std::string &topic_name, bool no_mangle=false) const =0
 Return the topic endpoint information about publishers on a given topic. More...
 
virtual std::vector< rclcpp::TopicEndpointInfoget_subscriptions_info_by_topic (const std::string &topic_name, bool no_mangle=false) const =0
 Return the topic endpoint information about subscriptions on a given topic. More...
 

Detailed Description

Pure virtual interface class for the NodeGraph part of the Node API.

Constructor & Destructor Documentation

◆ ~NodeGraphInterface()

virtual rclcpp::node_interfaces::NodeGraphInterface::~NodeGraphInterface ( )
virtualdefault

Member Function Documentation

◆ get_topic_names_and_types()

virtual std::map<std::string, std::vector<std::string> > rclcpp::node_interfaces::NodeGraphInterface::get_topic_names_and_types ( bool  no_demangle = false) const
pure virtual

Return a map of existing topic names to list of topic types.

A topic is considered to exist when at least one publisher or subscriber exists for it, whether they be local or remote to this process. The returned names are the actual names used and do not have remap rules applied.

Parameters
[in]no_demangleif true, topic names and types are not demangled

Implemented in rclcpp::node_interfaces::NodeGraph.

◆ get_service_names_and_types()

virtual std::map<std::string, std::vector<std::string> > rclcpp::node_interfaces::NodeGraphInterface::get_service_names_and_types ( ) const
pure virtual

Return a map of existing service names to list of service types.

A service is considered to exist when at least one service server or service client exists for it, whether they be local or remote to this process. The returned names are the actual names used and do not have remap rules applied.

Implemented in rclcpp::node_interfaces::NodeGraph.

◆ get_service_names_and_types_by_node()

virtual std::map<std::string, std::vector<std::string> > rclcpp::node_interfaces::NodeGraphInterface::get_service_names_and_types_by_node ( const std::string node_name,
const std::string namespace_ 
) const
pure virtual

Return a map of existing service names to list of service types for a specific node.

This function only considers services - not clients. The returned names are the actual names used and do not have remap rules applied.

Parameters
[in]node_namename of the node
[in]namespace_namespace of the node

Implemented in rclcpp::node_interfaces::NodeGraph.

◆ get_node_names()

virtual std::vector<std::string> rclcpp::node_interfaces::NodeGraphInterface::get_node_names ( ) const
pure virtual

Return a vector of existing node names (string).

Implemented in rclcpp::node_interfaces::NodeGraph.

◆ get_node_names_and_namespaces()

virtual std::vector<std::pair<std::string, std::string> > rclcpp::node_interfaces::NodeGraphInterface::get_node_names_and_namespaces ( ) const
pure virtual

Return a vector of existing node names and namespaces (pair of string).

Implemented in rclcpp::node_interfaces::NodeGraph.

◆ count_publishers()

virtual size_t rclcpp::node_interfaces::NodeGraphInterface::count_publishers ( const std::string topic_name) const
pure virtual

Return the number of publishers that are advertised on a given topic.

Implemented in rclcpp::node_interfaces::NodeGraph.

◆ count_subscribers()

virtual size_t rclcpp::node_interfaces::NodeGraphInterface::count_subscribers ( const std::string topic_name) const
pure virtual

Return the number of subscribers who have created a subscription for a given topic.

Implemented in rclcpp::node_interfaces::NodeGraph.

◆ get_graph_guard_condition()

virtual const rcl_guard_condition_t* rclcpp::node_interfaces::NodeGraphInterface::get_graph_guard_condition ( ) const
pure virtual

Return the rcl guard condition which is triggered when the ROS graph changes.

Implemented in rclcpp::node_interfaces::NodeGraph.

◆ notify_graph_change()

virtual void rclcpp::node_interfaces::NodeGraphInterface::notify_graph_change ( )
pure virtual

Notify threads waiting on graph changes.

Affects threads waiting on the notify guard condition, see: get_notify_guard_condition(), as well as the threads waiting on graph changes using a graph Event, see: wait_for_graph_change().

This is typically only used by the rclcpp::graph_listener::GraphListener.

Exceptions
RCLBaseError(a child of that exception) when an rcl error occurs

Implemented in rclcpp::node_interfaces::NodeGraph.

◆ notify_shutdown()

virtual void rclcpp::node_interfaces::NodeGraphInterface::notify_shutdown ( )
pure virtual

Notify any and all blocking node actions that shutdown has occurred.

Implemented in rclcpp::node_interfaces::NodeGraph.

◆ get_graph_event()

virtual rclcpp::Event::SharedPtr rclcpp::node_interfaces::NodeGraphInterface::get_graph_event ( )
pure virtual

Return a graph event, which will be set anytime a graph change occurs.

The graph Event object is a loan which must be returned. The Event object is scoped and therefore to return the load just let it go out of scope.

Implemented in rclcpp::node_interfaces::NodeGraph.

◆ wait_for_graph_change()

virtual void rclcpp::node_interfaces::NodeGraphInterface::wait_for_graph_change ( rclcpp::Event::SharedPtr  event,
std::chrono::nanoseconds  timeout 
)
pure virtual

Wait for a graph event to occur by waiting on an Event to become set.

The given Event must be acquire through the get_graph_event() method.

Exceptions
InvalidEventErrorif the given event is nullptr
EventNotRegisteredErrorif the given event was not acquired with get_graph_event().

Implemented in rclcpp::node_interfaces::NodeGraph.

◆ count_graph_users()

virtual size_t rclcpp::node_interfaces::NodeGraphInterface::count_graph_users ( ) const
pure virtual

Return the number of on loan graph events, see get_graph_event().

This is typically only used by the rclcpp::graph_listener::GraphListener.

Implemented in rclcpp::node_interfaces::NodeGraph.

◆ get_publishers_info_by_topic()

virtual std::vector<rclcpp::TopicEndpointInfo> rclcpp::node_interfaces::NodeGraphInterface::get_publishers_info_by_topic ( const std::string topic_name,
bool  no_mangle = false 
) const
pure virtual

Return the topic endpoint information about publishers on a given topic.

Parameters
[in]topic_namethe actual topic name used; it will not be automatically remapped.
See also
rclcpp::Node::get_publishers_info_by_topic

Implemented in rclcpp::node_interfaces::NodeGraph.

◆ get_subscriptions_info_by_topic()

virtual std::vector<rclcpp::TopicEndpointInfo> rclcpp::node_interfaces::NodeGraphInterface::get_subscriptions_info_by_topic ( const std::string topic_name,
bool  no_mangle = false 
) const
pure virtual

Return the topic endpoint information about subscriptions on a given topic.

Parameters
[in]topic_namethe actual topic name used; it will not be automatically remapped.
See also
rclcpp::Node::get_subscriptions_info_by_topic

Implemented in rclcpp::node_interfaces::NodeGraph.


The documentation for this class was generated from the following file: