process-cpp: impl::SignalTrap Class Reference

process-cpp 3.0.0 A simple convenience library for handling processes in C++11.

Public Types | Public Member Functions | List of all members
impl::SignalTrap Class Reference
Inheritance diagram for impl::SignalTrap:
Collaboration diagram for impl::SignalTrap:

## Public Types
enum | Scope { Scope::process, Scope::thread }
enum | State { State::not_running, State::running }

## Public Member Functions
| SignalTrap (Scope scope, std::initializer_list< core::posix::Signal > blocked_signals)
| ~SignalTrap ()
bool | has (core::posix::Signal signal) override
| Returns true if the given signal is trapped by this instance. More...
void | run () override
| Starts observation of incoming signals, relaying them via signal_raised(). The call blocks until stop is called. More...
void | stop () override
| Stops execution of the signal trap. More...
core::Signal< core::posix::Signal > & | signal_raised () override
| Emitted whenever a trapped signal is raised by the operating system. More...
Public Member Functions inherited from core::posix::SignalTrap
| SignalTrap (const SignalTrap &)=delete
SignalTrap & | operator= (const SignalTrap &)=delete
bool | operator== (const SignalTrap &) const =delete

## Additional Inherited Members
Protected Member Functions inherited from core::posix::SignalTrap
| SignalTrap ()=default

## Detailed Description

Definition at line 42 of file signal.cpp.

## Member Enumeration Documentation

## ◆ Scope

enum impl::SignalTrap::Scope
| strong

Enumerator
process |
thread |

Definition at line 45 of file signal.cpp.

## ◆ State

enum impl::SignalTrap::State
| strong

Enumerator
not_running |
running |

Definition at line 51 of file signal.cpp.

## Constructor & Destructor Documentation

## ◆ SignalTrap()

impl::SignalTrap::SignalTrap | ( | Scope | scope,
|  | std::initializer_list< core::posix::Signal > | blocked_signals
| ) |  |
| inline

Definition at line 57 of file signal.cpp.

References process, impl::set_process_signal_mask(), impl::set_thread_signal_mask(), and thread.

Here is the call graph for this function:

## ◆ ~SignalTrap()

impl::SignalTrap::~SignalTrap | ( |  | ) |
| inlinevirtual

Reimplemented from core::posix::SignalTrap.

Definition at line 81 of file signal.cpp.

References process, impl::set_process_signal_mask(), impl::set_thread_signal_mask(), and thread.

Here is the call graph for this function:

## Member Function Documentation

## ◆ has()

bool impl::SignalTrap::has | ( | core::posix::Signal | signal | ) |
| inlineoverridevirtual

Returns true if the given signal is trapped by this instance.

Implements core::posix::SignalTrap.

Definition at line 96 of file signal.cpp.

Referenced by run().

## ◆ run()

void impl::SignalTrap::run | ( |  | ) |
| inlineoverridevirtual

Starts observation of incoming signals, relaying them via signal_raised(). The call blocks until stop is called.

Implements core::posix::SignalTrap.

Definition at line 101 of file signal.cpp.

References has(), not_running, and running.

Here is the call graph for this function:

## ◆ signal_raised()

core::Signal<core::posix::Signal>& impl::SignalTrap::signal_raised | ( |  | ) |
| inlineoverridevirtual

Emitted whenever a trapped signal is raised by the operating system.

Implements core::posix::SignalTrap.

Definition at line 187 of file signal.cpp.

## ◆ stop()

void impl::SignalTrap::stop | ( |  | ) |
| inlineoverridevirtual

Stops execution of the signal trap.

Implements core::posix::SignalTrap.

Definition at line 180 of file signal.cpp.

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

- /build/process-cpp/src/process-cpp-3.0.1/src/core/posix/signal.cpp