]> git.tdb.fi Git - libs/core.git/blob - source/io/pipe.h
Merge branch 'fs-master'
[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 set_block(bool);
22
23 protected:
24         virtual unsigned do_write(const char *, unsigned);
25         virtual unsigned do_read(char *, unsigned);
26
27 public:
28         virtual const Handle &get_event_handle() { return reader.get_event(); }
29 };
30
31 } // namespace IO
32 } // namespace Msp
33
34 #endif