X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fio%2Fbase.h;h=df63b5b1ed3ed2d5cfbd4797bc319919fa110794;hp=774d03467b57f73b5af04217dcf8e3cae70046d1;hb=31e72f50fbb34d86877e5110401c49ce3fefd4bb;hpb=378ec811c8df431f5b4e7094eb1949476d3a79fe diff --git a/source/io/base.h b/source/io/base.h index 774d034..df63b5b 100644 --- a/source/io/base.h +++ b/source/io/base.h @@ -4,11 +4,12 @@ #include #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);