RouterFleXML now reads XML simple config and make proper runtime
[metaproxy-moved-to-github.git] / src / router_flexml.hpp
1 /* $Id: router_flexml.hpp,v 1.11 2006-01-09 13:43:59 adam Exp $
2    Copyright (c) 2005, Index Data.
3
4    %LICENSE%
5 */
6
7 #include "router.hpp"
8
9 #include "factory_filter.hpp"
10
11 #include <stdexcept>
12
13 #include <boost/scoped_ptr.hpp>
14
15 namespace yp2 
16 {
17     class RouterFleXML : public yp2::Router 
18     {
19         class Rep;
20         class Route;
21         class Pos;
22     public:
23         RouterFleXML(std::string xmlconf, yp2::FactoryFilter &factory);
24         RouterFleXML(xmlDocPtr doc, yp2::FactoryFilter &factory);
25         
26         ~RouterFleXML();
27
28 #if ROUTE_POS
29         virtual RoutePos *createpos() const;
30 #else
31         /// determines next Filter to use from current Filter and Package
32         virtual const filter::Base *move(const filter::Base *filter,
33                                          const Package *package) const;
34 #endif
35         class XMLError : public std::runtime_error {
36         public:
37             XMLError(const std::string msg) :
38                 std::runtime_error("XMLError : " + msg) {} ;
39         };
40     private:
41         boost::scoped_ptr<Rep> m_p;
42     };
43  
44 };
45
46
47 /*
48  * Local variables:
49  * c-basic-offset: 4
50  * indent-tabs-mode: nil
51  * c-file-style: "stroustrup"
52  * End:
53  * vim: shiftwidth=4 tabstop=8 expandtab
54  */