Calls to pipe(2) replaced with usage of Pipe class. Now passes
[metaproxy-moved-to-github.git] / src / pipe.hpp
1 /* $Id: pipe.hpp,v 1.2 2005-11-07 21:57:10 adam Exp $
2    Copyright (c) 2005, Index Data.
3
4 %LICENSE%
5  */
6
7 #ifndef YP2_PIPE_HPP
8 #define YP2_PIPE_HPP
9
10 #include <stdexcept>
11 #include <boost/scoped_ptr.hpp>
12
13 #include <yaz/yconfig.h>
14
15 namespace yp2 {
16     class Pipe {
17         class Error : public std::runtime_error {
18         public:
19             Error(const std::string msg) 
20                 : std::runtime_error("Pipe error: " + msg) {};
21         };
22         class Rep;
23     public:
24         Pipe(int port_to_use);
25         ~Pipe();
26         int &read_fd() const;
27         int &write_fd() const;
28     private:
29         boost::scoped_ptr<Rep> m_p;
30     };
31 }
32 #endif
33 /*
34  * Local variables:
35  * c-basic-offset: 4
36  * indent-tabs-mode: nil
37  * c-file-style: "stroustrup"
38  * End:
39  * vim: shiftwidth=4 tabstop=8 expandtab
40  */
41