Skip to content

This repository contains a circular buffer or a ring buffer implementation in C++ code suitable for embedded systems.

Notifications You must be signed in to change notification settings

krkind/circularbuffercc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Circular Buffer

This repository contains a circular buffer or a ring buffer implementation in C++ code suitable for embedded systems. The impementation uses std::mutex type for making the class thread safe. The code follows the Google C++ Style Guide but with 2 exceptions. Uses 4 spaces instead of 2 and follows STL naming conventions.

Unittest

The added unittest uses the googletest framework and the CMake build system.

Follow the steps below for building the unittest

  1. Install the CMake, if you run on an Ubuntu machine:

    sudo apt install cmake

  2. Clone this repo and create a new folder called e.g. build inside the repo.

  3. Now you shall have the following directory structure:

  <your path>
       | circularbuffercc
           | build
  1. Change directory to the new directory build.

  2. Generate the makefiles and build the unit test:

    <your path>/circularbuffercc/build$ cmake ..

    <your path>/circularbuffercc/build$ make

  3. Now execute the circularbufffer-gtest:

    <your path>/circularbuffercc/build$ test/circularbuffer-gtest

  4. You can also do

    <your path>/circularbuffercc/build$ make test

About

This repository contains a circular buffer or a ring buffer implementation in C++ code suitable for embedded systems.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published