|
Developer Documentation |
|
Centre for Vision, Speech & Signal Processing |
Parent Classes:
Methods:
- ChildProcessBodyC & Body()
-
Access body.
- const ChildProcessBodyC & Body() const
-
Access body.
- ChildProcessC(StringC cmd,BooleanT useStdOut = FALSE,BooleanT useStdErr = FALSE,BooleanT useStdIn = FALSE)
-
Start a child process.
if useStdOut, useStdErr or useStdIn is TRUE, the matching channel
of the child process is connect to the appropriate stream.
- ChildProcessC(StringC cmd,FilenameC out,BooleanT redirectStderr = FALSE,BooleanT useStdIn = FALSE)
-
Start a child process.
Send output to file 'out', if redirectStderr is TRUE send
stderr there too.
- IStreamC & StdOut()
-
Get the stdout of the process.
Is invalid, if output is not directed back to this process.
- IStreamC & StdErr()
-
Get the stderr of the process.
Is invalid, if output is not directed back to this process.
- OStreamC & StdIn()
-
Send to the stdin of the process.
Is invalid, if output is not directed back to this process.
- int GetPID() const
-
Get the process ID.
- BooleanT IsRunning()
-
Test if child is still running.
- BooleanT ExitedOk()
-
Test eixted ok flag.
only valid if child has actual exited.
- BooleanT Wait()
-
Wait for program to exit.
It returns false if the wait failed. Possibly because
the child program has terminated already, or was never
started.
- BooleanT Wait(double maxTime)
-
Wait for program to exit.
maxTime in the maximum time in seconds,
if it is negative it won't time out.
It returns false if the wait failed. Possibly because
the child program has terminated already, or was never
started.
- IntT ExitCode() const
-
Get exit code.
Return the exit code of the program, if the program
failed to exit normaly this is set to the signal number
which ended the program. This variable is only valid if
program has exited.
- BooleanT Terminate(double maxDelay = 10)
-
Close the processes politely but firmly.
This first sends a SIGQUIT, then after maxDelay if the process
hasn't exited in sends a SIGTERM. It will wait upto another maxDelay seconds
if the process doesn't terminate, then return FALSE if failed TRUE if
terminated.
- BooleanT Signal(IntT signo)
-
Send a signal to the process.
- BooleanT Kill(BooleanT hard = FALSE)
-
Kill the child process.
The process should die sometime after this call though it may not
be immediatly.
- int Pid() const
-
Get process id.
- UIntT Hash() const
-
Hash on pid.
- BooleanT operator==(const ProcessC & oth) const
-
Compair two processes.
- int WaitForChild(int & status)
-
Wait for change in state of a child process.
returns PID of child that's changed state.
-1 = Call interupted.
0 = No children.
- ProcessBodyC & Body()
-
Access body.
- const ProcessBodyC & Body() const
-
Access body.
- UserInfoC Owner()
-
Find the owner of the process.
- UIntT MemorySize()
-
Get the amount of memory this process is using.
Returns 0 on failure. 1 if special
Will return ((UIntT) -1) if process size is bigger than 4Gb.
- BooleanT SigStop()
-
Stop this process. (Like Ctrl-z)
- BooleanT SigContinue()
-
Start this process.
Restart the this process after a stop.
- BooleanT IsValid() const
-
Check its a valid handle.
- BooleanT IsValidObject() const
-
Check its a valid handle, and that the object is pointed to is also valid.
- RCHandleC<ProcessBodyC> & operator=(const RCHandleC<ProcessBodyC> & oth)
-
Assignment.
- BooleanT operator==(const RCHandleC<ProcessBodyC> & oth) const
-
Comparison operator.
- BooleanT operator!=(const RCHandleC<ProcessBodyC> & oth) const
-
Comparison operator.
- UIntT Hash() const
-
Hash function.x
- BooleanT IsConst() const
-
Is object constant ?
- BooleanT IsNotConst() const
-
Is object not constant ?
- void SetConst(void) const
-
Lock the object.
This is const as a convience though it actual modified the
object, often object you wish to ensure are constant already
have const set.
protected:
- void Invalidate()
-
Turn this into an invalid handle.
- ProcessBodyC & Body()
-
Direct access to body.
- const ProcessBodyC & Body() const
-
Constant access to body.
|
Programmer:Charles Galambos, Documentation by CxxDoc: Tue Mar 20 10:49:27 2001
|