a class used to handle external processes
More...
#include </home/runner/work/tfel/tfel/include/TFEL/System/ProcessManager.hxx>
|
| enum | RedirectionType { None
, StdIn
, StdOut
, StdInAndOut
} |
|
using | ProcessId = pid_t |
| | a simple alias
|
|
using | StreamId = int |
| | a simple alias
|
|
using | rstream = rstreamView<true> |
| | a simple alias
|
|
using | wstream = wstreamView<true> |
| | a simple alias
|
|
| void | stopOnSignals (const bool) |
|
virtual void | killProcess (const ProcessId) |
|
virtual void | sendSignal (const ProcessId, const int=SIGTERM) |
| virtual ProcessId | createProcess (const std::string &, const RedirectionType=None) |
| virtual ProcessId | createProcess (const std::string &, const std::string &, const std::string &, const std::string &, const std::map< std::string, std::string > &={}) |
| virtual ProcessId | createProcess (const std::string &, const std::string &, const std::string &, const std::map< std::string, std::string > &={}) |
| virtual void | execute (const std::string &, const std::string &, const std::string &, const std::string &, const std::map< std::string, std::string > &={}) |
| virtual void | execute (const std::string &, const std::string &="", const std::string &="", const std::map< std::string, std::string > &={}) |
|
virtual wstream | getInputStream (const ProcessId) const |
|
virtual rstream | getOutputStream (const ProcessId) const |
|
virtual ProcessId | createProcess (ProcessManager::Command &) |
|
virtual void | wait (const ProcessId) |
| virtual | ~ProcessManager () |
a class used to handle external processes
◆ ~ProcessManager()
| virtual tfel::system::ProcessManager::~ProcessManager |
( |
| ) |
|
|
virtual |
destructor. kills all registred process and close all input/output file descriptors.
◆ createProcess() [1/3]
| virtual ProcessId tfel::system::ProcessManager::createProcess |
( |
const std::string & | , |
|
|
const RedirectionType | = None ) |
|
virtual |
create a new process
- Parameters
-
| const | std::string&, command to be executed. The first word is the program name, the others options |
| const | RedirectionType, tells if standard file descriptors must be redirected. |
- Returns
- const ProcessId, the pid of the new process
◆ createProcess() [2/3]
| virtual ProcessId tfel::system::ProcessManager::createProcess |
( |
const std::string & | , |
|
|
const std::string & | , |
|
|
const std::string & | , |
|
|
const std::map< std::string, std::string > & | = {} ) |
|
virtual |
create a new process
- Parameters
-
| [in] | command | command to be executed. The first word is the program name, the others options |
| [in] | const | std::string&, name of a file to which the new process standard input is redirected. This option is ignored if this name is void. |
| const | std::string&, name of a file to which the new process standard output is redirected. This option is ignored if this name is void. |
| [in] | e | : additionnal environment variables for the child process |
- Returns
- the pid of the new process
◆ createProcess() [3/3]
| virtual ProcessId tfel::system::ProcessManager::createProcess |
( |
const std::string & | , |
|
|
const std::string & | , |
|
|
const std::string & | , |
|
|
const std::string & | , |
|
|
const std::map< std::string, std::string > & | = {} ) |
|
virtual |
create a new process
- Parameters
-
| [in] | command | command to be executed. The first word is the program name, the others options |
| [in] | const | std::string&, name of a file to which the new process standard input is redirected. This option is ignored if this name is void. |
| const | std::string&, name of a file to which the new process standard output is redirected. This option is ignored if this name is void. |
| [in] | e | : additionnal environment variables for the child process |
- Returns
- the pid of the new process
◆ execute() [1/2]
| virtual void tfel::system::ProcessManager::execute |
( |
const std::string & | , |
|
|
const std::string & | , |
|
|
const std::string & | , |
|
|
const std::string & | , |
|
|
const std::map< std::string, std::string > & | = {} ) |
|
virtual |
execute the command and wait until its end
- Parameters
-
| const | std::string&, command to be executed. The first word is the program name, the others options |
| const | std::string&, name of a file to which the new process standard input is redirected. This option is ignored if this name is void. |
| const | std::string&, name of a file to which the new process standard output is redirected. This option is ignored if this name is void. |
| [in] | e | : additionnal environment variables for the child process |
◆ execute() [2/2]
| virtual void tfel::system::ProcessManager::execute |
( |
const std::string & | , |
|
|
const std::string & | = "", |
|
|
const std::string & | = "", |
|
|
const std::map< std::string, std::string > & | = {} ) |
|
virtual |
execute the command and wait until its end
- Parameters
-
| const | std::string&, command to be executed. The first word is the program name, the others options |
| const | std::string&, name of a file to which the new process standard input is redirected. This option is ignored if this name is void. |
| const | std::string&, name of a file to which the new process standard output is redirected. This option is ignored if this name is void. |
| [in] | e | : additionnal environment variables for the child process |
◆ stopOnSignals()
| void tfel::system::ProcessManager::stopOnSignals |
( |
const bool | | ) |
|
- Note
- this method is not virtual to be callable in ProcessManager's constructor
The documentation for this struct was generated from the following file: