X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;ds=sidebyside;f=src%2Frouter.hpp;h=480fe1fbb253f0b3bddd662ad2c946304c3d9370;hb=ec5548301e2549fc0f8d2f962aade24cb6f90d1b;hp=aae892c121668e9af8049f0324b126cc46c66acd;hpb=d7b1186d1f020678b617e2368415485bffef93f9;p=metaproxy-moved-to-github.git diff --git a/src/router.hpp b/src/router.hpp index aae892c..480fe1f 100644 --- a/src/router.hpp +++ b/src/router.hpp @@ -1,4 +1,4 @@ -/* $Id: router.hpp,v 1.4 2005-10-26 10:21:03 marc Exp $ +/* $Id: router.hpp,v 1.8 2006-01-09 13:43:59 adam Exp $ Copyright (c) 2005, Index Data. %LICENSE% @@ -7,52 +7,54 @@ #ifndef ROUTER_HPP #define ROUTER_HPP +#include +#include #include -#include -namespace yp2 { +#define ROUTE_POS 1 + +namespace yp2 +{ namespace filter { class Base; } +#if ROUTE_POS + class RoutePos; +#else class Package; +#endif class RouterException : public std::runtime_error { public: RouterException(const std::string message) : std::runtime_error("RouterException: " + message){}; }; - - - class Router { + + class Router : boost::noncopyable { public: Router(){}; virtual ~Router(){}; +#if ROUTE_POS + virtual RoutePos *createpos() const = 0; +#else /// determines next Filter to use from current Filter and Package virtual const filter::Base *move(const filter::Base *filter, - const Package *package) const { - return 0; - }; - - /// re-read configuration of routing tables - //virtual void configure(){}; + const Package *package) const = 0; +#endif + }; - /// add routing rule expressed as Filter to Router - //virtual Router & rule(const filter::Base &filter){ - // return *this; - //} - private: - /// disabled because class is singleton - Router(const Router &); - /// disabled because class is singleton - Router& operator=(const Router &); +#if ROUTE_POS + class RoutePos { + public: + virtual const filter::Base *move() = 0; + virtual RoutePos *clone() = 0; + virtual ~RoutePos() {}; }; - - - -} +#endif +} #endif /* * Local variables: