Script
Public Slots | Public Member Functions | List of all members
Process Class Reference

The Process class is used to launch an external process. Processes can be instantiated in the scripting environment. More...

#include <processinterface.h>

Inheritance diagram for Process:
Inheritance graph
[legend]
Collaboration diagram for Process:
Collaboration graph
[legend]

Public Slots

int launch ()
 Launch process.
 
int launchAndDetach ()
 Launch process and detach it from application.
 
String commandLine ()
 Fetch command line to be executed in this process.
 
int errorCode ()
 Fetch error code.
 
String & errorMessage ()
 Fetch error message.
 
void terminate ()
 Terminate process.
 
bool isAlive ()
 Verify if process is still alive.
 
int pid ()
 Fetch process PID.
 

Public Member Functions

 Process (int pid)
 Create a new Process. A process created with a pid cannot be launched as it already should have been. terminate() and isAlive() functions can still be called with such a process.
 
 Process (String name,...)
 Create a new Process.
 
 Process (String name, StringList list)
 Create a new Process.
 
 Process (String commandLine)
 Create a new Process.
 

Detailed Description

The Process class is used to launch an external process. Processes can be instantiated in the scripting environment.

You can use it in both Script Editor and scriptModule.

p1 = new Process( "rndr -t file.rib" ); // create process from single string
p2 = new Process( "rndr", "-t", "file.rib" ); // create process using separate arguments
// Both commands execute same process
p1.launch();
p2.launch();
// Launch a new process and detach it from application.
// Application will not be monitored by script module.
p3 = new Process( "rndr -t file.rib" );
p3.launchAndDetach();
// Create a process from a specified PID.
p4 = new Process( 1234 );
// Verify if process is still alive and terminate it
if ( p4.isAlive() )
{
p4.terminate();
}

Constructor & Destructor Documentation

Process::Process ( int  pid)

Create a new Process. A process created with a pid cannot be launched as it already should have been. terminate() and isAlive() functions can still be called with such a process.

Parameters
intPID of already existing process.
Process::Process ( String  name,
  ... 
)

Create a new Process.

Parameters
namePath or name of process to execute
...List of arguments
Process::Process ( String  name,
StringList  list 
)

Create a new Process.

Parameters
namePath or name of process to execute
listList of arguments
Process::Process ( String  commandLine)

Create a new Process.

Parameters
commandLineEntire command line to launch

Member Function Documentation

String Process::commandLine ( )
slot

Fetch command line to be executed in this process.

Returns
command line in a single string
int Process::errorCode ( )
slot

Fetch error code.

Returns
error code, zero if none
String& Process::errorMessage ( )
slot

Fetch error message.

Returns
error message associated to error code, empty string if none
bool Process::isAlive ( )
slot

Verify if process is still alive.

Returns
state of process, true if it can be reached
int Process::launch ( )
slot

Launch process.

Returns
error code, zero if none
int Process::launchAndDetach ( )
slot

Launch process and detach it from application.

Returns
error code, zero if none
int Process::pid ( )
slot

Fetch process PID.

Returns
pid, -1 if no process started
void Process::terminate ( )
slot

Terminate process.


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