OGLplus  (0.59.0) a C++ wrapper for rendering APIs

eagine::signal_switch Class Reference

Installs handlers for interrupt signals and flips switch on receipt. More...

#include <eagine/signal_switch.hpp>

Public Member Functions

 signal_switch () noexcept
 Default constructor. Stores the original handlers if any. More...
 
 ~signal_switch () noexcept
 Destructor. Restores the original signal handlers.
 
 signal_switch (signal_switch &&)=delete
 Not moveable.
 
 signal_switch (const signal_switch &)=delete
 Not copyable.
 
auto operator= (signal_switch &&)=delete
 Not move-assignable.
 
auto operator= (const signal_switch &)=delete
 Not copy-assignable.
 
auto reset () noexcept -> signal_switch &
 Resets the signal state as if no signal was received. More...
 
auto interrupted () const noexcept -> bool
 Indicates if the interrupt signal was received.
 
auto terminated () const noexcept -> bool
 Indicates if the terminate signal was received.
 
 operator bool () const noexcept
 Indicates if one of the tracked signals was received.
 

Detailed Description

Installs handlers for interrupt signals and flips switch on receipt.

This class installs handlers for the interrupt and terminate OS IPC signals and if one of the signals is received it flips a boolean indicator from false to true.

Note
Only a single instance per process should be created.
Examples
eagine/signal_switch.cpp.

Constructor & Destructor Documentation

◆ signal_switch()

eagine::signal_switch::signal_switch ( )
inlinenoexcept

Default constructor. Stores the original handlers if any.

Postcondition
!bool(*this)

Member Function Documentation

◆ reset()

auto eagine::signal_switch::reset ( ) -> signal_switch&
inlinenoexcept

Resets the signal state as if no signal was received.

Postcondition
!bool(*this)

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

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).