arduino-emulator
|
Implementation of a Simple Circular Buffer. Instead of comparing the position of the read and write pointer in order to figure out if we still have characters available or space left to write we keep track of the actual length which is easier to follow. This class was implemented to support the reading and writing of arrays. More...
#include <RingBufferExt.h>
Public Member Functions | |
RingBufferExt (int size=1024) | |
int | available () |
int | availableToWrite () |
int | peek () |
int | read () |
int | read (char *str, int len) |
int | read (uint8_t *str, int len) |
size_t | write (char *str, int len) |
size_t | write (uint8_t *str, int len) |
size_t | write (uint8_t ch) |
Protected Attributes | |
int | actual_len = 0 |
int | actual_read_pos = 0 |
int | actual_write_pos = 0 |
std::vector< char > | buffer |
int | max_len |
Implementation of a Simple Circular Buffer. Instead of comparing the position of the read and write pointer in order to figure out if we still have characters available or space left to write we keep track of the actual length which is easier to follow. This class was implemented to support the reading and writing of arrays.