From 1bf000423365bcaa12e2ef801b2ecd3f7ab764bf Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Thu, 8 Jan 2015 13:21:38 +0100 Subject: ringbufs, data fusion --- ringbuf.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ringbuf.h') diff --git a/ringbuf.h b/ringbuf.h index 5756153..1f97a12 100644 --- a/ringbuf.h +++ b/ringbuf.h @@ -123,4 +123,12 @@ class ModuloRingbuffer { rb->set(_fixup_range(val)); } + + void add(double val) + { + rb->add(val); + + while (get() < low) rb->add(span); + while (get()>= upp) rb->add(-span); + } }; -- cgit v1.2.3