Skip to content

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQueue (Static Queue)

A C++ static memory allocated Queue component to store any kind of data type elements without using any kind of dynamic memory allocation.

This function could be used to replace C++ STL queue component that uses dinamyc memory.

The implementation of this Queue component is based on the use of a circular buffer with two incremental indexes (head and tail) that returns to zero when overflows on the queue maximum size. Appending a new element increments the head index while removing an element increments the tail index. The number of elements that are currently stored in the queue is given by the difference between head and tail indexes. When the Queue is full, new elements will overwrite older elements.

Examples

To run the examples, go to examples/ directory and run the build.sh script. It will compile and generate an example_exe binary file that you can execute.

cd examples
chmod +x build.sh
./build.sh
./example_exe

About

A C++ static memory allocated Queue component to store any kind of data type elements without using dynamic memory allocation.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages