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