rclcpp  beta1
C++ ROS Client Library API
Public Member Functions | List of all members
rclcpp::node_interfaces::NodeGraph Class Reference

Implementation the NodeGraph part of the Node API. More...

#include <node_graph.hpp>

Inheritance diagram for rclcpp::node_interfaces::NodeGraph:
rclcpp::node_interfaces::NodeGraphInterface

Public Member Functions

 NodeGraph (rclcpp::node_interfaces::NodeBaseInterface *node_base)
 
virtual ~NodeGraph ()
 
virtual std::map< std::string, std::stringget_topic_names_and_types () const
 Return a map of existing topic names (string) to topic types (string). More...
 
virtual size_t count_publishers (const std::string &topic_name) const
 Return the number of publishers that are advertised on a given topic. More...
 
virtual size_t count_subscribers (const std::string &topic_name) const
 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
 Return the rcl guard condition which is triggered when the ROS graph changes. More...
 
virtual void notify_graph_change ()
 Notify threads waiting on graph changes. More...
 
virtual void notify_shutdown ()
 Notify any and all blocking node actions that shutdown has occurred. More...
 
virtual rclcpp::event::Event::SharedPtr get_graph_event ()
 Return a graph event, which will be set anytime a graph change occurs. More...
 
virtual void wait_for_graph_change (rclcpp::event::Event::SharedPtr event, std::chrono::nanoseconds timeout)
 Wait for a graph event to occur by waiting on an Event to become set. More...
 
virtual size_t count_graph_users ()
 Return the number of on loan graph events, see get_graph_event(). More...
 

Detailed Description

Implementation the NodeGraph part of the Node API.

Constructor & Destructor Documentation

§ NodeGraph()

rclcpp::node_interfaces::NodeGraph::NodeGraph ( rclcpp::node_interfaces::NodeBaseInterface node_base)
explicit

§ ~NodeGraph()

virtual rclcpp::node_interfaces::NodeGraph::~NodeGraph ( )
virtual

Member Function Documentation

§ get_topic_names_and_types()

virtual std::map<std::string, std::string> rclcpp::node_interfaces::NodeGraph::get_topic_names_and_types ( ) const
virtual

Return a map of existing topic names (string) to topic types (string).

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.

Implements rclcpp::node_interfaces::NodeGraphInterface.

§ count_publishers()

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

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

Implements rclcpp::node_interfaces::NodeGraphInterface.

§ count_subscribers()

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

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

Implements rclcpp::node_interfaces::NodeGraphInterface.

§ get_graph_guard_condition()

virtual const rcl_guard_condition_t* rclcpp::node_interfaces::NodeGraph::get_graph_guard_condition ( ) const
virtual

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

Implements rclcpp::node_interfaces::NodeGraphInterface.

§ notify_graph_change()

virtual void rclcpp::node_interfaces::NodeGraph::notify_graph_change ( )
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

Implements rclcpp::node_interfaces::NodeGraphInterface.

§ notify_shutdown()

virtual void rclcpp::node_interfaces::NodeGraph::notify_shutdown ( )
virtual

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

Implements rclcpp::node_interfaces::NodeGraphInterface.

§ get_graph_event()

virtual rclcpp::event::Event::SharedPtr rclcpp::node_interfaces::NodeGraph::get_graph_event ( )
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.

Implements rclcpp::node_interfaces::NodeGraphInterface.

§ wait_for_graph_change()

virtual void rclcpp::node_interfaces::NodeGraph::wait_for_graph_change ( rclcpp::event::Event::SharedPtr  event,
std::chrono::nanoseconds  timeout 
)
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().

Implements rclcpp::node_interfaces::NodeGraphInterface.

§ count_graph_users()

virtual size_t rclcpp::node_interfaces::NodeGraph::count_graph_users ( )
virtual

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

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

Implements rclcpp::node_interfaces::NodeGraphInterface.


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