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::Subprocess Class Referencefinal

Manages a subprocess launched by galaxy. More...

#include <Subprocess.hpp>

+ Collaboration diagram for galaxy::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.
 
bool wait (const bool block) noexcept
 Wait for a process to finish execution.
 
void kill () noexcept
 Terminates process.
 

Private Attributes

SDL_Process * m_process
 Process information and handles.
 

Detailed Description

Manages a subprocess launched by galaxy.

Definition at line 21 of file Subprocess.hpp.

Constructor & Destructor Documentation

◆ Subprocess() [1/2]

galaxy::Subprocess::Subprocess ( )
noexcept

Constructor.

Definition at line 14 of file Subprocess.cpp.

◆ Subprocess() [2/2]

galaxy::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 19 of file Subprocess.cpp.

+ Here is the call graph for this function:

◆ ~Subprocess()

galaxy::Subprocess::~Subprocess ( )
noexcept

Destructor.

Calls terminate().

Definition at line 25 of file Subprocess.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ create()

void galaxy::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 30 of file Subprocess.cpp.

+ Here is the caller graph for this function:

◆ wait()

bool galaxy::Subprocess::wait ( const bool block)
noexcept

Wait for a process to finish execution.

Parameters
blockShould the main app be blocked until the subprocess exits?
Returns
Returns True if process exited, otherwise false.

Definition at line 51 of file Subprocess.cpp.

+ Here is the caller graph for this function:

◆ kill()

void galaxy::Subprocess::kill ( )
noexcept

Terminates process.

Definition at line 56 of file Subprocess.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_process

SDL_Process* galaxy::Subprocess::m_process
private

Process information and handles.

Definition at line 71 of file Subprocess.hpp.


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