summaryrefslogtreecommitdiff
path: root/src/ProcessLinux.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ProcessLinux.hpp')
-rw-r--r--src/ProcessLinux.hpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/ProcessLinux.hpp b/src/ProcessLinux.hpp
new file mode 100644
index 0000000..533054e
--- /dev/null
+++ b/src/ProcessLinux.hpp
@@ -0,0 +1,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 \ No newline at end of file