aae892c121668e9af8049f0324b126cc46c66acd
[metaproxy-moved-to-github.git] / src / router.hpp
1 /* $Id: router.hpp,v 1.4 2005-10-26 10:21:03 marc Exp $
2    Copyright (c) 2005, Index Data.
3
4 %LICENSE%
5  */
6
7 #ifndef ROUTER_HPP
8 #define ROUTER_HPP
9
10 #include <stdexcept>
11 #include <list>
12
13 namespace yp2 {
14     namespace filter {
15         class Base;
16     }
17     class Package;
18     
19     class RouterException : public std::runtime_error {
20     public:
21         RouterException(const std::string message)
22             : std::runtime_error("RouterException: " + message){};
23     };
24   
25     
26     class Router {
27     public:
28         Router(){};
29         virtual ~Router(){};
30
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             return 0;
35         };
36
37         /// re-read configuration of routing tables
38         //virtual void configure(){};
39
40         /// add routing rule expressed as Filter to Router
41         //virtual Router & rule(const filter::Base &filter){
42         //    return *this;
43         //}
44     private:
45         /// disabled because class is singleton
46         Router(const Router &);
47
48         /// disabled because class is singleton
49         Router& operator=(const Router &);
50     };
51   
52  
53   
54 }
55
56 #endif
57 /*
58  * Local variables:
59  * c-basic-offset: 4
60  * indent-tabs-mode: nil
61  * c-file-style: "stroustrup"
62  * End:
63  * vim: shiftwidth=4 tabstop=8 expandtab
64  */