stellar

UCI Chess engine written in C++20
git clone git://git.dimitrijedobrota.com/stellar.git
Log | Files | Refs | README | LICENSE

engine.hpp (767B)


0 #ifndef STELLAR_ARENA_ENGINE_H
1 #define STELLAR_ARENA_ENGINE_H
3 #include <queue>
5 class Engine {
6 public:
7 Engine(const Engine &) = delete;
8 Engine &operator=(const Engine &) = delete;
9 Engine(const char *file);
11 ~Engine();
13 const std::string &get_name(void) const { return name; }
14 const std::string &get_author(void) const { return author; }
16 void send(std::string &&command);
17 std::string receive(void);
19 private:
20 [[noreturn]] void start_engine(void);
22 const char *file = nullptr;
23 int fd_to[2], fd_from[2];
24 pid_t engine_pid;
26 std::string name, author;
28 char rb[1000];
29 int rb_size = 0;
31 std::queue<std::string> q;
32 std::string q_buffer;
34 static uint16_t id_t;
35 uint16_t id = id_t++;
36 };
38 #endif