Boost logo

Boost :

From: Bo Persson (bop2_at_[hidden])
Date: 2003-06-09 14:50:35

"Alisdair Meredith" <alisdair.meredith_at_[hidden]> skrev i
> Bo Persson wrote:
> > Instead of dropping elements when the buffer is full, we might
> > consider waiting or throwing a failure.
> "The one true circular buffer template" is a nigh impossible goal,
> because it means so many things to different people.

Yes, sure. I just reacted to the suggested names cyclic_buffer and
circular_buffer, which means slightly different things to me.

In one case we have a cycle, like in your case with a few minutes of
samples. The latest n samples are interesting, the older ones can be

Another use for a circular (not cyclic :-) buffer is for the
producer-consumer case, where some objects are queued temporarily.
Here we can have the buffer wrap around at the ends, so we don't have
to move any objects after a pop_front(). We can redefine the front
position instead. If you run in a circle, you don't have an end case.

Bo Persson

Boost list run by bdawes at, gregod at, cpdaniel at, john at