ROS 2 rclcpp + rcl - kilted
kilted
ROS 2 C++ Client Library with ROS Client Library
|
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 SignalHandler & | get_global_signal_handler () |
Return the global singleton of this class. | |
static rclcpp::Logger & | get_logger () |
Return a global singleton logger to avoid needing to create it everywhere. | |
Responsible for managing the SIGINT/SIGTERM signal handling.
This class is responsible for:
Definition at line 55 of file signal_handler.hpp.
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().
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.
signal_handler_options | option 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().
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().