Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
process.hpp
Go to the documentation of this file.
1#include <array>
2#include <iostream>
3#include <memory>
4#include <string>
5#include <sys/wait.h>
6#include <unistd.h>
7
8class Process {
9 private:
10 pid_t pid;
11 int stdin_fd = 0;
12 int stdout_fd = 0;
13
14 public:
15 Process(const std::string& command);
16 ~Process();
17 Process(const Process&) = delete;
18 Process& operator=(const Process&) = delete;
19 Process(Process&&) = default;
20 Process& operator=(Process&&) = default;
21
23 void write_line(const std::string& line) const;
24
26 std::string read_line() const;
27};
std::string read_line() const
Reads a line from the process.
Definition process.cpp:56
pid_t pid
Definition process.hpp:10
Process & operator=(const Process &)=delete
void write_line(const std::string &line) const
Ends line with a newline character, sends to the process.
Definition process.cpp:49
~Process()
Definition process.cpp:42
int stdin_fd
Definition process.hpp:11
Process(Process &&)=default
Process(const Process &)=delete
int stdout_fd
Definition process.hpp:12
Process & operator=(Process &&)=default