DIY Auto-Correlator 1.0
Auto-Correlator Card implementation using Teensy 4.x microcontrollers.
Public Member Functions | Private Attributes | List of all members
Simpler_Circular_Buffer< Type, MaxSize > Class Template Reference

#include <simpler_circular_buffer.hpp>

Public Member Functions

void reset () __attribute__((always_inline))
 Index / Pointer to the last element of the buffer. More...
 
void push_back (const Type datum) __attribute__((flatten))
 Adds a datum to the circular buffer. More...
 
Type operator[] (const size_t index) const __attribute__((always_inline))
 Random access operator can be used to retrive the nth element in the buffer at any state of the buffer. More...
 

Private Attributes

Type buffer [MaxSize] = {0}
 
size_t head = 0
 Fixed Size Buffer. More...
 
size_t tail = 0
 Index / Pointer of the first element of the buffer. More...
 

Member Function Documentation

◆ operator[]()

template<typename Type , size_t MaxSize>
Type Simpler_Circular_Buffer< Type, MaxSize >::operator[] ( const size_t  index) const
inline

Random access operator can be used to retrive the nth element in the buffer at any state of the buffer.

◆ push_back()

template<typename Type , size_t MaxSize>
void Simpler_Circular_Buffer< Type, MaxSize >::push_back ( const Type  datum)
inline

Adds a datum to the circular buffer.

◆ reset()

template<typename Type , size_t MaxSize>
void Simpler_Circular_Buffer< Type, MaxSize >::reset ( )
inline

Index / Pointer to the last element of the buffer.

Resets the buffer (pointers) without clearing the elements.

Member Data Documentation

◆ buffer

template<typename Type , size_t MaxSize>
Type Simpler_Circular_Buffer< Type, MaxSize >::buffer[MaxSize] = {0}
private

◆ head

template<typename Type , size_t MaxSize>
size_t Simpler_Circular_Buffer< Type, MaxSize >::head = 0
private

Fixed Size Buffer.

◆ tail

template<typename Type , size_t MaxSize>
size_t Simpler_Circular_Buffer< Type, MaxSize >::tail = 0
private

Index / Pointer of the first element of the buffer.


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