galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
galaxy::platform::Subprocess Class Referencefinal

Manages a subprocess launched by galaxy. More...

#include <Subprocess.hpp>

+ Collaboration diagram for galaxy::platform::Subprocess:

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.
 

Detailed Description

Manages a subprocess launched by galaxy.

Definition at line 29 of file Subprocess.hpp.

Constructor & Destructor Documentation

◆ Subprocess() [1/2]

galaxy::platform::Subprocess::Subprocess ( )
noexcept

Constructor.

Definition at line 16 of file Subprocess.cpp.

◆ Subprocess() [2/2]

galaxy::platform::Subprocess::Subprocess ( std::string_view process,
std::span< std::string > args = {} )

Create constructor.

Parameters
processSubprocess to launch. Can include a path.
argsCommand-line args to set for process. Optional.

Definition at line 21 of file Subprocess.cpp.

+ Here is the call graph for this function:

◆ ~Subprocess()

galaxy::platform::Subprocess::~Subprocess ( )
noexcept

Destructor.

Calls terminate().

Definition at line 27 of file Subprocess.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ create()

void galaxy::platform::Subprocess::create ( std::string_view process,
std::span< std::string > args = {} )

Launch a subprocess.

Parameters
processSubprocess to launch. Can include a path.
argsCommand-line args to set for process. Optional.

Definition at line 32 of file Subprocess.cpp.

+ Here is the caller graph for this function:

◆ join()

int galaxy::platform::Subprocess::join ( )
noexcept

Wait for a process to finish execution.

Returns
Process exit code. -1 on error.

Definition at line 52 of file Subprocess.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ terminate()

void galaxy::platform::Subprocess::terminate ( )
noexcept

Terminate process, killing if alive.

Definition at line 68 of file Subprocess.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ destroy()

void galaxy::platform::Subprocess::destroy ( )
noexcept

Destroy process, preserving if alive.

Definition at line 79 of file Subprocess.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ alive()

bool galaxy::platform::Subprocess::alive ( )
nodiscardnoexcept

Check if subprocess is still alive and executing.

Returns
True if process is alive.

Definition at line 90 of file Subprocess.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_process

subprocess galaxy::platform::Subprocess::m_process
private

Process information and handles.

Definition at line 90 of file Subprocess.hpp.


The documentation for this class was generated from the following files: