6 template <
typename element_type>
17 buffer =
new element_t[size];
22 memset(
buffer,0,size*
sizeof(element_t));
43 uint8_t tail =
_tail, bestIndex;
48 if (((sample_time -
buffer[tail].element.time_ms) < 100)) {
55 while(
_head != tail) {
59 if (((sample_time -
buffer[tail].element.time_ms) < 100)) {
63 }
else if(
buffer[tail].element.time_ms > sample_time){
66 tail = (tail+1)%
_size;
96 for (uint8_t index=0; index<
_size; index++) {
117 template <
typename element_type>
128 buffer =
new element_t[size];
133 memset(
buffer,0,size*
sizeof(element_t));
146 _youngest = (_youngest+1)%
_size;
149 _oldest = (_youngest+1)%
_size;
168 for (uint8_t index=0; index<
_size; index++) {
195 uint8_t
_size,_oldest,_youngest;
bool recall(element_type &element, uint32_t sample_time)
void push_youngest_element(element_type element)
void reset_history(element_type element)
uint8_t get_youngest_index()
void push(element_type element)
struct obs_ring_buffer_t::element_t * buffer
uint8_t get_oldest_index()
element_type & operator[](uint32_t index)
element_type pop_oldest_element()
void reset_history(element_type element, uint32_t sample_time)
bool is_filled(void) const