C++ YASMIN (Yet Another State MachINe)
Loading...
Searching...
No Matches
yasmin_ros::YasminNode Class Reference

A ROS 2 node for managing and handling YASMIN-based applications. More...

#include <yasmin_node.hpp>

Inheritance diagram for yasmin_ros::YasminNode:
Collaboration diagram for yasmin_ros::YasminNode:

Public Types

using SharedPtr = std::shared_ptr<YasminNode>

Public Member Functions

 YasminNode (YasminNode &other)=delete
 Deleted copy constructor to prevent copying of the singleton instance.
 ~YasminNode ()
 Destructor. Cleans up resources.
void operator= (const YasminNode &)=delete
 Deleted assignment operator to enforce singleton pattern.

Static Public Member Functions

static YasminNode::SharedPtr get_instance ()
 Provides access to the singleton instance of YasminNode.
static void destroy_instance ()
 Destroy the singleton instance if it exists.

Protected Member Functions

 YasminNode ()
 Default constructor. Initializes the node with a unique name.

Private Member Functions

void stop_executor ()
 Stop the executor thread and remove the node from the executor.

Private Attributes

rclcpp::executors::MultiThreadedExecutor executor
 Executor for managing multiple threads.
std::unique_ptr< std::thread > spin_thread
 Thread for spinning the node.

Detailed Description

A ROS 2 node for managing and handling YASMIN-based applications.

YasminNode is a singleton class derived from rclcpp::Node and integrates custom functionalities for executing specific tasks in a ROS 2 environment.

Member Typedef Documentation

◆ SharedPtr

Constructor & Destructor Documentation

◆ YasminNode() [1/2]

YasminNode::YasminNode ( )
explicitprotected

Default constructor. Initializes the node with a unique name.

◆ YasminNode() [2/2]

yasmin_ros::YasminNode::YasminNode ( YasminNode & other)
delete

Deleted copy constructor to prevent copying of the singleton instance.

Parameters
otherAnother instance of YasminNode (unused).

◆ ~YasminNode()

YasminNode::~YasminNode ( )

Destructor. Cleans up resources.

Member Function Documentation

◆ destroy_instance()

void YasminNode::destroy_instance ( )
static

Destroy the singleton instance if it exists.

◆ get_instance()

YasminNode::SharedPtr YasminNode::get_instance ( )
static

Provides access to the singleton instance of YasminNode.

This method ensures there is only one instance of YasminNode running.

Returns
A shared pointer to the singleton instance of YasminNode.

◆ operator=()

void yasmin_ros::YasminNode::operator= ( const YasminNode & )
delete

Deleted assignment operator to enforce singleton pattern.

Parameters
otherAnother instance of YasminNode (unused).

◆ stop_executor()

void YasminNode::stop_executor ( )
private

Stop the executor thread and remove the node from the executor.

Member Data Documentation

◆ executor

rclcpp::executors::MultiThreadedExecutor yasmin_ros::YasminNode::executor
private

Executor for managing multiple threads.

◆ spin_thread

std::unique_ptr<std::thread> yasmin_ros::YasminNode::spin_thread
private

Thread for spinning the node.


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