qb  2.0.0.0
C++17 Actor Framework
qb Issue Watch Star Fork Follow @isndev
Loading...
Searching...
No Matches

Ring buffer implementation. More...

#include <algorithm>
#include <cstring>
#include <iostream>
#include <type_traits>
#include <vector>
Include dependency graph for ring_buffer.h:

Go to the source code of this file.

Classes

class  qb::detail::ring_buffer_iterator< T, N, C, Overwrite >
 Iterator for ring_buffer. More...
class  qb::ring_buffer< T, N, Overwrite >
 A fixed-size ring buffer (circular buffer) implementation. More...

Functions

template<typename T, size_t N, bool C, bool Overwrite>
bool qb::detail::operator== (ring_buffer_iterator< T, N, C, Overwrite > const &l, ring_buffer_iterator< T, N, C, Overwrite > const &r) noexcept
 Equality comparison operator for ring buffer iterators.
template<typename T, size_t N, bool C, bool Overwrite>
bool qb::detail::operator!= (ring_buffer_iterator< T, N, C, Overwrite > const &l, ring_buffer_iterator< T, N, C, Overwrite > const &r) noexcept
 Inequality comparison operator for ring buffer iterators.

Detailed Description

Ring buffer implementation.

This file provides a fixed-size circular buffer implementation that offers efficient FIFO operations. The ring buffer supports both fixed-size and dynamic-size configurations, and provides thread-safe operations.

Author
qb - C++ Actor Framework

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ operator==()

template<typename T, size_t N, bool C, bool Overwrite>
bool qb::detail::operator== ( ring_buffer_iterator< T, N, C, Overwrite > const & l,
ring_buffer_iterator< T, N, C, Overwrite > const & r )
noexcept

Equality comparison operator for ring buffer iterators.

Template Parameters
TElement type
NBuffer capacity
CWhether the iterators are const
OverwriteWhether the buffer overwrites old elements when full
Parameters
lLeft iterator
rRight iterator
Returns
Whether the iterators are equal (based on count)

◆ operator!=()

template<typename T, size_t N, bool C, bool Overwrite>
bool qb::detail::operator!= ( ring_buffer_iterator< T, N, C, Overwrite > const & l,
ring_buffer_iterator< T, N, C, Overwrite > const & r )
noexcept

Inequality comparison operator for ring buffer iterators.

Template Parameters
TElement type
NBuffer capacity
CWhether the iterators are const
OverwriteWhether the buffer overwrites old elements when full
Parameters
lLeft iterator
rRight iterator
Returns
Whether the iterators are not equal (based on count)