VLCB
Loading...
Searching...
No Matches
VLCB::CircularBuffer< E, bufferCapacity > Class Template Reference

#include <CircularBuffer.h>

Public Member Functions

 CircularBuffer ()
 ~CircularBuffer ()
bool available () const
 if buffer has one or more stored items
E * peek ()
 peek at the next item in the buffer without removing it
const E & pop ()
 retrieve the next item from the buffer, requires that available() is checked first.
void put (const E &entry)
void clear ()
 clear all items
uint8_t bufUse () const
 recalculate number of items in the buffer
unsigned int getNumberOfPuts () const
unsigned int getNumberOfGets () const
unsigned int getOverflows () const
unsigned int getHighWaterMark () const

Constructor & Destructor Documentation

◆ CircularBuffer()

template<typename E, int bufferCapacity>
VLCB::CircularBuffer< E, bufferCapacity >::CircularBuffer ( )
explicit

◆ ~CircularBuffer()

template<typename E, int bufferCapacity>
VLCB::CircularBuffer< E, bufferCapacity >::~CircularBuffer ( )

Member Function Documentation

◆ available()

template<typename E, int bufferCapacity>
bool VLCB::CircularBuffer< E, bufferCapacity >::available ( ) const

if buffer has one or more stored items

◆ peek()

template<typename E, int bufferCapacity>
E * VLCB::CircularBuffer< E, bufferCapacity >::peek ( )

peek at the next item in the buffer without removing it

◆ pop()

template<typename E, int bufferCapacity>
const E & VLCB::CircularBuffer< E, bufferCapacity >::pop ( )

retrieve the next item from the buffer, requires that available() is checked first.

◆ put()

template<typename E, int bufferCapacity>
void VLCB::CircularBuffer< E, bufferCapacity >::put ( const E & entry)

store an item to the buffer - overwrite the oldest item if buffer is full never called from an interrupt context so we don't need to worry about interrupts

◆ clear()

template<typename E, int bufferCapacity>
void VLCB::CircularBuffer< E, bufferCapacity >::clear ( )

clear all items

◆ bufUse()

template<typename E, int bufferCapacity>
uint8_t VLCB::CircularBuffer< E, bufferCapacity >::bufUse ( ) const

recalculate number of items in the buffer

◆ getNumberOfPuts()

template<typename E, int bufferCapacity = 4>
unsigned int VLCB::CircularBuffer< E, bufferCapacity >::getNumberOfPuts ( ) const
inline

◆ getNumberOfGets()

template<typename E, int bufferCapacity = 4>
unsigned int VLCB::CircularBuffer< E, bufferCapacity >::getNumberOfGets ( ) const
inline

◆ getOverflows()

template<typename E, int bufferCapacity = 4>
unsigned int VLCB::CircularBuffer< E, bufferCapacity >::getOverflows ( ) const
inline

◆ getHighWaterMark()

template<typename E, int bufferCapacity = 4>
unsigned int VLCB::CircularBuffer< E, bufferCapacity >::getHighWaterMark ( ) const
inline

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