30 #ifndef STATIC_FIFO_BUFFER_HPP
31 #define STATIC_FIFO_BUFFER_HPP
46 template<
class T,
size_t size>
70 std::move(data + head, data + tail, data);
85 return head == 0 && tail == size;
95 else if (tail == size)
98 return Range(data + tail, size - tail);
106 assert(tail <= size);
108 assert(tail + n <= size);
118 return Range(data + head, tail - head);
125 assert(tail <= size);
126 assert(head <= tail);
128 assert(head + n <= tail);
WritableBuffer< T > Range
void Append(size_type n)
Expands the tail of the buffer, after data has been written to the buffer returned by write()...
A first-in-first-out buffer: you can append data at the end, and read data from the beginning...
A reference to a memory area that is writable.
constexpr StaticFifoBuffer()
void Consume(size_type n)
Marks a chunk as consumed.
Range Read()
Return a buffer range which may be read.
Range Write()
Prepares writing.