- Complete this README.md by documenting how to build and run.
- Use any build tool (e.g. make).
- The code should compile cleanly, no errors/warnings.
- Static memory only, no malloc()/new.
- Open a pull request with your changes.
- Use C++
- Write a circular buffer class with the following features:
- Compile time fixed size
- Static memory allocation only
- Generic data type (e.g. uint8_t)
- Two put(data) overflow behaviors: overwrite and discard data.
- Write tests showing your circular buffer in action.
Circular buffer for different data types created as a templated class with fixed-size buffer. Two different behaviour added for circular buffer:
- Overwrite on full
- Discard data when full
To choose overwrite set bool overwrite = true, for discard data set bool overwrite = false
Buffer instanced compile-time for fixed static size. Size of the buffer resolved
in compile time trough int size argument of templated class
Dependencies: - Cmake - Ninja/make - gcc/g++ compiler
- Clone this repository
cd <dir> - Navigate to build directory
cd build - Execute
cmake .. -G Ninjaorcmake .. -G make - In build directory run
ninjaormake - Run example with
./circ-buff