Major project refactoring WIP

This commit is contained in:
2020-05-20 11:45:34 +02:00
parent 4e7eefcdc6
commit b45b7d17fa
45 changed files with 48 additions and 3868 deletions
-40
View File
@@ -1,40 +0,0 @@
#ifndef FASTQUEUE_HPP
#define FASTQUEUE_HPP
#include <cstddef>
#include <cstdint>
#include <atomic>
template <class T>
class FastQueue {
const size_t slot_n_bytes_;
const size_t n_slots_;
char* buffer_;
std::atomic_int* buffer_status_;
uint16_t write_slot_id_;
uint16_t read_slot_id_;
public:
enum SLOT_STATUS {
EMPTY=0,
RESERVED=1,
READY=2
};
FastQueue(const size_t slot_data_n_bytes, const uint16_t n_slots);
virtual ~FastQueue();
T* get_metadata_buffer(const int slot_id);
char* get_data_buffer(const int slot_id);
int reserve();
void commit();
int read();
void release();
};
#endif //FASTQUEUE_HPP