1 /* $Id: router_chain.cpp,v 1.6 2006-03-16 10:40:59 adam Exp $
2 Copyright (c) 2005-2006, Index Data.
7 #include "router_chain.hpp"
11 namespace mp = metaproxy_1;
17 class RouterChain::Rep {
18 friend class RouterChain;
19 friend class RouterChain::Pos;
20 std::list<const filter::Base *> m_filter_list;
22 class RouterChain::Pos : public RoutePos {
24 virtual const filter::Base *move(const char *route);
25 virtual RoutePos *clone();
27 std::list<const filter::Base *>::const_iterator it;
28 mp::RouterChain::Rep *m_p;
32 mp::RouterChain::RouterChain() : m_p(new mp::RouterChain::Rep)
36 mp::RouterChain::~RouterChain()
40 const mp::filter::Base *mp::RouterChain::Pos::move(const char *route)
42 if (it == m_p->m_filter_list.end())
44 const mp::filter::Base *f = *it;
49 mp::RoutePos *mp::RouterChain::createpos() const
51 mp::RouterChain::Pos *p = new mp::RouterChain::Pos;
52 p->it = m_p->m_filter_list.begin();
57 mp::RoutePos *mp::RouterChain::Pos::clone()
59 mp::RouterChain::Pos *p = new mp::RouterChain::Pos;
66 mp::RouterChain::Pos::~Pos()
70 mp::RouterChain & mp::RouterChain::append(const filter::Base &filter)
72 m_p->m_filter_list.push_back(&filter);
80 * indent-tabs-mode: nil
81 * c-file-style: "stroustrup"
83 * vim: shiftwidth=4 tabstop=8 expandtab