changed call to RouterChain.append instead of RouterChain.rule
[metaproxy-moved-to-github.git] / src / router_chain.hpp
index a965dd0..294222e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: router_chain.hpp,v 1.1 2005-10-26 10:21:03 marc Exp $
+/* $Id: router_chain.hpp,v 1.2 2005-10-26 10:55:26 marc Exp $
    Copyright (c) 2005, Index Data.
 
 %LICENSE%
 
 
 namespace yp2 {
-    namespace filter {
-        class Base;
-    }
-    class Package;
+    //namespace filter {
+    //    class Base;
+    //}
+    //class Package;
     
     
     class RouterChain : public Router {
@@ -25,30 +25,10 @@ namespace yp2 {
         RouterChain(){};
         virtual ~RouterChain(){};
         virtual const filter::Base *move(const filter::Base *filter,
-                                   const Package *package) const {
-            std::list<const filter::Base *>::const_iterator it;
-            it = m_filter_list.begin();
-            if (filter)
-                {
-                    for (; it != m_filter_list.end(); it++)
-                        if (*it == filter)
-                            {
-                                it++;
-                                break;
-                            }
-                }
-            if (it == m_filter_list.end())
-                {
-                    //throw RouterException("no routing rules known");
-                    return 0;
-                }
-            return *it;
-        };
-        virtual void configure(){};
-        RouterChain & rule(const filter::Base &filter){
-            m_filter_list.push_back(&filter);
-            return *this;
-        }
+                                   const Package *package) const;
+
+        RouterChain & append(const filter::Base &filter);
+
     protected:
         std::list<const filter::Base *> m_filter_list;
     private: