Boost logo

Boost :

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


"Alisdair Meredith" <alisdair.meredith_at_[hidden]> skrev i
meddelandet news:3EE4BB8A.1D8AB0E2_at_uk.renaultf1.com...
> Bo Persson wrote:
>
> > Instead of dropping elements when the buffer is full, we might
also
> > 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
discarded.

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
bop2_at_[hidden]


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk