]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/buffered.cpp
Move non-oneliner functions out of RefPtr class declaration
[libs/core.git] / source / io / buffered.cpp
index 5dbd49463fc2666a39019036c4882231b73b653d..2836e4bbbaeb879de07be26bf5fba2ecea8fcad9 100644 (file)
@@ -1,6 +1,7 @@
 #include <cstring>
 #include <stdexcept>
 #include "buffered.h"
+#include "handle.h"
 
 using namespace std;
 
@@ -31,6 +32,16 @@ Buffered::~Buffered()
        delete[] buf;
 }
 
+void Buffered::set_block(bool)
+{
+       throw logic_error("Buffered::set_block");
+}
+
+void Buffered::set_inherit(bool)
+{
+       throw logic_error("Buffered::set_block");
+}
+
 void Buffered::flush()
 {
        if(cur_op==M_WRITE)
@@ -47,7 +58,7 @@ void Buffered::flush()
                }
        }
        else if(cur_op==M_READ)
-               begin=end = buf;
+               begin = end = buf;
 }
 
 unsigned Buffered::do_write(const char *data, unsigned size)
@@ -100,7 +111,7 @@ unsigned Buffered::do_read(char *data, unsigned size)
                // Give out whatever is in the buffer already
                memcpy(data, begin, end-begin);
                unsigned ret = end-begin;
-               begin=end = buf;
+               begin = end = buf;
 
                data += ret;
                size -= ret;
@@ -167,6 +178,11 @@ int Buffered::get()
        return static_cast<unsigned char>(c);
 }
 
+const Handle &Buffered::get_handle(Mode)
+{
+       throw logic_error("Buffered::get_handle");
+}
+
 void Buffered::set_op(Mode op)
 {
        if(op!=cur_op)
@@ -179,10 +195,5 @@ unsigned Buffered::get_current_size() const
        return end-begin;
 }
 
-Handle Buffered::get_event_handle()
-{
-       throw logic_error("Buffered doesn't support events");
-}
-
 } // namespace IO
 } // namespace Msp