arduino-emulator
Public Member Functions | Protected Attributes | List of all members
arduino::RingBufferExt Class Reference

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=512)
 
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
 
char * buffer
 
int max_len
 

Detailed Description

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.


The documentation for this class was generated from the following file: