Public Types | Public Member Functions | Protected Member Functions

zeus::TProcessControl Class Reference

#include <ProcessControl.h>

Inheritance diagram for zeus::TProcessControl:
zeus::TZObject zeus::IZUnknown

List of all members.

Public Types

enum  EProcessState { etInit, etStarted, etTerminated, etErrorState }

Public Member Functions

 TProcessControl (const IString &rApplicationName)
 TProcessControl (Uint uiProcessID)
void addParameter (const IString &rParameter)
void addParameter (const TString &rParameter)
void addParameter (const IString &rName, const IString &rValue)
void addParameter (const TString &rName, const TString &rValue)
void clearParameter ()
Int getParameterCount () const
const IStringgetParameter (Int iIndex) const
TString getParameters () const
const TStringgetApplicationName () const
bool getTerminateProcessOnDestroy () const
void setTerminateProcessOnDestroy (bool bValue)
bool exists () const
Int getExitCode () const
Uint getProcessID () const
Uint getMainThreadID () const
bool isStarted () const
bool isTerminated () const
Retval kill ()
Retval start ()
Retval terminate (Int iExitCode=0)
bool waitForTermination (Float fTimeOut)
bool waitForIdle (Float fTimeOut)
bool activateMainWindow ()
Uint getMainWindowID () const
TString getMainWindowTitle () const
void setMainWindowVisibility (bool bMode)

Protected Member Functions

virtual ~TProcessControl ()

Detailed Description

This class controls a process. Starting and termination can be controlled


Member Enumeration Documentation

the process state

Enumerator:
etInit 
etStarted 
etTerminated 
etErrorState 

Constructor & Destructor Documentation

TProcessControl::TProcessControl ( const IString rApplicationName )

Creates a process control object

Parameters:
rApplicationName: Path and name of the application to run/control
TProcessControl::TProcessControl ( Uint  uiProcessID )

Creates a process control object

Parameters:
uiProcessID: ID of the process to wrapp
TProcessControl::~TProcessControl (  ) [protected, virtual]

Destroys the process control object


Member Function Documentation

bool TProcessControl::activateMainWindow (  )

This method is window based and activates the main window of the application.

void zeus::TProcessControl::addParameter ( const IString rParameter ) [inline]

adds an application parameter

Parameters:
rParameter: parameter value
void zeus::TProcessControl::addParameter ( const TString rName,
const TString rValue 
) [inline]

adds an application parameter composed of name and value. The name-value pair is passed as "name=value" to the application.

Parameters:
rName: name of the parameter
rValue: Value of the parameter
void zeus::TProcessControl::addParameter ( const TString rParameter ) [inline]

adds an application parameter

Parameters:
rParameter: parameter value
void zeus::TProcessControl::addParameter ( const IString rName,
const IString rValue 
) [inline]

adds an application parameter composed of name and value. The name-value pair is passed as "name=value" to the application.

Parameters:
rName: name of the parameter
rValue: Value of the parameter
void zeus::TProcessControl::clearParameter (  ) [inline]

Removes all application parameter

bool TProcessControl::exists (  ) const

Checks if the process still exists

const TString & zeus::TProcessControl::getApplicationName (  ) const [inline]

returns the file name of the application

Int TProcessControl::getExitCode (  ) const

Returns the exit code of the process

Uint TProcessControl::getMainThreadID (  ) const

Returns the ID of the main thread

Uint TProcessControl::getMainWindowID (  ) const

returns the main window ID

TString TProcessControl::getMainWindowTitle (  ) const

returns the title of the main window. This method works only for window based application.

Returns:
title
const IString & zeus::TProcessControl::getParameter ( Int  iIndex ) const [inline]

returns an indexed application parameter

Int zeus::TProcessControl::getParameterCount (  ) const [inline]

returns the count of application parameter list

TString TProcessControl::getParameters (  ) const

Returns all parameter as a string

Uint TProcessControl::getProcessID (  ) const

Returns the ID of the process

bool zeus::TProcessControl::getTerminateProcessOnDestroy (  ) const [inline]

returns the terminating-process-on-destroying-controller flag

bool zeus::TProcessControl::isStarted (  ) const [inline]

Checks if the process is started

bool zeus::TProcessControl::isTerminated (  ) const [inline]

Checks if the process is terminated

Retval TProcessControl::kill (  )

Kills the process immediately

void TProcessControl::setMainWindowVisibility ( bool  bMode )

sets the visibility of the main window. This method works only with window based applications. If the application is started the main window is hidden or shown. Note that this will not bring the window into foreground. Use activateMainWindow() instead

Parameters:
bMode: visibility mode
void zeus::TProcessControl::setTerminateProcessOnDestroy ( bool  bValue ) [inline]

sets the terminating-process-on-destroying-controller flag

Retval TProcessControl::start (  )

Starts the application

Retval TProcessControl::terminate ( Int  iExitCode = 0 )

Terminates the process

bool TProcessControl::waitForIdle ( Float  fTimeOut )

Waits for idle input of the process

bool TProcessControl::waitForTermination ( Float  fTimeOut )

Waits for termination of the process


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Sun Jan 22 2012 15:28:40