aboutsummaryrefslogtreecommitdiffstats
path: root/src/input/ThreadInputStream.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-05-11 17:14:49 +0200
committerMax Kellermann <max@duempel.org>2014-05-11 17:14:49 +0200
commitd4b625b48e6bbac61b4128aeeaf44911b2e3e03b (patch)
tree67389c99a559c1b65bf6465c2361a4e3c01d4287 /src/input/ThreadInputStream.cxx
parent82337dec44347017ca04fe975e85e6d9e4edb635 (diff)
downloadmpd-d4b625b48e6bbac61b4128aeeaf44911b2e3e03b.tar.gz
mpd-d4b625b48e6bbac61b4128aeeaf44911b2e3e03b.tar.xz
mpd-d4b625b48e6bbac61b4128aeeaf44911b2e3e03b.zip
InputStream: make various methods abstract
Replace InputPlugin attributes.
Diffstat (limited to '')
-rw-r--r--src/input/ThreadInputStream.cxx41
1 files changed, 6 insertions, 35 deletions
diff --git a/src/input/ThreadInputStream.cxx b/src/input/ThreadInputStream.cxx
index 408b757f9..efbb8c9f9 100644
--- a/src/input/ThreadInputStream.cxx
+++ b/src/input/ThreadInputStream.cxx
@@ -116,8 +116,8 @@ ThreadInputStream::ThreadFunc(void *ctx)
tis.ThreadFunc();
}
-inline bool
-ThreadInputStream::Check2(Error &error)
+bool
+ThreadInputStream::Check(Error &error)
{
if (postponed_error.IsDefined()) {
error = std::move(postponed_error);
@@ -128,27 +128,13 @@ ThreadInputStream::Check2(Error &error)
}
bool
-ThreadInputStream::Check(InputStream *is, Error &error)
-{
- ThreadInputStream &tis = *(ThreadInputStream *)is;
- return tis.Check2(error);
-}
-
-inline bool
-ThreadInputStream::Available2()
+ThreadInputStream::IsAvailable()
{
return !buffer->IsEmpty() || eof || postponed_error.IsDefined();
}
-bool
-ThreadInputStream::Available(InputStream *is)
-{
- ThreadInputStream &tis = *(ThreadInputStream *)is;
- return tis.Available2();
-}
-
inline size_t
-ThreadInputStream::Read2(void *ptr, size_t read_size, Error &error)
+ThreadInputStream::Read(void *ptr, size_t read_size, Error &error)
{
while (true) {
if (postponed_error.IsDefined()) {
@@ -173,23 +159,8 @@ ThreadInputStream::Read2(void *ptr, size_t read_size, Error &error)
}
}
-size_t
-ThreadInputStream::Read(InputStream *is, void *ptr, size_t size,
- Error &error)
-{
- ThreadInputStream &tis = *(ThreadInputStream *)is;
- return tis.Read2(ptr, size, error);
-}
-
-inline bool
-ThreadInputStream::IsEOF2()
-{
- return eof;
-}
-
bool
-ThreadInputStream::IsEOF(InputStream *is)
+ThreadInputStream::IsEOF()
{
- ThreadInputStream &tis = *(ThreadInputStream *)is;
- return tis.IsEOF2();
+ return eof;
}