99 std::expected<void, std::string>
start();
128 const std::string&
version()
const {
return version_; }
137 std::int64_t
pid()
const {
return pid_; }
146 std::int64_t pid_ = 0;
148 std::intptr_t handle_ = 0;
151 std::intptr_t group_ = 0;
152 std::string version_;
Starts the auto-tuning executable and keeps it running for the process lifetime.
Definition process.h:73
StopOutcome stop()
Asks the child to exit, then kills it if it does not.
Definition process.cc:113
const std::string & version() const
The version the child reported at startup, or empty when it never started.
Definition process.h:128
Process & operator=(Process &&)=delete
const ProcessOptions & options() const
The options this instance was constructed with.
Definition process.h:134
std::expected< void, std::string > start()
Spawns the child and waits for it to serve.
Definition process.cc:64
Process & operator=(const Process &)=delete
StopOutcome
How a stop ended, so that the caller can log it.
Definition process.h:105
@ Signalled
It ignored the request and exited on the termination signal.
@ NotRunning
Nothing was running.
@ Killed
It ignored both and was killed.
@ Requested
It exited on the exit request, which is the ordinary case.
std::int64_t pid() const
The child's process id, or 0 when nothing is running. For the startup log line.
Definition process.h:137
~Process()
Stops the child. A Motion Master that exits leaves nothing running behind it.
Definition process.cc:60
Process(const Process &)=delete
std::string baseUrl() const
The root URL of the child's API, for a client to build request URLs from.
Definition process.cc:62
Process(Process &&)=delete
std::filesystem::path defaultBinaryName()
Name of the executable Motion Master installs beside itself.
Definition process.cc:50
constexpr std::uint16_t kDefaultPort
Port the child serves on when the configuration names none.
Definition process.h:33
What to start, and where.
Definition process.h:42
std::uint16_t port
Definition process.h:46
std::chrono::milliseconds startTimeout
Definition process.h:59
std::filesystem::path logFile
Definition process.h:51
std::filesystem::path binary
Definition process.h:45