holoscan::SignalHandler
holoscan::SignalHandler
The SignalHandler class provides a mechanism to handle signals in a C++ program.
The SignalHandler class provides a way to handle signals in a C++ program. It allows registering global signal handlers and context-specific signal handlers. The class is implemented as a singleton, and its instance can be obtained using the get_instance() method.
Constructors
SignalHandler
Constructs a SignalHandler object.
Destructor
~SignalHandler
Destructs a SignalHandler object.
Methods
install_signal_handler_impl
register_global_signal_handler_impl
register_signal_handler_impl
unregister_global_signal_handler_impl
unregister_signal_handler_impl
handle_signal
Static methods
get_instance
Returns the singleton instance of the SignalHandler class.
Returns: SignalHandler& The singleton instance of the SignalHandler class.
static_handle_signal
The static method to handles the specified signal.
Parameters
The signal to handle.
install_signal_handler
Installs the signal handler for the specified signal.
Parameters
The signal to install the signal handler for. If signal is 0, the signal handler is installed for all existing signals.
register_global_signal_handler
Registers a global signal handler for the specified signal.
Parameters
The signal to register the global signal handler for.
The global signal handler function.
If true, overwrites any existing global signal handler for the specified signal.
register_signal_handler
Registers a context-specific signal handler for the specified signal.
Parameters
The context to register the signal handler for.
The signal to register the signal handler for.
The signal handler function.
If true, overwrites any existing signal handler for the specified context and signal.
unregister_global_signal_handler
Unregisters the global signal handler for the specified signal.
Parameters
The signal to unregister the global signal handler for.
unregister_signal_handler
Unregisters the context-specific signal handler for the specified context and signal.
Parameters
The context to unregister the signal handler for.
The signal to unregister the signal handler for.
clear_all_signal_handlers
Clears all signal handlers.
clear_global_signal_handlers
Clears all global signal handlers.
clear_signal_handlers
Clears all context-specific signal handlers.