#ifndef RINGBUFFER_H #define RINGBUFFER_H #include class Ringbuffer { public: Ringbuffer(); Ringbuffer(size_t size); ~Ringbuffer(); size_t size() const; size_t size_free(); size_t size_used(); size_t read(void *buf, size_t bufSize); bool write(void *buf, size_t bufSize); private: size_t pSize; unsigned char* headptr; unsigned char* endptr; unsigned char* readptr; unsigned char* writeptr; }; #endif // RINGBUFFER_H