20 #ifndef MPD_PEAK_BUFFER_HXX 21 #define MPD_PEAK_BUFFER_HXX 37 size_t normal_size, peak_size;
43 :normal_size(_normal_size), peak_size(_peak_size),
44 normal_buffer(nullptr), peak_buffer(nullptr) {}
47 :normal_size(other.normal_size), peak_size(other.peak_size),
48 normal_buffer(other.normal_buffer),
49 peak_buffer(other.peak_buffer) {
50 other.normal_buffer =
nullptr;
51 other.peak_buffer =
nullptr;
65 void Consume(
size_t length) noexcept;
67 bool Append(const
void *data,
size_t length);
gcc_pure WritableBuffer< void > Read() const noexcept
A FIFO-like buffer that will allocate more memory on demand to allow large peaks. ...
PeakBuffer & operator=(const PeakBuffer &)=delete
A reference to a memory area that is writable.
PeakBuffer(size_t _normal_size, size_t _peak_size)
void Consume(size_t length) noexcept
gcc_pure bool IsEmpty() const noexcept
bool Append(const void *data, size_t length)
A first-in-first-out buffer: you can append data at the end, and read data from the beginning...
PeakBuffer(PeakBuffer &&other)