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

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

#include <node_base.hpp>

Inheritance diagram for rclcpp::node_interfaces::NodeBase:
Inheritance graph
[legend]
Collaboration diagram for rclcpp::node_interfaces::NodeBase:
Collaboration graph
[legend]

Public Member Functions

 NodeBase (const std::string &node_name, const std::string &namespace_, rclcpp::Context::SharedPtr context, const rcl_node_options_t &rcl_node_options, bool use_intra_process_default, bool enable_topic_statistics_default)
 
virtual ~NodeBase ()
 
const char * get_name () const override
 Return the name of the node. More...
 
const char * get_namespace () const override
 Return the namespace of the node. More...
 
const char * get_fully_qualified_name () const override
 Return the fully qualified name of the node. More...
 
rclcpp::Context::SharedPtr get_context () override
 Return the context of the node. More...
 
rcl_node_tget_rcl_node_handle () override
 Return the rcl_node_t node handle (non-const version). More...
 
const rcl_node_tget_rcl_node_handle () const override
 Return the rcl_node_t node handle (const version). More...
 
std::shared_ptr< rcl_node_tget_shared_rcl_node_handle () override
 Return the rcl_node_t node handle in a std::shared_ptr. More...
 
std::shared_ptr< const rcl_node_tget_shared_rcl_node_handle () const override
 Return the rcl_node_t node handle in a std::shared_ptr. More...
 
rclcpp::CallbackGroup::SharedPtr create_callback_group (rclcpp::CallbackGroupType group_type, bool automatically_add_to_executor_with_node=true) override
 Create and return a callback group. More...
 
rclcpp::CallbackGroup::SharedPtr get_default_callback_group () override
 Return the default callback group. More...
 
bool callback_group_in_node (rclcpp::CallbackGroup::SharedPtr group) override
 Return true if the given callback group is associated with this node. More...
 
const std::vector< rclcpp::CallbackGroup::WeakPtr > & get_callback_groups () const override
 Return list of callback groups associated with this node. More...
 
std::atomic_bool & get_associated_with_executor_atomic () override
 Return the atomic bool which is used to ensure only one executor is used. More...
 
rcl_guard_condition_tget_notify_guard_condition () override
 Return guard condition that should be notified when the internal node state changes. More...
 
std::unique_lock< std::recursive_mutexacquire_notify_guard_condition_lock () const override
 Acquire and return a scoped lock that protects the notify guard condition. More...
 
bool get_use_intra_process_default () const override
 Return the default preference for using intra process communication. More...
 
bool get_enable_topic_statistics_default () const override
 Return the default preference for enabling topic statistics collection. More...
 
std::string resolve_topic_or_service_name (const std::string &name, bool is_service, bool only_expand=false) const override
 Expand and remap a given topic or service name. More...
 
- Public Member Functions inherited from rclcpp::node_interfaces::NodeBaseInterface
virtual ~NodeBaseInterface ()=default
 

Detailed Description

Implementation of the NodeBase part of the Node API.

Constructor & Destructor Documentation

◆ NodeBase()

rclcpp::node_interfaces::NodeBase::NodeBase ( const std::string node_name,
const std::string namespace_,
rclcpp::Context::SharedPtr  context,
const rcl_node_options_t rcl_node_options,
bool  use_intra_process_default,
bool  enable_topic_statistics_default 
)

◆ ~NodeBase()

virtual rclcpp::node_interfaces::NodeBase::~NodeBase ( )
virtual

Member Function Documentation

◆ get_name()

const char* rclcpp::node_interfaces::NodeBase::get_name ( ) const
overridevirtual

Return the name of the node.

Returns
The name of the node.

Implements rclcpp::node_interfaces::NodeBaseInterface.

◆ get_namespace()

const char* rclcpp::node_interfaces::NodeBase::get_namespace ( ) const
overridevirtual

Return the namespace of the node.

Returns
The namespace of the node.

Implements rclcpp::node_interfaces::NodeBaseInterface.

◆ get_fully_qualified_name()

const char* rclcpp::node_interfaces::NodeBase::get_fully_qualified_name ( ) const
overridevirtual

Return the fully qualified name of the node.

Returns
The fully qualified name of the node.

Implements rclcpp::node_interfaces::NodeBaseInterface.

◆ get_context()

rclcpp::Context::SharedPtr rclcpp::node_interfaces::NodeBase::get_context ( )
overridevirtual

Return the context of the node.

Returns
SharedPtr to the node's context.

Implements rclcpp::node_interfaces::NodeBaseInterface.

◆ get_rcl_node_handle() [1/2]

