Motion Master 6.0.0-alpha.86
Next-generation motion control software
Loading...
Searching...
No Matches
process_platform.h
Go to the documentation of this file.
1#pragma once
2
3#include <chrono>
4#include <cstdint>
5#include <expected>
6#include <filesystem>
7#include <string>
8#include <vector>
9
27
29
31struct Child {
32 std::int64_t pid = 0;
33 std::intptr_t handle = 0;
34 std::intptr_t group = 0;
35};
36
46std::expected<Child, std::string> spawnChild(const std::filesystem::path& binary,
47 const std::vector<std::string>& args,
48 const std::filesystem::path& logFile);
49
55bool childAlive(const Child& child);
56
66bool terminateChild(const Child& child, std::chrono::milliseconds grace);
67
68} // namespace mm::auto_tuning::detail
Definition process_platform.h:28
bool childAlive(const Child &child)
Whether child is still running.
Definition process_posix.cc:107
std::expected< Child, std::string > spawnChild(const std::filesystem::path &binary, const std::vector< std::string > &args, const std::filesystem::path &logFile)
Runs binary with args, with its output appended to logFile.
Definition process_posix.cc:41
bool terminateChild(const Child &child, std::chrono::milliseconds grace)
Asks child to exit, waits up to grace, then kills it and everything it started.
Definition process_posix.cc:114
A started child, as the platform identifies it.
Definition process_platform.h:31
std::intptr_t group
Definition process_platform.h:34
std::int64_t pid
Definition process_platform.h:32
std::intptr_t handle
Definition process_platform.h:33