#ifndef SPSC_QUEUE #define SPSC_QUEUE #include #include #include #include "../include/command.hpp" class SpscQueue{ public: SpscQueue(){ head.store(0, std::memory_order_relaxed); tail.store(0, std::memory_order_relaxed); buffer.fill({CommandType::None, 0, 0}); } bool push(const Command&); bool pop(Command&); private: std::array buffer; std::atomic head; std::atomic tail; }; #endif