winss
Public Member Functions | List of all members
winss::Process Class Reference

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 &params)
 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...
 
Processoperator= (const Process &)=delete
 No copy. More...
 
Processoperator= (Process &&p)
 Move management of another process to this one. More...
 
 ~Process ()
 Cleans up the process. More...
 

Detailed Description

Manages the life cycle of a process.

Constructor & Destructor Documentation

winss::Process::Process ( )

Create a empty process.

winss::Process::Process ( const Process )
delete

No copy.

winss::Process::Process ( Process &&  p)

Create an empty process and move the management of another to this one.

Parameters
pThe other process.
winss::Process::~Process ( )

Cleans up the process.

References Close().

Member Function Documentation

void winss::Process::Close ( )
virtual

Close the handle to the process but leaves it running.

References IsCreated(), and WINDOWS.

Referenced by ~Process().

bool winss::Process::Create ( const ProcessParams params)
virtual
DWORD winss::Process::GetExitCode ( ) const
virtual

Get the exit code of the process.

Returns
The process exit code.

References WINDOWS.

Referenced by IsActive().

winss::HandleWrapper winss::Process::GetHandle ( ) const
virtual

Gets the process handle.

Returns
A handle wrapper to the process handle.
See also
HandleWraper.
DWORD winss::Process::GetProcessId ( ) const
virtual

Get current process ID.

Returns
The process ID.
bool winss::Process::IsActive ( ) const
virtual

Gets if the process is active.

Returns
True if the process is active otherwise false.

References GetExitCode(), and IsCreated().

Referenced by SendBreak().

bool winss::Process::IsCreated ( ) const
virtual

Gets if the process is created.

Returns
True if the process is created otherwise false.

Referenced by Close(), Create(), IsActive(), and Terminate().

Process& winss::Process::operator= ( const Process )
delete

No copy.

winss::Process & winss::Process::operator= ( winss::Process &&  p)

Move management of another process to this one.

Parameters
pThe other process.
void winss::Process::SendBreak ( )
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.

void winss::Process::Terminate ( )
virtual

Terminate the process.

There is no graceful handlers for this type of termination.

References IsCreated(), and WINDOWS.


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