GPL v2.
[metaproxy-moved-to-github.git] / src / filter_multi.hpp
1 /* $Id: filter_multi.hpp,v 1.8 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_MULTI_HPP
23 #define FILTER_MULTI_HPP
24
25 #include <stdexcept>
26 #include <list>
27 #include <map>
28 #include <boost/scoped_ptr.hpp>
29 #include <boost/shared_ptr.hpp>
30
31 #include "filter.hpp"
32
33 namespace metaproxy_1 {
34     namespace filter {
35         class Multi : public Base {
36             class Rep;
37             struct Frontend;
38             struct Map;
39             struct FrontendSet;
40             struct Backend;
41             struct BackendSet;
42             struct ScanTermInfo;
43             typedef std::list<ScanTermInfo> ScanTermInfoList;
44             typedef boost::shared_ptr<Backend> BackendPtr;
45             typedef boost::shared_ptr<Frontend> FrontendPtr;
46             typedef boost::shared_ptr<Package> PackagePtr;
47             typedef std::map<std::string,FrontendSet>::iterator Sets_it;
48         public:
49             ~Multi();
50             Multi();
51             void process(metaproxy_1::Package & package) const;
52             void configure(const xmlNode * ptr);
53             void add_map_host2hosts(std::string host,
54                                     std::list<std::string> hosts,
55                                     std::string route);
56         private:
57             boost::scoped_ptr<Rep> m_p;
58         };
59     }
60 }
61
62 extern "C" {
63     extern struct metaproxy_1_filter_struct metaproxy_1_filter_multi;
64 }
65
66 #endif
67 /*
68  * Local variables:
69  * c-basic-offset: 4
70  * indent-tabs-mode: nil
71  * c-file-style: "stroustrup"
72  * End:
73  * vim: shiftwidth=4 tabstop=8 expandtab
74  */