ODIN
Public Member Functions | Static Public Member Functions | List of all members

#include <tjprocess.h>

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())
 

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::Process ( )
inline

Create non-running process.

Definition at line 50 of file tjprocess.h.

Member Function Documentation

◆ finished() [1/2]

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.

◆ finished() [2/2]

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.

◆ kill()

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

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

◆ start()

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

◆ system()

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: