changed call to RouterChain.append instead of RouterChain.rule
[metaproxy-moved-to-github.git] / src / router_chain.cpp
1 /* $Id: router_chain.cpp,v 1.1 2005-10-26 10:55:26 marc Exp $
2    Copyright (c) 2005, Index Data.
3
4 %LICENSE%
5  */
6
7
8 #include "router_chain.hpp"
9
10
11 const yp2::filter::Base * yp2::RouterChain::move(const filter::Base *filter,                                   const Package *package) const {
12             std::list<const filter::Base *>::const_iterator it;
13             it = m_filter_list.begin();
14             if (filter)
15                 {
16                     for (; it != m_filter_list.end(); it++)
17                         if (*it == filter)
18                             {
19                                 it++;
20                                 break;
21                             }
22                 }
23             if (it == m_filter_list.end())
24                 {
25                     //throw RouterException("no routing rules known");
26                     return 0;
27                 }
28             return *it;
29         };
30
31         yp2::RouterChain & yp2::RouterChain::append(const filter::Base &filter){
32             m_filter_list.push_back(&filter);
33             return *this;
34         };
35
36
37
38
39 /*
40  * Local variables:
41  * c-basic-offset: 4
42  * indent-tabs-mode: nil
43  * c-file-style: "stroustrup"
44  * End:
45  * vim: shiftwidth=4 tabstop=8 expandtab
46  */