GPL v2.
[metaproxy-moved-to-github.git] / src / filter_virt_db.hpp
1 /* $Id: filter_virt_db.hpp,v 1.19 2007-05-09 21:23:09 adam Exp $
2    Copyright (c) 2005-2007, Index Data.
3
4 This file is part of Metaproxy.
5
6 Metaproxy is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
9 version.
10
11 Metaproxy is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with Metaproxy; see the file LICENSE.  If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19 02111-1307, USA.
20  */
21
22 #ifndef FILTER_VIRT_DB_HPP
23 #define FILTER_VIRT_DB_HPP
24
25 #include <stdexcept>
26 #include <list>
27 #include <boost/scoped_ptr.hpp>
28 #include <boost/shared_ptr.hpp>
29
30 #include "filter.hpp"
31
32 namespace metaproxy_1 {
33     namespace filter {
34         class VirtualDB : public Base {
35             class Rep;
36             struct Frontend;
37             struct Map;
38             struct Set;
39             struct Backend;
40             typedef boost::shared_ptr<Backend> BackendPtr;
41             typedef boost::shared_ptr<Frontend> FrontendPtr;
42         public:
43             ~VirtualDB();
44             VirtualDB();
45             void process(metaproxy_1::Package & package) const;
46             void configure(const xmlNode * ptr);
47             void add_map_db2targets(std::string db,
48                                     std::list<std::string> targets,
49                                     std::string route);
50             void add_map_db2target(std::string db,
51                                    std::string target,
52                                    std::string route);
53         private:
54             boost::scoped_ptr<Rep> m_p;
55         };
56     }
57 }
58
59 extern "C" {
60     extern struct metaproxy_1_filter_struct metaproxy_1_filter_virt_db;
61 }
62
63 #endif
64 /*
65  * Local variables:
66  * c-basic-offset: 4
67  * indent-tabs-mode: nil
68  * c-file-style: "stroustrup"
69  * End:
70  * vim: shiftwidth=4 tabstop=8 expandtab
71  */