]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/pipe.h
Implement get_handle in File and Pipe
[libs/core.git] / source / io / pipe.h
index 4e4e42b031796f3588dea1a88a3f4c607f84928f..d1508b2097d743b244c03f89d4230cf59cad8608 100644 (file)
@@ -1,25 +1,24 @@
 #ifndef MSP_IO_PIPE_H_
 #define MSP_IO_PIPE_H_
 
-#include "base.h"
+#include "eventobject.h"
+#include "eventreader.h"
+#include "handle.h"
 
 namespace Msp {
 namespace IO {
 
-class Pipe: public Base
+class Pipe: public EventObject
 {
 private:
-       struct Private;
-
-       Handle handle[2];
-       Private *priv;
+       Handle read_handle;
+       Handle write_handle;
+       EventReader reader;
 
 public:
        Pipe();
        ~Pipe();
 
-       void close();
-
        void set_block(bool);
 
 protected:
@@ -27,7 +26,8 @@ protected:
        virtual unsigned do_read(char *, unsigned);
 
 public:
-       virtual Handle get_event_handle();
+       virtual const Handle &get_handle(Mode);
+       virtual const Handle &get_event_handle() { return reader.get_event(); }
 };
 
 } // namespace IO