eive_arduino_interface/helper/SimpleRingBuffer.h
2020-04-02 18:32:37 +02:00

22 lines
720 B
C++

#ifndef FRAMEWORK_CONTAINER_SIMPLERINGBUFFER_H_
#define FRAMEWORK_CONTAINER_SIMPLERINGBUFFER_H_
#include "RingBufferBase.h"
#include <stddef.h>
class SimpleRingBuffer: public RingBufferBase<> {
public:
SimpleRingBuffer(size_t size, bool overwriteOld);
virtual ~SimpleRingBuffer();
ReturnValue_t writeData(const uint8_t* data, size_t amount);
ReturnValue_t readData(uint8_t* data, size_t amount, bool readRemaining = false, size_t* trueAmount = NULL);
ReturnValue_t deleteData(size_t amount, bool deleteRemaining = false, size_t* trueAmount = NULL);
private:
// static const uint8_t TEMP_READ_PTR = 1;
static const uint8_t READ_PTR = 0;
uint8_t* buffer;
};
#endif /* FRAMEWORK_CONTAINER_SIMPLERINGBUFFER_H_ */