process-cpp
3.0.0
A simple convenience library for handling processes in C++11.
|
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... | |
![]() | |
SignalTrap (const SignalTrap &)=delete | |
SignalTrap & | operator= (const SignalTrap &)=delete |
bool | operator== (const SignalTrap &) const =delete |
Additional Inherited Members | |
![]() | |
SignalTrap ()=default | |
Definition at line 42 of file signal.cpp.
|
strong |
Enumerator | |
---|---|
process | |
thread |
Definition at line 45 of file signal.cpp.
|
strong |
Enumerator | |
---|---|
not_running | |
running |
Definition at line 51 of file signal.cpp.
|
inline |
Definition at line 57 of file signal.cpp.
References process, impl::set_process_signal_mask(), impl::set_thread_signal_mask(), and thread.
|
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.
|
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().
|
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.
|
inlineoverridevirtual |
Emitted whenever a trapped signal is raised by the operating system.
Implements core::posix::SignalTrap.
Definition at line 187 of file signal.cpp.
|
inlineoverridevirtual |
Stops execution of the signal trap.
Implements core::posix::SignalTrap.
Definition at line 180 of file signal.cpp.