input/async: use class DeferredCall

This commit is contained in:
Max Kellermann
2016-06-17 18:30:45 +02:00
parent 829616534e
commit 5d11759f7d
2 changed files with 29 additions and 15 deletions

View File

@@ -21,7 +21,7 @@
#define MPD_ASYNC_INPUT_STREAM_HXX
#include "InputStream.hxx"
#include "event/DeferredMonitor.hxx"
#include "event/DeferredCall.hxx"
#include "util/HugeAllocator.hxx"
#include "util/CircularBuffer.hxx"
#include "util/Error.hxx"
@@ -32,11 +32,14 @@
* buffer, and that buffer is then consumed by another thread using
* the regular #InputStream API.
*/
class AsyncInputStream : public InputStream, private DeferredMonitor {
class AsyncInputStream : public InputStream {
enum class SeekState : uint8_t {
NONE, SCHEDULED, PENDING
};
DeferredCall deferred_resume;
DeferredCall deferred_seek;
HugeAllocation allocation;
CircularBuffer<uint8_t> buffer;
@@ -162,8 +165,9 @@ protected:
private:
void Resume();
/* virtual methods from DeferredMonitor */
void RunDeferred() final;
/* for DeferredCall */
void DeferredResume();
void DeferredSeek();
};
#endif