3 This file is part of NetVis
4 Copyright @ 2008 Mikko Rasa, Mikkosoft Productions
5 Distributed unter the GPL
22 RingBuffer(unsigned s): sz(s), data(sz), pos(0) { }
23 void push(const T &v) { data[pos=(pos+1)%sz] = v; }
24 const T &get(unsigned i) const { return data[(pos+sz-i)%sz]; }
25 unsigned size() const { return sz; }