-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add() (or new push()) that overwrites oldest? #10
Comments
This version currently does not have that behavior, but I would definitely see the use case for this. Maybe this will fit your needs? wizard97/Embedded_RingBuf_CPP#12 |
Yes ... your new feature would do what I am looking for:
Is this now a part of your next release? |
I don't currently have plans to add it, but you are welcome to add it in and submit a pull request. |
Ok ... but I'm confused about what I am looking at (not as well versed at Github as I'd like to be) ... who wrote this code that you linked to, and can't you pull that into your project? |
I made both of these projects, they both do the same thing. This one uses only C, the other one takes advantage of C++ features. I think it will just be easier for you if you use my other project (https://github.com/wizard97/Embedded_RingBuf_CPP). The add method has the following signature bool add(const Type &obj, bool overwrite=false) If you call this method with |
I'm curious if there is a way to add an option to add(), or a new call (push()?) that would always add to the queue by "pushing" the oldest item out of the queue?
In the current implementation it appears that if we are adding and the buffer fills, we are forced to lose the "new" items. This works in two of our cases, but we have one where we want the "oldest" data to be lost so that the queue contains the latest {x} records.
Does this make sense? Thoughts?
The text was updated successfully, but these errors were encountered: