summaryrefslogtreecommitdiff
path: root/ringbuf.h
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2015-01-08 13:21:38 +0100
committerFlorian Jung <flo@windfisch.org>2015-01-08 13:21:38 +0100
commit1bf000423365bcaa12e2ef801b2ecd3f7ab764bf (patch)
tree1d81222e08f1bbb5ed146a577708275dd37d831b /ringbuf.h
parent1b7c9b6e2eb89e2d17fd0b76d3e3f51308dbc37a (diff)
ringbufs, data fusion
Diffstat (limited to 'ringbuf.h')
-rw-r--r--ringbuf.h8
1 files changed, 8 insertions, 0 deletions
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);
+ }
};