![]() ![]() ![]() The article was originally published on my personal website. This post presents a Ring Buffer implemented in C++ using templates. A common use case is when data are generated and consumed at different rates, so that the most recent data are always consumed. Ring buffers are often used as fixed-sized queues in embedded systems, where static data storage methods are preferred. Of the pointers reaches the end of the buffer, it wraps around to the In particular the tail pointer advances when a newĭata is added and the head pointer advances when an old data is consumed. The data inside the ring buffer are delimited by two pointers that are adjusted when a new data is generated or an existing data is consumed. Ring buffers (also known as circular buffers) are fixed-size buffers that worksĪs if the memory were contiguous and circular. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |