Nebula
Loading...
Searching...
No Matches
Posix::PosixProcess Class Reference

#include <posixprocess.h>

Inherits Base::Process.

Public Member Functions

 PosixProcess ()
 constructor
 
bool LaunchWait () const
 launch application and wait for its termination
 
bool Launch ()
 launch application (returns immediately)
 
bool IsRunning ()
 Gets the state of application. Call this per frame.
 
void UpdateStdoutStream ()
 Read data from the captured stdout and writes it to the stream.
 
bool CheckIfExists ()
 Detect if an instance of the process is already running.
 
- Public Member Functions inherited from Base::Process
 Process ()
 constructor
 
void SetExecutable (const IO::URI &uri)
 set the executable path
 
void SetWorkingDirectory (const IO::URI &uri)
 set working directory
 
void SetArguments (const Util::String &args)
 set command line arguments
 
void SetNoConsoleWindow (bool b)
 do not open a console window for the new process
 
void SetStdoutCaptureStream (const Ptr< IO::Stream > &stream)
 set optional stdout capture stream
 
const Ptr< IO::Stream > & GetStdoutCaptureStream () const
 get optional pointer to stdout capture stream
 
void SetStderrCaptureStream (const Ptr< IO::Stream > &stream)
 set optional stderr capture stream
 
const Ptr< IO::Stream > & GetStderrCaptureStream () const
 get optional pointer to stderr capture stream
 

Static Public Member Functions

static bool CheckIfExists (const IO::URI &program)
 Detect if an instance of a given process is running.
 

Private Member Functions

void CleanUp () const
 cleanup all pipes
 

Private Attributes

int inPipe
 
int outPipe
 
int errPipe
 
pid_t pid
 

Additional Inherited Members

- Protected Attributes inherited from Base::Process
bool noConsoleWindow
 
bool isRunning
 
IO::URI exePath
 
IO::URI workingDir
 
Util::String args
 
Ptr< IO::StreamstdoutCaptureStream
 
Ptr< IO::StreamstderrCaptureStream
 

Constructor & Destructor Documentation

◆ PosixProcess()

Posix::PosixProcess::PosixProcess ( )

constructor

Member Function Documentation

◆ CheckIfExists() [1/2]

bool Posix::PosixProcess::CheckIfExists ( )
virtual

Detect if an instance of the process is already running.

Implements Base::Process.

◆ CheckIfExists() [2/2]

bool Posix::PosixProcess::CheckIfExists ( const IO::URI & program)
static

Detect if an instance of a given process is running.

◆ CleanUp()

void Posix::PosixProcess::CleanUp ( ) const
private

cleanup all pipes

◆ IsRunning()

bool Posix::PosixProcess::IsRunning ( )
virtual

Gets the state of application. Call this per frame.

Gets the state of the application.

Implements Base::Process.

◆ Launch()

bool Posix::PosixProcess::Launch ( )
virtual

launch application (returns immediately)

Launch the application process and returns immediately.

The state of the launched process can be checked by calling IsRunning().

Implements Base::Process.

◆ LaunchWait()

bool Posix::PosixProcess::LaunchWait ( ) const
virtual

launch application and wait for its termination

Implements Base::Process.

◆ UpdateStdoutStream()

void Posix::PosixProcess::UpdateStdoutStream ( )
virtual

Read data from the captured stdout and writes it to the stream.

Reads all arrived data from stdout since the last call of this method and puts it to the stream.

Implements Base::Process.

Member Data Documentation

◆ errPipe

int Posix::PosixProcess::errPipe
private

◆ inPipe

int Posix::PosixProcess::inPipe
private

◆ outPipe

int Posix::PosixProcess::outPipe
private

◆ pid

pid_t Posix::PosixProcess::pid
private

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