|
process-cpp 3.0.0
A simple convenience library for handling processes in C++11.
|
The Process class models a process and possible operations on it. More...
#include <process.h>
Inheritance diagram for core::posix::Process:
Collaboration diagram for core::posix::Process:Classes | |
| struct | Private |
Public Member Functions | |
| Process (pid_t pid) | |
| Creates a process instance wrapping an existing process. | |
| virtual | ~Process () noexcept |
| Frees resources associated with the process. | |
| virtual pid_t | pid () const |
| Query the pid of the process. | |
| virtual ProcessGroup | process_group_or_throw () const |
| Queries the id of the process group this process belongs to. | |
| virtual ProcessGroup | process_group (std::error_code &se) const noexcept(true) |
| Queries the id of the process group this process belongs to. | |
Public Member Functions inherited from core::posix::Signalable | |
| virtual void | send_signal_or_throw (Signal signal) |
| Sends a signal to this signalable object. | |
| virtual void | send_signal (Signal signal, std::error_code &e) noexcept(true) |
| Sends a signal to this signalable object. | |
Static Public Member Functions | |
| static Process | invalid () |
| Returns an invalid instance for testing purposes. | |
Additional Inherited Members | |
Protected Member Functions inherited from core::posix::Signalable | |
| CORE_POSIX_DLL_LOCAL | Signalable (pid_t pid) |
The Process class models a process and possible operations on it.
The process class is implicitly shared.
|
explicit |
Creates a process instance wrapping an existing process.
| Throw | std::system_error if pid is invalid, i.e., pid < 0. |
| pid | The process identifier of the existing process. |
Definition at line 47 of file process.cpp.
References pid(), and core::posix::Signalable::Signalable().
Referenced by invalid().
Here is the call graph for this function:
|
virtualnoexcept |
Frees resources associated with the process.
Definition at line 55 of file process.cpp.
|
static |
Returns an invalid instance for testing purposes.
Definition at line 38 of file process.cpp.
References Process().
Referenced by TEST(), and TEST().
Here is the call graph for this function:
|
virtual |
Query the pid of the process.
Definition at line 59 of file process.cpp.
Referenced by core::posix::ChildProcess::fork, core::posix::ChildProcess::Private::Private(), Process(), process_group(), process_group_or_throw(), TEST(), TEST(), TEST(), TEST(), core::posix::ChildProcess::vfork, and core::posix::ChildProcess::wait_for().
|
virtualnoexcept |
Queries the id of the process group this process belongs to.
Definition at line 74 of file process.cpp.
References pid().
Referenced by TEST(), and TEST().
Here is the call graph for this function:
|
virtual |
Queries the id of the process group this process belongs to.
| std::system_error | in case of errors. |
Definition at line 64 of file process.cpp.
References pid().
Here is the call graph for this function: