11 #ifndef __RING_BUFFER_HEADER
12 #define __RING_BUFFER_HEADER
14 #include "../ustd/ard_assert.hpp"
15 #include "../ustd/array.hpp"
18 template<
typename T, u
int16_t N>
47 return array_[(count_ - 1 - pos) %
size()];
51 return array_[(count_ - 1 - pos) %
size()];
55 return (*
this)[
size() - 1];
59 return (*
this)[
size() - 1];
71 return ((count_ < N) ? count_ : N);
88 template<
typename Archive>
97 template<
typename T, u
int16_t N,
typename S>
98 S & operator<<(S & os, ring_buffer<T, N>
const & arg) {
104 #endif //__RING_BUFFER_HEADER
void print(S &os) const
print to any stream-concept
Definition: array.hpp:117
basically just a wrap for an cpp-array
Definition: array.hpp:22
#define ASSERT(exp)
Definition: ard_assert.hpp:33