Debian Codegraph @

yo/concrete/fork2/ipipe/ipipe.h

raw
1 #ifndef INCLUDED_IPIPE_H_
2 #define INCLUDED_IPIPE_H_
3
4 #ifndef INCLUDED_PIPE_H_
5 #include "../pipe/pipe.h"
6 #endif
7
8 #ifndef INCLUDED_ISTREAM_
9 #include <istream>
10 #define INCLUDED_ISTREAM_
11 #endif
12
13 namespace FBB
14 {
15 class IPipe: virtual public Pipe
16 {
17 private:
18 IfdNstreambuf d_ibuf;
19 std::istream d_istr;
20
21 public:
22 IPipe(size_t size = 500)
23 :
24 Pipe(socket),
25 d_ibuf(d_fd[READ], size == 0 ? 1 : size),
26 d_istr(&d_ibuf)
27 {}
28 IPipe(int socket, size_t size)
29 :
30 Pipe(socket),
31 d_ibuf(d_fd[READ], size == 0 ? 1 : size),
32 d_istr(&d_ibuf)
33 {}
34
35 istream &istream()
36 {
37 return d_istr;
38 }
39 };
40 }
41
42 #endif