Manages a subprocess launched by galaxy. More...
#include <Subprocess.hpp>
Public Member Functions | |
| Subprocess () noexcept | |
| Constructor. | |
| Subprocess (std::string_view process, std::span< std::string > args={}) | |
| Create constructor. | |
| ~Subprocess () noexcept | |
| Destructor. | |
| void | create (std::string_view process, std::span< std::string > args={}) |
| Launch a subprocess. | |
| int | join () noexcept |
| Wait for a process to finish execution. | |
| void | terminate () noexcept |
| Terminate process, killing if alive. | |
| void | destroy () noexcept |
| Destroy process, preserving if alive. | |
| bool | alive () noexcept |
| Check if subprocess is still alive and executing. | |
Private Attributes | |
| subprocess | m_process |
| Process information and handles. | |
Manages a subprocess launched by galaxy.
Definition at line 27 of file Subprocess.hpp.
|
noexcept |
Constructor.
Definition at line 14 of file Subprocess.cpp.
| galaxy::Subprocess::Subprocess | ( | std::string_view | process, |
| std::span< std::string > | args = {} ) |
Create constructor.
| process | Subprocess to launch. Can include a path. |
| args | Command-line args to set for process. Optional. |
Definition at line 19 of file Subprocess.cpp.
|
noexcept |
Destructor.
Calls terminate().
Definition at line 25 of file Subprocess.cpp.
| void galaxy::Subprocess::create | ( | std::string_view | process, |
| std::span< std::string > | args = {} ) |
Launch a subprocess.
| process | Subprocess to launch. Can include a path. |
| args | Command-line args to set for process. Optional. |
Definition at line 30 of file Subprocess.cpp.
|
noexcept |
Wait for a process to finish execution.
Definition at line 50 of file Subprocess.cpp.
|
noexcept |
Terminate process, killing if alive.
Definition at line 66 of file Subprocess.cpp.
|
noexcept |
Destroy process, preserving if alive.
Definition at line 77 of file Subprocess.cpp.
|
nodiscardnoexcept |
Check if subprocess is still alive and executing.
Definition at line 88 of file Subprocess.cpp.
|
private |
Process information and handles.
Definition at line 88 of file Subprocess.hpp.