aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/PeakBuffer.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-12-15 22:32:05 +0100
committerMax Kellermann <max@duempel.org>2013-12-15 23:07:08 +0100
commitecdebb315ffb99efcdaaf8d7f0a7d717e58d0161 (patch)
tree98ac166f61788b1d387cc50c85ce9584429ec6b0 /src/util/PeakBuffer.hxx
parent1f523be72decf652dfe64ac6885770d8e86de0c7 (diff)
downloadmpd-ecdebb315ffb99efcdaaf8d7f0a7d717e58d0161.tar.gz
mpd-ecdebb315ffb99efcdaaf8d7f0a7d717e58d0161.tar.xz
mpd-ecdebb315ffb99efcdaaf8d7f0a7d717e58d0161.zip
util/PeakBuffer: use DynamicFifoBuffer instead of struct fifo_buffer
Switch to the C++ version.
Diffstat (limited to '')
-rw-r--r--src/util/PeakBuffer.hxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/util/PeakBuffer.hxx b/src/util/PeakBuffer.hxx
index 0e58e80b8..66f4c1a9f 100644
--- a/src/util/PeakBuffer.hxx
+++ b/src/util/PeakBuffer.hxx
@@ -20,13 +20,14 @@
#ifndef MPD_PEAK_BUFFER_HXX
#define MPD_PEAK_BUFFER_HXX
-#include "ConstBuffer.hxx"
+#include "WritableBuffer.hxx"
#include "Compiler.h"
#include <stddef.h>
+#include <stdint.h>
-struct fifo_buffer;
-template<typename T> struct ConstBuffer;
+template<typename T> struct WritableBuffer;
+template<typename T> class DynamicFifoBuffer;
/**
* A FIFO-like buffer that will allocate more memory on demand to
@@ -36,7 +37,7 @@ template<typename T> struct ConstBuffer;
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)
@@ -60,7 +61,7 @@ public:
bool IsEmpty() const;
gcc_pure
- ConstBuffer<void> Read() const;
+ WritableBuffer<void> Read() const;
void Consume(size_t length);