]> git.tdb.fi Git - libs/core.git/blob - source/io/pipe.h
Minor change to EventReader to avoid an invalid handle error on windows
[libs/core.git] / source / io / pipe.h
1 #ifndef MSP_IO_PIPE_H_
2 #define MSP_IO_PIPE_H_
3
4 #include "eventobject.h"
5 #include "eventreader.h"
6 #include "handle.h"
7
8 namespace Msp {
9 namespace IO {
10
11 class Pipe: public EventObject
12 {
13 private:
14         Handle handle[2];
15         EventReader reader;
16
17 public:
18         Pipe();
19         ~Pipe();
20
21         void close();
22
23         void set_block(bool);
24
25 protected:
26         virtual unsigned do_write(const char *, unsigned);
27         virtual unsigned do_read(char *, unsigned);
28
29 public:
30         virtual const Handle &get_event_handle() { return reader.get_event(); }
31 };
32
33 } // namespace IO
34 } // namespace Msp
35
36 #endif