Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Divide::CircularBuffer< T, N, threadSafe > Class Template Reference

#include <CircularBuffer.h>

Classes

struct  Lock
 

Public Member Functions

void reset ()
 
void put (const T &item)
 
const T & get (const size_t idx) const
 
get ()
 
size_t size () const noexcept
 
bool empty () const noexcept
 
bool full () const noexcept
 

Static Public Member Functions

static size_t capacity () noexcept
 

Private Member Functions

bool fullLocked () const noexcept
 

Private Attributes

_buffer [N]
 
size_t _head {0u}
 
size_t _tail {0u}
 
bool _isFull {false}
 

Detailed Description

template<class T, size_t N, bool threadSafe = false>
class Divide::CircularBuffer< T, N, threadSafe >

Definition at line 40 of file CircularBuffer.h.

Member Function Documentation

◆ capacity()

template<class T , size_t N, bool threadSafe = false>
static size_t Divide::CircularBuffer< T, N, threadSafe >::capacity ( )
inlinestaticnoexcept

Definition at line 132 of file CircularBuffer.h.

◆ empty()

template<class T , size_t N, bool threadSafe = false>
bool Divide::CircularBuffer< T, N, threadSafe >::empty ( ) const
inlinenoexcept

Definition at line 120 of file CircularBuffer.h.

◆ full()

template<class T , size_t N, bool threadSafe = false>
bool Divide::CircularBuffer< T, N, threadSafe >::full ( ) const
inlinenoexcept

Definition at line 126 of file CircularBuffer.h.

◆ fullLocked()

template<class T , size_t N, bool threadSafe = false>
bool Divide::CircularBuffer< T, N, threadSafe >::fullLocked ( ) const
inlineprivatenoexcept

Definition at line 139 of file CircularBuffer.h.

◆ get() [1/2]

template<class T , size_t N, bool threadSafe = false>
T Divide::CircularBuffer< T, N, threadSafe >::get ( )
inline

Definition at line 90 of file CircularBuffer.h.

◆ get() [2/2]

template<class T , size_t N, bool threadSafe = false>
const T & Divide::CircularBuffer< T, N, threadSafe >::get ( const size_t  idx) const
inline

Definition at line 84 of file CircularBuffer.h.

◆ put()

template<class T , size_t N, bool threadSafe = false>
void Divide::CircularBuffer< T, N, threadSafe >::put ( const T &  item)
inline

Definition at line 69 of file CircularBuffer.h.

◆ reset()

template<class T , size_t N, bool threadSafe = false>
void Divide::CircularBuffer< T, N, threadSafe >::reset ( )
inline

Definition at line 61 of file CircularBuffer.h.

◆ size()

template<class T , size_t N, bool threadSafe = false>
size_t Divide::CircularBuffer< T, N, threadSafe >::size ( ) const
inlinenoexcept

Definition at line 106 of file CircularBuffer.h.

Member Data Documentation

◆ _buffer

template<class T , size_t N, bool threadSafe = false>
T Divide::CircularBuffer< T, N, threadSafe >::_buffer[N]
private

Definition at line 145 of file CircularBuffer.h.

◆ _head

template<class T , size_t N, bool threadSafe = false>
size_t Divide::CircularBuffer< T, N, threadSafe >::_head {0u}
private

Definition at line 146 of file CircularBuffer.h.

◆ _isFull

template<class T , size_t N, bool threadSafe = false>
bool Divide::CircularBuffer< T, N, threadSafe >::_isFull {false}
private

Definition at line 148 of file CircularBuffer.h.

◆ _tail

template<class T , size_t N, bool threadSafe = false>
size_t Divide::CircularBuffer< T, N, threadSafe >::_tail {0u}
private

Definition at line 147 of file CircularBuffer.h.


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