about summary refs log tree commit diff stats
path: root/src/client/client.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/client.h')
-rw-r--r--src/client/client.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/client/client.h b/src/client/client.h
new file mode 100644
index 0000000..9ff5b47
--- /dev/null
+++ b/src/client/client.h
@@ -0,0 +1,32 @@
+#pragma once
+
+#include <cstring>
+#include <fcntl.h>
+#include <iostream>
+#include <optional>
+#include <pthread.h>
+#include <string>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <utility>
+
+#include "shared_memory.h"
+class Client {
+public:
+    Client();
+    ~Client();
+
+    void start_client();
+
+private:
+    SharedMemory* shared_memory;
+    int shm_fd;
+
+    int send_request(
+        SharedMemory* shared_memory,
+        Operations type,
+        std::optional<const std::string> k,
+        std::optional<const std::string> v);
+    bool request_processed(SharedMemory* shared_memory, int index);
+    std::string process_result(SharedMemory* shared_memory, int index);
+};