Process Class Reference
[Classes for basic data types and vectors/arrays (tjutils library)]

#include <tjprocess.h>

List of all members.

Public Member Functions

 Process ()
bool start (const STD_string &cmdline, bool block_till_finished=false, bool log_std_streams=true)
bool finished (int &proc_return_value, STD_string &stdout_result, STD_string &stderr_result, bool block_till_finished=false)
bool finished (int &proc_return_value, bool block_till_finished=false)
bool kill (const svector &extra_kill=svector())
bool operator== (const Process &op) const
bool operator< (const Process &op) const
bool operator!= (const Process &op) const

Static Public Member Functions

static int system (const STD_string &cmdline, STD_string &stdout_result, STD_string &stderr_result)


Detailed Description

Class to for process abstraction.

Definition at line 43 of file tjprocess.h.


Constructor & Destructor Documentation

Process::Process (  )  [inline]

Create non-running process.

Definition at line 50 of file tjprocess.h.


Member Function Documentation

bool Process::start ( const STD_string &  cmdline,
bool  block_till_finished = false,
bool  log_std_streams = true 
)

Start new process with by executing 'cmdline'. If 'block_till_finished' is true, return only after process has terminated. If 'log_std_streams' is true, the output of stdout/stderr is catched and can be queried later by finished(). Returns 'true' if no error occured.

bool Process::finished ( int &  proc_return_value,
STD_string &  stdout_result,
STD_string &  stderr_result,
bool  block_till_finished = false 
)

Return whether process has terminated, returns return value and stdout/stderr output in 'proc_return_value' and 'stdout_result/stderr_result', respectively. If 'block_till_finished' is true return only after process has terminated.

bool Process::finished ( int &  proc_return_value,
bool  block_till_finished = false 
)

Return whether process has terminated, returns return value in 'proc_return_value'. Writes stdout/stderr of child process to the log. If 'block_till_finished' is true return only after process has terminated.

bool Process::kill ( const svector extra_kill = svector()  ) 

Kill process. Additionlly, kill child processes whose program name is in 'extra_kill'.

static int Process::system ( const STD_string &  cmdline,
STD_string &  stdout_result,
STD_string &  stderr_result 
) [static]

Start process by executing 'cmdline'. Return after process has terminated with stdout/stderr output in 'stdout_result/stderr_result'. Returns return code of the process.


The documentation for this class was generated from the following file:
Generated on Sat Jun 14 12:31:51 2008 by  doxygen 1.5.1