30 #ifndef DYNAMIC_FIFO_BUFFER_HXX 31 #define DYNAMIC_FIFO_BUFFER_HXX 70 T *new_data =
new T[new_capacity];
81 const size_type required_capacity = in_use + n;
85 }
while (new_capacity < required_capacity);
103 std::copy_n(p, n,
Write(n));
DynamicFifoBuffer(size_type _capacity)
void MoveBuffer(T *new_data, size_type new_capacity)
Range::pointer_type pointer_type
A reference to a memory area that is writable.
constexpr size_type GetCapacity() const
ForeignFifoBuffer< T >::Range Range
Range::const_pointer_type const_pointer_type
Range Write()
Prepares writing.
A first-in-first-out buffer: you can append data at the end, and read data from the beginning...
ForeignFifoBuffer< T >::const_pointer_type const_pointer_type
pointer_type Write(size_type n)
Write data to the buffer, growing it as needed.
constexpr size_type GetAvailable() const
ForeignFifoBuffer< T >::size_type size_type
ForeignFifoBuffer< T >::pointer_type pointer_type
A first-in-first-out buffer: you can append data at the end, and read data from the beginning...
void Grow(size_type new_capacity)
void WantWrite(size_type n)
void Append(const_pointer_type p, size_type n)
Append data to the buffer, growing it as needed.