14 class RouterException : public std::runtime_error {
16 RouterException(const std::string message)
17 : std::runtime_error("RouterException: " + message){};
26 /// determines next Filter to use from current Filter and Package
27 virtual const filter::Base *move(const filter::Base *filter,
28 const Package *package) const {
32 /// re-read configuration of routing tables
33 virtual void configure(){};
35 /// add routing rule expressed as Filter to Router
36 virtual Router & rule(const filter::Base &filter){
40 /// disabled because class is singleton
41 Router(const Router &);
43 /// disabled because class is singleton
44 Router& operator=(const Router &);
48 class RouterChain : public Router {
51 virtual ~RouterChain(){};
52 virtual const filter::Base *move(const filter::Base *filter,
53 const Package *package) const {
54 std::list<const filter::Base *>::const_iterator it;
55 it = m_filter_list.begin();
58 for (; it != m_filter_list.end(); it++)
65 if (it == m_filter_list.end())
67 //throw RouterException("no routing rules known");
72 virtual void configure(){};
73 RouterChain & rule(const filter::Base &filter){
74 m_filter_list.push_back(&filter);
78 std::list<const filter::Base *> m_filter_list;
80 /// disabled because class is singleton
81 RouterChain(const RouterChain &);
83 /// disabled because class is singleton
84 RouterChain& operator=(const RouterChain &);
95 * indent-tabs-mode: nil
97 * vim: shiftwidth=4 tabstop=8 expandtab