diff options
Diffstat (limited to 'src/util/PeakBuffer.hxx')
-rw-r--r-- | src/util/PeakBuffer.hxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/util/PeakBuffer.hxx b/src/util/PeakBuffer.hxx index a3f385e3e..66f4c1a9f 100644 --- a/src/util/PeakBuffer.hxx +++ b/src/util/PeakBuffer.hxx @@ -20,11 +20,14 @@ #ifndef MPD_PEAK_BUFFER_HXX #define MPD_PEAK_BUFFER_HXX +#include "WritableBuffer.hxx" #include "Compiler.h" #include <stddef.h> +#include <stdint.h> -struct fifo_buffer; +template<typename T> struct WritableBuffer; +template<typename T> class DynamicFifoBuffer; /** * A FIFO-like buffer that will allocate more memory on demand to @@ -34,7 +37,7 @@ struct fifo_buffer; class PeakBuffer { size_t normal_size, peak_size; - fifo_buffer *normal_buffer, *peak_buffer; + DynamicFifoBuffer<uint8_t> *normal_buffer, *peak_buffer; public: PeakBuffer(size_t _normal_size, size_t _peak_size) @@ -57,7 +60,9 @@ public: gcc_pure bool IsEmpty() const; - const void *Read(size_t *length_r) const; + gcc_pure + WritableBuffer<void> Read() const; + void Consume(size_t length); bool Append(const void *data, size_t length); |