Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

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
    if you run on an Nixos machine: nix develop -c $SHELL

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

  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 .. -G Ninja

    <your path>/circularbuffercc/build$ ninja

  3. Now execute the circularbufffer-gtest:

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

  4. You can also do

    <your path>/circularbuffercc/build$ ninja 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

Contributors 2

AltStyle によって変換されたページ (->オリジナル) /