1 /* $Id: router_chain.cpp,v 1.5 2006-01-11 11:51:50 adam Exp $
2 Copyright (c) 2005, Index Data.
7 #include "router_chain.hpp"
15 class RouterChain::Rep {
16 friend class RouterChain;
17 friend class RouterChain::Pos;
18 std::list<const filter::Base *> m_filter_list;
20 class RouterChain::Pos : public RoutePos {
22 virtual const filter::Base *move(const char *route);
23 virtual RoutePos *clone();
25 std::list<const filter::Base *>::const_iterator it;
26 yp2::RouterChain::Rep *m_p;
30 yp2::RouterChain::RouterChain() : m_p(new yp2::RouterChain::Rep)
34 yp2::RouterChain::~RouterChain()
38 const yp2::filter::Base *yp2::RouterChain::Pos::move(const char *route)
40 if (it == m_p->m_filter_list.end())
42 const yp2::filter::Base *f = *it;
47 yp2::RoutePos *yp2::RouterChain::createpos() const
49 yp2::RouterChain::Pos *p = new yp2::RouterChain::Pos;
50 p->it = m_p->m_filter_list.begin();
55 yp2::RoutePos *yp2::RouterChain::Pos::clone()
57 yp2::RouterChain::Pos *p = new yp2::RouterChain::Pos;
64 yp2::RouterChain::Pos::~Pos()
68 yp2::RouterChain & yp2::RouterChain::append(const filter::Base &filter)
70 m_p->m_filter_list.push_back(&filter);
78 * indent-tabs-mode: nil
79 * c-file-style: "stroustrup"
81 * vim: shiftwidth=4 tabstop=8 expandtab