|
Pakman
|
#include <ForkedWorkerHandler.h>


Public Member Functions | |
| ForkedWorkerHandler (const Command &simulator, const std::string &input_string) | |
| virtual | ~ForkedWorkerHandler () override |
| virtual bool | isDone () override |
Public Member Functions inherited from AbstractWorkerHandler | |
| AbstractWorkerHandler (const Command &simulator, const std::string &input_string) | |
| virtual | ~AbstractWorkerHandler ()=default |
| std::string | getOutput () |
| int | getErrorCode () |
Additional Inherited Members | |
Protected Attributes inherited from AbstractWorkerHandler | |
| const Command | m_simulator |
| const std::string | m_input_string |
| std::string | m_output_buffer |
| int | m_error_code = -1 |
A class for representing forked Workers.
Forked Workers are spawned using a fork()–exec() pattern. This is the default choice for instantiating simulators and is analogous to how SerialMaster launches simulations.
Definition at line 15 of file ForkedWorkerHandler.h.
| ForkedWorkerHandler::ForkedWorkerHandler | ( | const Command & | simulator, |
| const std::string & | input_string | ||
| ) |
Construct from simulator string and input string.
The constructor will fork a process whose standard input and output is redirected to a write and a read pipe, respectively.. The input string is immediately written to the write pipe.
| simulator | command to run simulation. |
| input_string | input string to simulator. |
Definition at line 15 of file ForkedWorkerHandler.cc.
|
overridevirtual |
Destructor.
The destructor waits on the forked process and closes the read pipe.
Definition at line 30 of file ForkedWorkerHandler.cc.
|
overridevirtual |
Poll read pipe for any outstanding output and check whether forked process has finished.
Implements AbstractWorkerHandler.
Definition at line 81 of file ForkedWorkerHandler.cc.