rclcpp
master
C++ ROS Client Library API
|
Implementation the NodeGraph part of the Node API. More...
#include <node_graph.hpp>
Public Member Functions | |
NodeGraph (rclcpp::node_interfaces::NodeBaseInterface *node_base) | |
virtual | ~NodeGraph () |
std::map< std::string, std::vector< std::string > > | get_topic_names_and_types (bool no_demangle=false) const override |
Return a map of existing topic names to list of topic types. More... | |
std::map< std::string, std::vector< std::string > > | get_service_names_and_types () const override |
Return a map of existing service names to list of service types. More... | |
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 override |
Return a map of existing service names to list of service types for a specific node. More... | |
std::vector< std::string > | get_node_names () const override |
Return a vector of existing node names (string). More... | |
std::vector< std::pair< std::string, std::string > > | get_node_names_and_namespaces () const override |
Return a vector of existing node names and namespaces (pair of string). More... | |
size_t | count_publishers (const std::string &topic_name) const override |
Return the number of publishers that are advertised on a given topic. More... | |
size_t | count_subscribers (const std::string &topic_name) const override |
Return the number of subscribers who have created a subscription for a given topic. More... | |
const rcl_guard_condition_t * | get_graph_guard_condition () const override |
Return the rcl guard condition which is triggered when the ROS graph changes. More... | |
void | notify_graph_change () override |
Notify threads waiting on graph changes. More... | |
void | notify_shutdown () override |
Notify any and all blocking node actions that shutdown has occurred. More... | |
rclcpp::Event::SharedPtr | get_graph_event () override |
Return a graph event, which will be set anytime a graph change occurs. More... | |
void | wait_for_graph_change (rclcpp::Event::SharedPtr event, std::chrono::nanoseconds timeout) override |
Wait for a graph event to occur by waiting on an Event to become set. More... | |
size_t | count_graph_users () override |
Return the number of on loan graph events, see get_graph_event(). More... | |
std::vector< rclcpp::TopicEndpointInfo > | get_publishers_info_by_topic (const std::string &topic_name, bool no_mangle=false) const override |
Return the topic endpoint information about publishers on a given topic. More... | |
std::vector< rclcpp::TopicEndpointInfo > | get_subscriptions_info_by_topic (const std::string &topic_name, bool no_mangle=false) const override |
Return the topic endpoint information about subscriptions on a given topic. More... | |
Public Member Functions inherited from rclcpp::node_interfaces::NodeGraphInterface | |
virtual | ~NodeGraphInterface ()=default |
|
explicit |
|
virtual |
|
overridevirtual |
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.
[in] | no_demangle | if true, topic names and types are not demangled |
Implements rclcpp::node_interfaces::NodeGraphInterface.
|
overridevirtual |
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.
Implements rclcpp::node_interfaces::NodeGraphInterface.
|
overridevirtual |
Return a map of existing service names to list of service types for a specific node.
This function only considers services - not clients.
[in] | node_name | name of the node |
[in] | namespace_ | namespace of the node |
Implements rclcpp::node_interfaces::NodeGraphInterface.
|
overridevirtual |
Return a vector of existing node names (string).
Implements rclcpp::node_interfaces::NodeGraphInterface.
|
overridevirtual |
Return a vector of existing node names and namespaces (pair of string).
Implements rclcpp::node_interfaces::NodeGraphInterface.
|
overridevirtual |
Return the number of publishers that are advertised on a given topic.
Implements rclcpp::node_interfaces::NodeGraphInterface.
|
overridevirtual |
Return the number of subscribers who have created a subscription for a given topic.
Implements rclcpp::node_interfaces::NodeGraphInterface.
|
overridevirtual |
Return the rcl guard condition which is triggered when the ROS graph changes.
Implements rclcpp::node_interfaces::NodeGraphInterface.
|
overridevirtual |
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.
RCLBaseError | (a child of that exception) when an rcl error occurs |
Implements rclcpp::node_interfaces::NodeGraphInterface.
|
overridevirtual |
Notify any and all blocking node actions that shutdown has occurred.
Implements rclcpp::node_interfaces::NodeGraphInterface.
|
overridevirtual |
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.
|
overridevirtual |
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.
InvalidEventError | if the given event is nullptr |
EventNotRegisteredError | if the given event was not acquired with get_graph_event(). |
Implements rclcpp::node_interfaces::NodeGraphInterface.
|
overridevirtual |
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.
|
overridevirtual |
Return the topic endpoint information about publishers on a given topic.
Implements rclcpp::node_interfaces::NodeGraphInterface.
|
overridevirtual |
Return the topic endpoint information about subscriptions on a given topic.
Implements rclcpp::node_interfaces::NodeGraphInterface.