GPL v2.
[metaproxy-moved-to-github.git] / src / router.hpp
1 /* $Id: router.hpp,v 1.14 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 ROUTER_HPP
23 #define ROUTER_HPP
24
25 #include <boost/noncopyable.hpp>
26 #include <string>
27 #include <stdexcept>
28
29 namespace metaproxy_1 
30 {
31     namespace filter {
32         class Base;
33     }
34     class RoutePos;
35     
36     class RouterException : public std::runtime_error {
37     public:
38         RouterException(const std::string message)
39             : std::runtime_error("RouterException: " + message){};
40     };
41       
42     class Router : boost::noncopyable {
43     public:
44         Router(){};
45         virtual ~Router(){};
46
47         virtual RoutePos *createpos() const = 0;
48     };
49
50     class RoutePos : boost::noncopyable {
51     public:
52         virtual const filter::Base *move(const char *route) = 0;
53         virtual RoutePos *clone() = 0;
54         virtual ~RoutePos() {};
55     };
56 }
57 #endif
58 /*
59  * Local variables:
60  * c-basic-offset: 4
61  * indent-tabs-mode: nil
62  * c-file-style: "stroustrup"
63  * End:
64  * vim: shiftwidth=4 tabstop=8 expandtab
65  */