]> git.tdb.fi Git - libs/core.git/blob - source/io/pipe.h
Separate event-related stuff from Base
[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 "handle.h"
6
7 namespace Msp {
8 namespace IO {
9
10 class Pipe: public EventObject
11 {
12 private:
13         struct Private;
14
15         Handle handle[2];
16         Private *priv;
17
18 public:
19         Pipe();
20         ~Pipe();
21
22         void close();
23
24         void set_block(bool);
25
26 protected:
27         virtual unsigned do_write(const char *, unsigned);
28         virtual unsigned do_read(char *, unsigned);
29
30 public:
31         virtual const Handle &get_event_handle();
32 };
33
34 } // namespace IO
35 } // namespace Msp
36
37 #endif