X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fpipe.h;h=71edf7eb3246f125ceb09ccd90495381807c8b85;hb=b97d4e9f86e90254ab9edef7ee62a910f6333c78;hp=e8e1f5358a344671100b9eddcc3bd5e95efe45b6;hpb=c0861d1f8e3869f058bc8b152cd35a08e5b03e73;p=libs%2Fcore.git diff --git a/source/pipe.h b/source/pipe.h index e8e1f53..71edf7e 100644 --- a/source/pipe.h +++ b/source/pipe.h @@ -1,9 +1,3 @@ -/* $Id$ - -This file is part of libmspio -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ #ifndef MSP_IO_PIPE_H_ #define MSP_IO_PIPE_H_ @@ -14,25 +8,31 @@ namespace IO { class Pipe: public Base { -public: - Pipe(); - void set_block(bool); - void close(); - Handle get_event_handle(); - ~Pipe(); private: Handle handle[2]; #ifdef WIN32 OVERLAPPED *overlapped; - Handle event; - unsigned buf_size; - char *buffer; - unsigned buf_avail; - char *buf_next; + Handle event; + unsigned buf_size; + char *buffer; + unsigned buf_avail; + char *buf_next; #endif - unsigned do_write(const char *, unsigned); - unsigned do_read(char *, unsigned); +public: + Pipe(); + ~Pipe(); + + void close(); + + void set_block(bool); + +protected: + virtual unsigned do_write(const char *, unsigned); + virtual unsigned do_read(char *, unsigned); + +public: + virtual Handle get_event_handle(); }; } // namespace IO