|
Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Definition at line 74 of file ring_buffer.hpp.
#include <ring_buffer.hpp>
Public Member Functions | |
| RingBuffer ()=default | |
| bool | push (const T &item) |
| Push an element (producer side) | |
| bool | pop (T &item) |
| Pop the oldest element (consumer side) | |
| bool | empty () const |
| bool | full () const |
| uint32_t | size () const |
| Element count — a snapshot, may change immediately after the call. | |
| void | clear () |
| Empty the buffer. Only while neither producer nor consumer runs. | |
Static Public Member Functions | |
| static constexpr uint32_t | capacity () |
|
default |
|
inline |
Push an element (producer side)
Definition at line 89 of file ring_buffer.hpp.
References sbl::primitives::buffers::detail::ring_acquire_fence(), and sbl::primitives::buffers::detail::ring_release_fence().
|
inline |
Pop the oldest element (consumer side)
item is unchanged Definition at line 107 of file ring_buffer.hpp.
References sbl::primitives::buffers::detail::ring_acquire_fence(), and sbl::primitives::buffers::detail::ring_release_fence().
|
inline |
Definition at line 119 of file ring_buffer.hpp.
|
inline |
Definition at line 124 of file ring_buffer.hpp.
|
inline |
Element count — a snapshot, may change immediately after the call.
Definition at line 130 of file ring_buffer.hpp.
|
inlinestaticconstexpr |
Definition at line 135 of file ring_buffer.hpp.
|
inline |
Empty the buffer. Only while neither producer nor consumer runs.
Definition at line 138 of file ring_buffer.hpp.