Boost logo

Boost Users :

Subject: Re: [Boost-users] sliding window containing n seconds of data
From: Ben Pope (benpope81_at_[hidden])
Date: 2015-04-22 01:10:12


On Wednesday, April 22, 2015 12:22 PM, Lane wrote:
> I like the idea of using a circular_buffer, but still not sure how to
> time the data on this buffer. I'd like for objects on this buffer to be
> removed after n seconds, and not based on fixed capacity where they get
> over-written. Or did I misunderstand? I think somehow attaching a timer
> to each and every object on this buffer is the part I'm having trouble
> with efficiently.

I don't think you need to remove them after n seconds, you just need to
not read entries older than n seconds, so perhaps store the data with a
timestamp, and then clean up or ignore old entries during the read.

Ben


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net