]> git.tdb.fi Git - libs/core.git/blob - source/pipe.h
Drop copyright and license notices from files
[libs/core.git] / source / pipe.h
1 #ifndef MSP_IO_PIPE_H_
2 #define MSP_IO_PIPE_H_
3
4 #include "base.h"
5
6 namespace Msp {
7 namespace IO {
8
9 class Pipe: public Base
10 {
11 public:
12         Pipe();
13         void set_block(bool);
14         void close();
15         Handle get_event_handle();
16         ~Pipe();
17 private:
18         Handle handle[2];
19 #ifdef WIN32
20         OVERLAPPED *overlapped;
21         Handle     event;
22         unsigned   buf_size;
23         char       *buffer;
24         unsigned   buf_avail;
25         char       *buf_next;
26 #endif
27
28 protected:
29         unsigned do_write(const char *, unsigned);
30         unsigned do_read(char *, unsigned);
31 };
32
33 } // namespace IO
34 } // namespace Msp
35
36 #endif