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
Subprocess.hpp
Go to the documentation of this file.
1
7
8#ifndef GALAXY_PLATFORM_SUBPROCESS_HPP_
9#define GALAXY_PLATFORM_SUBPROCESS_HPP_
10
11#include <span>
12#include <string>
13#include <string_view>
14
15#include <subprocess.h>
16
20typedef struct subprocess_s subprocess;
21
22namespace galaxy
23{
27 class Subprocess final
28 {
29 public:
33 Subprocess() noexcept;
34
41 Subprocess(std::string_view process, std::span<std::string> args = {});
42
48 ~Subprocess() noexcept;
49
56 void create(std::string_view process, std::span<std::string> args = {});
57
63 [[maybe_unused]]
64 int join() noexcept;
65
69 void terminate() noexcept;
70
74 void destroy() noexcept;
75
81 [[nodiscard]]
82 bool alive() noexcept;
83
84 private:
89 };
90} // namespace galaxy
91
92#endif
struct subprocess_s subprocess
Subprocess.hpp galaxy.
void terminate() noexcept
Terminate process, killing if alive.
~Subprocess() noexcept
Destructor.
Subprocess() noexcept
Constructor.
int join() noexcept
Wait for a process to finish execution.
subprocess m_process
Process information and handles.
bool alive() noexcept
Check if subprocess is still alive and executing.
void create(std::string_view process, std::span< std::string > args={})
Launch a subprocess.
void destroy() noexcept
Destroy process, preserving if alive.
Application.hpp galaxy.