AsmGrader 0.0.0
|
A subprocess managed by a tracer. More...
#include <traced_subprocess.hpp>
Public Member Functions | |
~TracedSubprocess () override | |
Tracer & | get_tracer () |
const Tracer & | get_tracer () const |
Result< RunResult > | run () |
Run until timeout or process exit. | |
Result< int > | wait_for_exit (std::chrono::microseconds timeout) override |
Blocks until exit or timeout. | |
std::optional< int > | get_exit_code () const |
Subprocess (std::string exec, std::vector< std::string > args) | |
Creates a sub (child) process by running exec with args ENV variables remain as default for for the child process. | |
Subprocess (Subprocess &&) noexcept | |
Subprocess ()=default | |
![]() | |
Subprocess (std::string exec, std::vector< std::string > args) | |
Creates a sub (child) process by running exec with args ENV variables remain as default for for the child process. | |
virtual | ~Subprocess () |
Subprocess (Subprocess &&) noexcept | |
Subprocess & | operator= (Subprocess &&) noexcept |
template<typename Rep , typename Period > | |
Result< std::string > | read_stdout (const std::chrono::duration< Rep, Period > &timeout) |
Result< std::string > | read_stdout () |
const std::string & | get_full_stdout () |
Get all stdout since the program has launched. | |
Result< void > | send_stdin (const std::string &str) |
virtual Result< void > | start () |
int | wait_for_exit () |
bool | is_alive () const |
Whether child process is alive. | |
Result< void > | close_pipes () |
Close stdout and stdin pipes to child Useful for when the child is blocking on a read to stdin. | |
pid_t | get_pid () const |
std::optional< int > | get_exit_code () const |
virtual Result< void > | kill () |
Manually kill subprocess with SIGKILL. | |
virtual Result< void > | restart () |
Additional Inherited Members | |
![]() | |
Subprocess ()=default | |
virtual Result< void > | create (const std::string &exec, const std::vector< std::string > &args) |
A subprocess managed by a tracer.
|
override |
|
inline |
|
inline |
|
inline |
|
default |
|
explicit |
Creates a sub (child) process by running exec
with args
ENV variables remain as default for for the child process.
|
noexcept |
|
overridevirtual |
Blocks until exit or timeout.
Reimplemented from asmgrader::Subprocess.