PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
kcenon::pacs::samples::scoped_signal_handler Class Reference

#include <signal_handler.h>

Collaboration diagram for kcenon::pacs::samples::scoped_signal_handler:
Collaboration graph

Public Member Functions

 scoped_signal_handler (signal_handler::shutdown_callback callback=nullptr)
 Construct and install signal handlers.
 
 ~scoped_signal_handler ()
 Destructor - resets signal handler state.
 
 scoped_signal_handler (const scoped_signal_handler &)=delete
 
auto operator= (const scoped_signal_handler &) -> scoped_signal_handler &=delete
 
 scoped_signal_handler (scoped_signal_handler &&)=delete
 
auto operator= (scoped_signal_handler &&) -> scoped_signal_handler &=delete
 
void wait ()
 Block until shutdown signal is received.
 
auto should_shutdown () const noexcept -> bool
 Check if shutdown has been requested.
 

Detailed Description

Definition at line 138 of file signal_handler.h.

Constructor & Destructor Documentation

◆ scoped_signal_handler() [1/3]

kcenon::pacs::samples::scoped_signal_handler::scoped_signal_handler ( signal_handler::shutdown_callback callback = nullptr)
explicit

Construct and install signal handlers.

Parameters
callbackOptional callback for shutdown notification
Examples
/home/runner/work/pacs_system/pacs_system/examples/tutorials/common/signal_handler.h.

Definition at line 84 of file signal_handler.cpp.

84 {
85 signal_handler::install(std::move(callback));
86}
static void install(shutdown_callback callback=nullptr)
Install signal handlers with optional callback.

References kcenon::pacs::samples::signal_handler::install().

Here is the call graph for this function:

◆ ~scoped_signal_handler()

kcenon::pacs::samples::scoped_signal_handler::~scoped_signal_handler ( )

Destructor - resets signal handler state.

Examples
/home/runner/work/pacs_system/pacs_system/examples/tutorials/common/signal_handler.h.

Definition at line 88 of file signal_handler.cpp.

88 {
90}
static void reset()
Reset the shutdown state.

References kcenon::pacs::samples::signal_handler::reset().

Here is the call graph for this function:

◆ scoped_signal_handler() [2/3]

kcenon::pacs::samples::scoped_signal_handler::scoped_signal_handler ( const scoped_signal_handler & )
delete

◆ scoped_signal_handler() [3/3]

kcenon::pacs::samples::scoped_signal_handler::scoped_signal_handler ( scoped_signal_handler && )
delete

Member Function Documentation

◆ operator=() [1/2]

auto kcenon::pacs::samples::scoped_signal_handler::operator= ( const scoped_signal_handler & ) -> scoped_signal_handler &=delete
delete

◆ operator=() [2/2]

auto kcenon::pacs::samples::scoped_signal_handler::operator= ( scoped_signal_handler && ) -> scoped_signal_handler &=delete
delete

◆ should_shutdown()

auto kcenon::pacs::samples::scoped_signal_handler::should_shutdown ( ) const -> bool
nodiscardnoexcept

Check if shutdown has been requested.

Returns
true if shutdown signal received
Examples
/home/runner/work/pacs_system/pacs_system/examples/tutorials/common/signal_handler.h.

Definition at line 96 of file signal_handler.cpp.

96 {
98}
static auto should_shutdown() noexcept -> bool
Check if shutdown has been requested.

References kcenon::pacs::samples::signal_handler::should_shutdown().

Here is the call graph for this function:

◆ wait()

void kcenon::pacs::samples::scoped_signal_handler::wait ( )

Block until shutdown signal is received.

Examples
/home/runner/work/pacs_system/pacs_system/examples/tutorials/common/signal_handler.h.

Definition at line 92 of file signal_handler.cpp.

92 {
94}
static void wait_for_shutdown()
Block until a shutdown signal is received.

References kcenon::pacs::samples::signal_handler::wait_for_shutdown().

Referenced by main().

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: