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{
24 namespace platform
25 {
29 class Subprocess final
30 {
31 public:
35 Subprocess() noexcept;
36
43 Subprocess(std::string_view process, std::span<std::string> args = {});
44
50 ~Subprocess() noexcept;
51
58 void create(std::string_view process, std::span<std::string> args = {});
59
65 [[maybe_unused]]
66 int join() noexcept;
67
71 void terminate() noexcept;
72
76 void destroy() noexcept;
77
83 [[nodiscard]]
84 bool alive() noexcept;
85
86 private:
91 };
92 } // namespace platform
93} // namespace galaxy
94
95#endif
struct subprocess_s subprocess
Subprocess.hpp galaxy.
Manages a subprocess launched by galaxy.
void destroy() noexcept
Destroy process, preserving if alive.
void create(std::string_view process, std::span< std::string > args={})
Launch a subprocess.
int join() noexcept
Wait for a process to finish execution.
~Subprocess() noexcept
Destructor.
Subprocess() noexcept
Constructor.
bool alive() noexcept
Check if subprocess is still alive and executing.
subprocess m_process
Process information and handles.
void terminate() noexcept
Terminate process, killing if alive.
Timer.hpp galaxy.
Definition Async.hpp:17