]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/base.h
Use the new Handle class to hide platform details from public headers
[libs/core.git] / source / io / base.h
index 774d03467b57f73b5af04217dcf8e3cae70046d1..df63b5b1ed3ed2d5cfbd4797bc319919fa110794 100644 (file)
@@ -4,11 +4,12 @@
 #include <sigc++/sigc++.h>
 #include "mode.h"
 #include "poll.h"
-#include "types.h"
 
 namespace Msp {
 namespace IO {
 
+struct Handle;
+
 /**
 Common interface for all I/O objects.
 
@@ -64,8 +65,8 @@ public:
        Mode get_mode() const { return mode; }
 
 protected:
-       virtual unsigned do_write(const char *, unsigned) =0;
-       virtual unsigned do_read(char *, unsigned) =0;
+       virtual unsigned do_write(const char *, unsigned) = 0;
+       virtual unsigned do_read(char *, unsigned) = 0;
 
 public:
        /** Writes data from a buffer.  Subject to blocking.  Returns the number of
@@ -106,7 +107,7 @@ public:
 
        /** Returns a handle for polling.  Should throw if the object does not have
        an event handle. */
-       virtual Handle get_event_handle() =0;
+       virtual const Handle &get_event_handle() = 0;
 
        /** Notifies the object of an event.  Used by EventDispatcher. */
        void event(PollEvent);