User Documentation
RAVL, Recognition And Vision Library
DEVELOP HOME PAGE CLASS LIST CONTENTS
Ravl - OS - Exec - ChildOSProcessC
 

  PUBLIC
ChildOSProcessC::ChildOSProcessC(StringC,bool,bool,bool)
ChildOSProcessC::ChildOSProcessC(StringC,FilenameC,bool,bool)
ChildOSProcessC::StdOut(void)
ChildOSProcessC::StdErr(void)
ChildOSProcessC::StdIn(void)
ChildOSProcessC::GetPID(void) const
ChildOSProcessC::IsRunning(void)
ChildOSProcessC::ExitedOk(void)
ChildOSProcessC::Wait(void)
ChildOSProcessC::Wait(double)
ChildOSProcessC::ExitCode(void) const
ChildOSProcessC::Terminate(double)
OSProcessC::Signal(IntT)
OSProcessC::Kill(bool)
OSProcessC::Pid(void) const
OSProcessC::Hash(void) const
OSProcessC::operator ==(const OSProcessC &) const
OSProcessC::WaitForChild(int &)
OSProcessC::MemorySize(void)
OSProcessC::SigStop(void)
OSProcessC::SigContinue(void)
RCHandleC::operator =(const RCHandleC &)
RCHandleC::DeepCopy(UIntT) const
RCHandleC::operator ==(const RCHandleC &) const
RCHandleC::operator !=(const RCHandleC &) const
RCHandleC::Hash(void) const
RCHandleC::IsValid(void) const
RCHandleC::Invalidate(void)
RCHandleC::IsHandleType(const DT &) const
RCHandleC::CheckHandleType(const DT &) const
RCHandleC::References(void) const
RCHandleC::operator <<(ostream &,const RCHandleC &)
RCHandleC::operator >>(istream &,RCHandleC &)

   ChildOSProcessC   
 
Child process handle.
 
include "Ravl/OS/ChildOSProcess.hh"
Created:24/11/98 
User Level:Normal
Library:RavlOS
Example:exChild.cc
In Scope:RavlN

Parent Classes: Methods:
ChildOSProcessC(StringC cmd,bool useStdOut = false,bool useStdErr = false,bool 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.

ChildOSProcessC(StringC cmd,FilenameC out,bool redirectStderr = false,bool 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.

bool IsRunning()
Test if child is still running.

bool ExitedOk()
Test eixted ok flag.
only valid if child has actual exited.

bool 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.

bool 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.

bool 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.

#include "Ravl/OS/OSProcess.hh"
bool Signal(IntT signo)
Send a signal to the process.

bool Kill(bool 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.

bool operator ==(const OSProcessC & oth) const
Compair two processes.

static 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.



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.

bool SigStop()
Stop this process. (Like Ctrl-z)

bool SigContinue()
Start this process.
Restart the this process after a stop.

#include "Ravl/RefCounter.hh"
const RCHandleC<OSProcessBodyC> & operator =(const RCHandleC<OSProcessBodyC> & oth)
Assign handle.

RCHandleC<OSProcessBodyC> DeepCopy(UIntT levels = ((UIntT))) const
Do a deep copy of the object.

bool operator ==(const RCHandleC<OSProcessBodyC> & oth) const
Are handles to the same object ?

bool operator !=(const RCHandleC<OSProcessBodyC> & oth) const
Are handles to different objects ?

UIntT Hash() const
Default hash function.
This hashes on the address of the body.

bool IsValid() const
Test if this is a valid handle.

void Invalidate()
Invalidate this handle.
Unattaches the body from the handle.

bool IsHandleType(const DT &) const
Is handle of given type ?

void CheckHandleType(const DT & dummy) const
Check handle type. Throw an expception if not.

UIntT References() const
Find the number of references to the body of this object.

ostream & operator <<(ostream & strm,const RCHandleC<OSProcessBodyC> & obj)

istream & operator >>(istream & strm,RCHandleC<OSProcessBodyC> & obj)


Maintainer:Charles Galambos, Created: 24/11/98, Documentation by CxxDoc: Tue Aug 13 09:59:02 2002