Introduction
Circular Buffer is a C/C++ library that implements a circular buffer interface for generic types. Some of its features are described below:
Generic types such as uint8_t, uint16_t or uint32_t all supported with the same interface.
Support for custom read and write functions or use of the built-in read and write operations.
Lock-free single producer and single consumer scenarios on platforms that support stdatomic.
Other scenarios and platforms can be handled by implementing custom locking mechanism via events.
All functionality is accessible through a single include file
cb/cb.h
.Fully tested, see Test Results HTML Report.
Around 100% code coverage, see Code Coverage HTML report.
MISRA:C 2012 compliance, detailed below.
MIT license.
The source code for Circular Buffer is hosted at Github and related Docker images for development containers are located at DockerHub.
Note
This is the documentation for Circular Buffer, version 1.0.0, refer to Version for more details regarding the release.
MISRA C:2012 Compliance
The CppCheck tool along with it’s MISRA addon is used to check for compliance. This tool is run, along with others, on workflows in Github Actions as part of pull requests and prior to release.
For details about suppressions and deviations, look in the global suppressions.xml file or for inline suppressions
in the source code on top of the cppcheck-suppress misra
inline supression identifier.
License
Copyright 2023 - Diego Martínez García <dmg0345@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.