]> git.tdb.fi Git - libs/core.git/blob - source/pipe.h
Convert C-style casts to C++-style
[libs/core.git] / source / pipe.h
1 /* $Id$
2
3 This file is part of libmspio
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7 #ifndef MSP_IO_PIPE_H_
8 #define MSP_IO_PIPE_H_
9
10 #include "base.h"
11
12 namespace Msp {
13 namespace IO {
14
15 class Pipe: public Base
16 {
17 public:
18         Pipe();
19         void set_block(bool);
20         void close();
21         Handle get_event_handle();
22         ~Pipe();
23 private:
24         Handle handle[2];
25 #ifdef WIN32
26         OVERLAPPED *overlapped;
27         Handle     event;
28         unsigned   buf_size;
29         char       *buffer;
30         unsigned   buf_avail;
31         char       *buf_next;
32 #endif
33
34 protected:
35         unsigned do_write(const char *, unsigned);
36         unsigned do_read(char *, unsigned);
37 };
38
39 } // namespace IO
40 } // namespace Msp
41
42 #endif