forked from Ferdi265/cxx-ring-buffer
b20f76ae9bc6f63e5d8fc69531d0c981b09be0c8
cxx-ring-buffer
a small implementation of a C++ ring-buffer container wrapper and STL-style iterators.
Overview
This projects provides the following types:
- the template
basic_ring_buffer<ContainerType>
, defined in<ring-buffer.h>
augments an existing container to be used as a ring buffer - the alias template
ring_buffer<ValueType, Size>
, defined in<ring-buffer.h>
an alias forbasic_ring_buffer<std::array<ValueType, Size>>
- the template
ring_buffer_iterator<ContainerType>
, defined in<ring-buffer-iterator.h>
a random access iterator over abasic_ring_buffer
with the same container type - the template
ring_buffer_const_iterator<ContainerType>
, defined in<ring-buffer-iterator.h>
a random access iterator over abasic_ring_buffer
with the same container type, givingconst
access to the elements
This project can be configured via CMake options or preprocessor defines
CMake options
RING_BUFFER_DEFAULT_CXXFLAGS
(default OFF)
set the C++ compiler flags to-Wall -Wextra
, and try to detect the newest supported C++ standard.RING_BUFFER_BUILD_TESTS
(default OFF)
build the test programs from thetest/
subdirectoryRING_BUFFER_FEATURE_DETECT
(default ON)
try to detect the values for the following feature options automaticallyRING_BUFFER_NOEXCEPT
(default OFF)
enable use of thenoexcept(bool-expr)
conditional noexcept operator (needs C++11)RING_BUFFER_CONSTEXPR
(default OFF)
make all member functions ofbasic_ring_buffer
and its iteratorsconstexpr
(needs C++14)RING_BUFFER_CONSTEXPR_DESTRUCTORS
(default OFF)
make the destructors ofbasic_ring_buffer
and its iterators explicitlyconstexpr
(needs C++20)
The last 3 options set preprocessor defines with the same name when enabled.
Preprocessor defines
RING_BUFFER_NOEXCEPT
(default OFF)
enable use of thenoexcept(bool-expr)
conditional noexcept operator (needs C++11)RING_BUFFER_CONSTEXPR
(default OFF)
make all member functions ofbasic_ring_buffer
and its iteratorsconstexpr
(needs C++14)RING_BUFFER_CONSTEXPR_DESTRUCTORS
(default OFF)
make the destructors ofbasic_ring_buffer
and its iterators explicitlyconstexpr
(needs C++20)
Description
a small header-only implementation of a C++ ring-buffer container wrapper and STL-style iterators
Languages
C++
75.2%
CMake
22.8%
C
1.8%
QMake
0.2%