Skip to content

Class daisy::RingBuffer< T, 0 >

template <typename T>

ClassList > daisy > RingBuffer< T, 0 >

More...

  • #include <ringbuffer.h>

Public Functions

Type Name
void Advance (size_t num_elements)
void Flush ()
T * GetMutableBuffer ()
T ImmediateRead ()
void ImmediateRead (T * destination, size_t num_elements)
void Init ()
void Overwrite (T v)
void Overwrite (const T * source, size_t num_elements)
T Read ()
RingBuffer ()
void Swallow (size_t n)
void Write (T v)
size_t capacity () const
bool isEmpty () const
size_t readable () const
size_t writable () const

Detailed Description

Utility Ring Buffer imported from pichenettes/stmlib

Public Functions Documentation

function Advance

inline void daisy::RingBuffer< T, 0 >::Advance (
    size_t num_elements
) 

Advances the write pointer, for when a peripheral is writing to the buffer.


function Flush

inline void daisy::RingBuffer< T, 0 >::Flush () 

Flush the buffer


function GetMutableBuffer

inline T * daisy::RingBuffer< T, 0 >::GetMutableBuffer () 

Returns a pointer to the actual Ring Buffer Useful for when a peripheral needs direct access to the buffer.


function ImmediateRead [½]

inline T daisy::RingBuffer< T, 0 >::ImmediateRead () 

Returns:

Read value


function ImmediateRead [2/2]

inline void daisy::RingBuffer< T, 0 >::ImmediateRead (
    T * destination,
    size_t num_elements
) 

Parameters:

  • destination &
  • num_elements &

function Init

inline void daisy::RingBuffer< T, 0 >::Init () 

Initialize ringbuffer


function Overwrite [½]

inline void daisy::RingBuffer< T, 0 >::Overwrite (
    T v
) 

Parameters:

  • v Value to overwrite

function Overwrite [2/2]

inline void daisy::RingBuffer< T, 0 >::Overwrite (
    const T * source,
    size_t num_elements
) 

Parameters:

  • source 3
  • num_elements &

function Read

inline T daisy::RingBuffer< T, 0 >::Read () 

Returns:

Read value


function RingBuffer

inline daisy::RingBuffer< T, 0 >::RingBuffer () 

function Swallow

inline void daisy::RingBuffer< T, 0 >::Swallow (
    size_t n
) 

Read enough samples to make it possible to read 1 sample.

Parameters:

  • n Size of T ?

function Write

inline void daisy::RingBuffer< T, 0 >::Write (
    T v
) 

Parameters:

  • v Value to write

function capacity

inline size_t daisy::RingBuffer< T, 0 >::capacity () const

Returns:

0


function isEmpty

inline bool daisy::RingBuffer< T, 0 >::isEmpty () const

Returns:

True, if the buffer is empty.


function readable

inline size_t daisy::RingBuffer< T, 0 >::readable () const

Returns:

0


function writable

inline size_t daisy::RingBuffer< T, 0 >::writable () const

Returns:

0



The documentation for this class was generated from the following file external-docs/libDaisy/src/util/ringbuffer.h