31836ae3b61dd31c5174421363780551e70c45ca
[metaproxy-moved-to-github.git] / src / router.hpp
1 /* $Id: router.hpp,v 1.7 2006-01-05 16:39:37 adam Exp $
2    Copyright (c) 2005, Index Data.
3
4 %LICENSE%
5  */
6
7 #ifndef ROUTER_HPP
8 #define ROUTER_HPP
9
10 #include <boost/noncopyable.hpp>
11 #include <string>
12 #include <stdexcept>
13
14 namespace yp2 
15 {
16     namespace filter {
17         class Base;
18     }
19     class Package;
20     
21     class RouterException : public std::runtime_error {
22     public:
23         RouterException(const std::string message)
24             : std::runtime_error("RouterException: " + message){};
25     };
26       
27     class Router : boost::noncopyable {
28     public:
29         Router(){};
30         virtual ~Router(){};
31
32         /// determines next Filter to use from current Filter and Package
33         virtual const filter::Base *move(const filter::Base *filter,
34                                          const Package *package) const = 0;
35     };
36 }
37 #endif
38 /*
39  * Local variables:
40  * c-basic-offset: 4
41  * indent-tabs-mode: nil
42  * c-file-style: "stroustrup"
43  * End:
44  * vim: shiftwidth=4 tabstop=8 expandtab
45  */