rcl_node_t* rclcpp::node_interfaces::NodeBase::get_rcl_node_handle ( )
overridevirtual

Return the rcl_node_t node handle (non-const version).

Implements rclcpp::node_interfaces::NodeBaseInterface.

◆ get_rcl_node_handle() [2/2]

const rcl_node_t* rclcpp::node_interfaces::NodeBase::get_rcl_node_handle ( ) const
overridevirtual

Return the rcl_node_t node handle (const version).

Implements rclcpp::node_interfaces::NodeBaseInterface.

◆ get_shared_rcl_node_handle() [1/2]

std::shared_ptr<rcl_node_t> rclcpp::node_interfaces::NodeBase::get_shared_rcl_node_handle ( )
overridevirtual

Return the rcl_node_t node handle in a std::shared_ptr.

This handle remains valid after the Node is destroyed. The actual rcl node is not finalized until it is out of scope everywhere.

Implements rclcpp::node_interfaces::NodeBaseInterface.

◆ get_shared_rcl_node_handle() [2/2]

std::shared_ptr<const rcl_node_t> rclcpp::node_interfaces::NodeBase::get_shared_rcl_node_handle ( ) const
overridevirtual

Return the rcl_node_t node handle in a std::shared_ptr.

This handle remains valid after the Node is destroyed. The actual rcl node is not finalized until it is out of scope everywhere.

Implements rclcpp::node_interfaces::NodeBaseInterface.

◆ create_callback_group()

rclcpp::CallbackGroup::SharedPtr rclcpp::node_interfaces::NodeBase::create_callback_group ( rclcpp::CallbackGroupType  group_type,
bool  automatically_add_to_executor_with_node = true 
)
overridevirtual

Create and return a callback group.

Implements rclcpp::node_interfaces::NodeBaseInterface.

◆ get_default_callback_group()

rclcpp::CallbackGroup::SharedPtr rclcpp::node_interfaces::NodeBase::get_default_callback_group ( )
overridevirtual

Return the default callback group.

Implements rclcpp::node_interfaces::NodeBaseInterface.

◆ callback_group_in_node()

bool rclcpp::node_interfaces::NodeBase::callback_group_in_node ( rclcpp::CallbackGroup::SharedPtr  group)
overridevirtual

Return true if the given callback group is associated with this node.

Implements rclcpp::node_interfaces::NodeBaseInterface.

◆ get_callback_groups()

const std::vector<rclcpp::CallbackGroup::WeakPtr>& rclcpp::node_interfaces::NodeBase::get_callback_groups ( ) const
overridevirtual

Return list of callback groups associated with this node.

Implements rclcpp::node_interfaces::NodeBaseInterface.

◆ get_associated_with_executor_atomic()

std::atomic_bool& rclcpp::node_interfaces::NodeBase::get_associated_with_executor_atomic ( )
overridevirtual

Return the atomic bool which is used to ensure only one executor is used.

Implements rclcpp::node_interfaces::NodeBaseInterface.

◆ get_notify_guard_condition()

rcl_guard_condition_t* rclcpp::node_interfaces::NodeBase::get_notify_guard_condition ( )
overridevirtual

Return guard condition that should be notified when the internal node state changes.

For example, this should be notified when a publisher is added or removed.

Returns
the rcl_guard_condition_t if it is valid, else nullptr

Implements rclcpp::node_interfaces::NodeBaseInterface.

◆ acquire_notify_guard_condition_lock()

std::unique_lock<std::recursive_mutex> rclcpp::node_interfaces::NodeBase::acquire_notify_guard_condition_lock ( ) const
overridevirtual

Acquire and return a scoped lock that protects the notify guard condition.

This should be used when triggering the notify guard condition.

Implements rclcpp::node_interfaces::NodeBaseInterface.

◆ get_use_intra_process_default()

bool rclcpp::node_interfaces::NodeBase::get_use_intra_process_default ( ) const
overridevirtual

Return the default preference for using intra process communication.

Implements rclcpp::node_interfaces::NodeBaseInterface.

◆ get_enable_topic_statistics_default()

bool rclcpp::node_interfaces::NodeBase::get_enable_topic_statistics_default ( ) const
overridevirtual

Return the default preference for enabling topic statistics collection.

Implements rclcpp::node_interfaces::NodeBaseInterface.

◆ resolve_topic_or_service_name()

std::string rclcpp::node_interfaces::NodeBase::resolve_topic_or_service_name ( const std::string name,
bool  is_service,
bool  only_expand = false 
) const
overridevirtual

Expand and remap a given topic or service name.

Implements rclcpp::node_interfaces::NodeBaseInterface.


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