winss
|
Manages the life cycle of a process. More...
#include <process.hpp>
Public Member Functions | |
Process () | |
Create a empty process. More... | |
Process (const Process &)=delete | |
No copy. More... | |
Process (Process &&p) | |
Create an empty process and move the management of another to this one. More... | |
virtual DWORD | GetProcessId () const |
Get current process ID. More... | |
virtual DWORD | GetExitCode () const |
Get the exit code of the process. More... | |
virtual bool | IsCreated () const |
Gets if the process is created. More... | |
virtual bool | IsActive () const |
Gets if the process is active. More... | |
virtual winss::HandleWrapper | GetHandle () const |
Gets the process handle. More... | |
virtual bool | Create (const ProcessParams ¶ms) |
Create the process given the parameters. More... | |
virtual void | SendBreak () |
Send a CTRL+BREAK to the process. More... | |
virtual void | Terminate () |
Terminate the process. More... | |
virtual void | Close () |
Close the handle to the process but leaves it running. More... | |
Process & | operator= (const Process &)=delete |
No copy. More... | |
Process & | operator= (Process &&p) |
Move management of another process to this one. More... | |
~Process () | |
Cleans up the process. More... | |
Manages the life cycle of a process.
winss::Process::Process | ( | ) |
Create a empty process.
|
delete |
No copy.
winss::Process::Process | ( | Process && | p | ) |
Create an empty process and move the management of another to this one.
p | The other process. |
winss::Process::~Process | ( | ) |
Cleans up the process.
References Close().
|
virtual |
Close the handle to the process but leaves it running.
References IsCreated(), and WINDOWS.
Referenced by ~Process().
|
virtual |
Create the process given the parameters.
params | The process parameters. |
References winss::ProcessParams::cmd, winss::ProcessParams::create_group, winss::ProcessParams::dir, winss::HandleWrapper::Duplicate(), winss::ProcessParams::env, winss::HandleWrapper::HasHandle(), IsCreated(), winss::Environment::ReadEnv(), STDERR, winss::ProcessParams::stderr_pipe, STDIN, winss::ProcessParams::stdin_pipe, STDOUT, winss::ProcessParams::stdout_pipe, and WINDOWS.
|
virtual |
Get the exit code of the process.
References WINDOWS.
Referenced by IsActive().
|
virtual |
Gets the process handle.
|
virtual |
Get current process ID.
|
virtual |
Gets if the process is active.
References GetExitCode(), and IsCreated().
Referenced by SendBreak().
|
virtual |
Gets if the process is created.
Referenced by Close(), Create(), IsActive(), and Terminate().
winss::Process & winss::Process::operator= | ( | winss::Process && | p | ) |
Move management of another process to this one.
p | The other process. |
|
virtual |
Send a CTRL+BREAK to the process.
The process needs to be created in a new group for this to work.
References IsActive(), and WINDOWS.
|
virtual |
Terminate the process.
There is no graceful handlers for this type of termination.
References IsCreated(), and WINDOWS.