Arduino MIDI File Parser
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
midi::RingBuffer Class Reference

RingBuffer that supports extensive peek operations to access and compare the next values. More...

#include <RingBuffer.h>

Public Member Functions

 RingBuffer (RingBuffer &t)
 
 RingBuffer (int size)
 
uint8_t read ()
 
bool isFull ()
 
bool isEmpty ()
 
bool write (uint8_t data)
 
int write (const uint8_t *data, size_t len)
 
void reset ()
 
int available ()
 
int availableForWrite ()
 
void resize (int len)
 
int size ()
 Returns the maximum capacity of the buffer.
 
int peek ()
 
int peek (int idx)
 peeks the idx next entry from the buffer
 
uint8_t * peekStr (int idx, int len)
 returns a temporary copy of the requested bytes
 
uint8_t operator[] (int idx)
 alternaive syntax to peek(idx)
 
bool equals (const char *str)
 Compares the string with the current peek values.
 
void consume (int offset)
 Removes the next n characters from the ringbuffer.
 

Protected Member Functions

int nextIndex (int index)
 

Protected Attributes

uint8_t * _aucBuffer = nullptr
 
int _iHead
 
int _iTail
 
int _numElems
 
int max_size = 0
 

Detailed Description

RingBuffer that supports extensive peek operations to access and compare the next values.

Author
Phil Schatzmann

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