#include <pprocess.h>
Public Types | |
| typedef std::list< std::string > | arg_list |
| Argument list type. | |
| enum | state_t { Stopped, Running, Stopping } |
| Child process state. More... | |
| enum | commMode_t { NoCommunication = 0, StdIn = 1, StdOut = 2, StdErr = 4, AllOutput = 6, All = 7 } |
| Communication mode flags. More... | |
Public Member Functions | |
| Process (const char *path, const arg_list &args=arg_list()) throw (IOError) | |
| Process constructor. | |
| ~Process () throw () | |
| state_t | state () const |
| Returns the process state. | |
| void | addArg (const char *arg) |
| Add argument. | |
| void | clearArgs () |
| Clear arguments. | |
| void | setWorkDir (const char *dir) |
| Set working directory. | |
| const std::string & | workDir () const |
| void | start (commMode_t mode=NoCommunication) throw (SystemError,IOError,LogicError) |
| Run program. | |
| void | stop () throw (SystemError) |
| Terminate process. | |
| void | kill () throw (SystemError) |
| Kill process. | |
| bool | tryWait (int &exitCode) throw (SystemError) |
| Try wait for program to finish. | |
| int | wait () throw (SystemError) |
| Wait for program to finish. | |
| ProcessIO * | processIO () const throw () |
| Return pointer to process i/o object. | |
Static Public Member Functions | |
| Process * | tryWaitAny (int &exitCode) throw (SystemError) |
| Try waiting for any child process to exit. | |
| Process * | waitAny (int &exitCode) throw (SystemError) |
| Wait for any child process to exit. | |
This class is used to concurrently execute child processes.
Definition at line 95 of file pprocess.h.
|
|
Argument list type.
Definition at line 115 of file pprocess.h. |
|
|
Communication mode flags.
Definition at line 105 of file pprocess.h. |
|
|
Child process state.
Definition at line 98 of file pprocess.h. |
|
||||||||||||
|
Process constructor.
|
|
|
|
|
|
Add argument.
|
|
|
Clear arguments.
|
|
|
Kill process.
|
|
|
Return pointer to process i/o object. This method returns a pointer to the ProcessIO object that can be used to communicate with the child process's stdin, stdout and stderr. The pointer returned maybe NULL if no process is active.
Definition at line 169 of file pprocess.h. |
|
|
Set working directory.
|
|
|
Run program.
|
|
|
Returns the process state.
Definition at line 124 of file pprocess.h. |
|
|
Terminate process.
|
|
|
Try wait for program to finish.
|
|
|
Try waiting for any child process to exit.
|
|
|
Wait for program to finish.
|
|
|
Wait for any child process to exit.
|
|
|
Definition at line 136 of file pprocess.h. |
1.3.3