On Wed, Feb 18, 2009 at 17:57, Robert Dailey
I insert new events into existing buckets anywhere in the container, it does not necessarily have to be from the back. I always remove items from the front since they are processed linearly.
One can kind of think of this as a std::deque< std::vector<> >, but the containing deque would need to be given a fixed size of 100 (as in the example above). The tricky part is shifting all of the "buckets" (the buckets in this case would be the inner-vector objects) forward when something from the front is removed. The key here is that I do not want to call pop_front() each time a bucket is processed because I want to avoid constant new/delete operations since insertion and removal will be happening quite frequently.
I'm not sure what the best approach to solving this problem is. I'm hoping someone in the community will be able to suggest a way in which boost can easily solve this problem. Thanks to everyone for taking the time to read this.
Perhaps this?
boost::circular_buffer