30 #ifndef CIRCULAR_BUFFER_HPP 31 #define CIRCULAR_BUFFER_HPP
size_type head
The next index to be read.
Range::pointer_type pointer_type
A reference to a memory area that is writable.
WritableBuffer< T > Range
constexpr bool IsFull() const
void Consume(size_type n)
Marks a chunk as consumed.
constexpr size_type GetSize() const
Returns the number of elements stored in this buffer.
constexpr size_type GetSpace() const
Returns the number of elements that can be added to this buffer.
Range Read()
Return a buffer range which may be read.
Range Write()
Prepares writing.
constexpr bool IsEmpty() const
void Append(size_type n)
Expands the tail of the buffer, after data has been written to the buffer returned by Write()...
constexpr size_type GetCapacity() const
size_type tail
The next index to be written to.
Range::size_type size_type
constexpr size_type Next(size_type i) const
constexpr CircularBuffer(pointer_type _data, size_type _capacity)