ROS 2 rclcpp + rcl - kilted  kilted
ROS 2 C++ Client Library with ROS Client Library
Public Member Functions | Static Public Member Functions | List of all members
rclcpp::SignalHandler Class Referencefinal

Responsible for managing the SIGINT/SIGTERM signal handling. More...

#include </home/runner/work/api.nav2.org/api.nav2.org/work/rclcpp-kilted/rclcpp/src/rclcpp/signal_handler.hpp>

Public Member Functions

bool install (SignalHandlerOptions signal_handler_options=SignalHandlerOptions::All)
 Install the signal handler for SIGINT/SIGTERM and start the dedicated signal handling thread. More...
 
bool uninstall ()
 
bool is_installed ()
 Return true if installed, false otherwise.
 
rclcpp::SignalHandlerOptions get_current_signal_handler_options ()
 Get the current signal handler options. More...
 

Static Public Member Functions

static SignalHandlerget_global_signal_handler ()
 Return the global singleton of this class.
 
static rclcpp::Loggerget_logger ()
 Return a global singleton logger to avoid needing to create it everywhere.
 

Detailed Description

Responsible for managing the SIGINT/SIGTERM signal handling.

This class is responsible for:

Definition at line 55 of file signal_handler.hpp.

Member Function Documentation

◆ get_current_signal_handler_options()

rclcpp::SignalHandlerOptions SignalHandler::get_current_signal_handler_options ( )

Get the current signal handler options.

If no signal handler is installed, SignalHandlerOptions::None is returned.

Definition at line 387 of file signal_handler.cpp.

Referenced by rclcpp::get_current_signal_handler_options().

Here is the caller graph for this function:

◆ install()

bool SignalHandler::install ( SignalHandlerOptions  signal_handler_options = SignalHandlerOptions::All)

Install the signal handler for SIGINT/SIGTERM and start the dedicated signal handling thread.

Also stores the current signal handler to be called on signal and to restore when uninstalling this signal handler.

Parameters
signal_handler_optionsoption to indicate which signal handlers should be installed.

Definition at line 121 of file signal_handler.cpp.

References rclcpp::All, get_logger(), rclcpp::None, rclcpp::SigInt, and rclcpp::SigTerm.

Referenced by rclcpp::install_signal_handlers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uninstall()

bool SignalHandler::uninstall ( )

Uninstall the signal handler for SIGINT/SIGTERM and join the dedicated signal handling thread. Also restores the previous signal handler.

Definition at line 169 of file signal_handler.cpp.

References rclcpp::All, get_logger(), rclcpp::None, rclcpp::SigInt, and rclcpp::SigTerm.

Referenced by rclcpp::uninstall_signal_handlers().

Here is the call graph for this function:
Here is the caller graph for this function:

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