Process.
More...
#include <base/concurrency/Process.h>
Inherits Object.
Process.
Process manipulation class.
- Version
- 1.2
◆ Process() [1/3]
Initializes process as invalid.
◆ Process() [2/3]
Process::Process |
( |
unsigned long |
id | ) |
|
|
inlinenoexcept |
Initializes a process.
- Parameters
-
◆ Process() [3/3]
Process::Process |
( |
const Process & |
copy | ) |
|
|
noexcept |
Initializes process from other process.
◆ execute()
Executes the specified application (quotes are required if module contains a space). The return process has been locked.
- Returns
- The child process.
◆ fork()
Forks a child process.
- Returns
- The parent returns the child process. The child returns a process with id 0.
◆ getId()
unsigned long Process::getId |
( |
| ) |
|
|
inlinenoexcept |
◆ getLayout()
static Layout Process::getLayout |
( |
| ) |
|
|
inlinestaticnoexcept |
Returns the layout of the process.
◆ getName()
String Process::getName |
( |
| ) |
const |
◆ getNumberOfConfiguredProcessors()
static unsigned long Process::getNumberOfConfiguredProcessors |
( |
| ) |
|
|
inlinestaticnoexcept |
Returns the number of configured processors in the system. It is legal for the operating system to lie about the true number of processors.
- Returns
- Returns 0 if the value cannot be determined.
- Examples
- testsuite/Process.cpp.
◆ getNumberOfOnlineProcessors()
static unsigned long Process::getNumberOfOnlineProcessors |
( |
| ) |
|
|
inlinestaticnoexcept |
Returns the number of online processors in the system. It is legal for the operating system to lie about the true number of processors.
- Returns
- Returns 0 if the value cannot be determined.
- Examples
- testsuite/Process.cpp.
◆ getParentProcess()
static Process Process::getParentProcess |
( |
| ) |
|
|
staticnoexcept |
Returns parent process. A process object with id 0 is returned when no parent is available.
- Returns
- Invalid process if not supported.
- Examples
- testsuite/Process.cpp.
◆ getPriority()
static int Process::getPriority |
( |
| ) |
|
|
static |
◆ getProcess()
static Process Process::getProcess |
( |
| ) |
|
|
staticnoexcept |
◆ getTimes()
Times Process::getTimes |
( |
| ) |
|
|
noexcept |
Returns the current processing times (both user and system times).
◆ isAlive()
bool Process::isAlive |
( |
| ) |
const |
Returns true if the process is alive. On some platforms this will only work if the process is a child process of the current process.
- Examples
- testsuite/Process.cpp.
◆ isValid()
bool Process::isValid |
( |
| ) |
const |
|
inlinenoexcept |
Returns true if the process id is invalid.
◆ lock()
Acquires a lock of the process which allows synchronization using the wait methods.
◆ operator=()
Assignment of process with process.
◆ setPriority()
static void Process::setPriority |
( |
int |
priority | ) |
|
|
static |
Sets the priority of the process.
◆ supportsJobControl()
static bool Process::supportsJobControl |
( |
| ) |
|
|
inlinestaticnoexcept |
Returns true if the system supports job control.
◆ terminate()
bool Process::terminate |
( |
bool |
force = false | ) |
|
Requests the process to terminate.
- Parameters
-
force | Specifies whether to force the process to terminate. The default is false. |
- Returns
- True if the signal was delivered.
◆ wait() [1/2]
Waits for the process to terminate.
- Returns
- The exit code (EXIT_CODE_INVALID if exit code is not available).
◆ wait() [2/2]
int Process::wait |
( |
unsigned int |
microseconds | ) |
|
|
noexcept |
Waits for the process to terminate. EXIT_CODE_CONFLICT is returned is the true exit code was EXIT_CODE_INVALID.
- Parameters
-
microseconds | The timeout period. |
- Returns
- The exit code (EXIT_CODE_INVALID if exit code is not available or the timeout period expired).
◆ INVALID
const unsigned long Process::INVALID = PrimitiveTraits<unsigned long>::MAXIMUM |
|
static |
Value which specifies an invalid process id.