X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fio%2Fpipe.h;h=50da5e53e1d6b49a9c1d599a319ae6fb5502c83f;hp=71edf7eb3246f125ceb09ccd90495381807c8b85;hb=7b81490ae4ed6c7c8566f889d146677827f5d4a5;hpb=c7afef88380ebebc8c2b04e48664d73281ec8848 diff --git a/source/io/pipe.h b/source/io/pipe.h index 71edf7e..50da5e5 100644 --- a/source/io/pipe.h +++ b/source/io/pipe.h @@ -1,30 +1,27 @@ #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: - Handle handle[2]; -#ifdef WIN32 - OVERLAPPED *overlapped; - Handle event; - unsigned buf_size; - char *buffer; - unsigned buf_avail; - char *buf_next; -#endif + Handle read_handle; + Handle write_handle; + EventReader reader; public: Pipe(); +private: + void platform_init(); +public: ~Pipe(); - void close(); - void set_block(bool); protected: @@ -32,7 +29,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