summaryrefslogtreecommitdiff
path: root/src/ProcessLinux.hpp
blob: 533054e0520d910c6e62bd90c9d880aba187707c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "Process.hpp"
#include <chrono>
#include <fcntl.h>
#include <sys/wait.h>
#include <unistd.h>

namespace uciadapter {

class ProcessLinux : public Process {
  /// @brief Create pipe to engine stdin
  int in_fd[2];
  /// @brief Create pipe to the engine stdout
  int out_fd[2];
  /// @brief Writing buffer
  char buffer[BUFFER_SIZE];
  /// @brief Contains engine pid
  pid_t pid;

public:
  ProcessLinux();
  void Kill();
  void Start(std::string);
  std::string ReadLine();
  void Write(std::string);
};
}; // namespace uciadapter