Beginnings of graceful stop
[metaproxy-moved-to-github.git] / src / router_flexml.cpp
index dd08976..29e468b 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of Metaproxy.
-   Copyright (C) 2005-2011 Index Data
+   Copyright (C) 2005-2012 Index Data
 
 Metaproxy is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
@@ -503,6 +503,24 @@ void mp::RouterFleXML::start()
     }
 }
 
+void mp::RouterFleXML::stop()
+{
+    std::map<std::string,RouterFleXML::Route>::iterator route_it;
+
+    route_it = m_p->m_routes.begin();
+    while (route_it != m_p->m_routes.end())
+    {
+        RouterFleXML::Route route = route_it->second;
+
+        std::list<boost::shared_ptr<const mp::filter::Base> >::iterator it;
+
+        for (it = route.m_list.begin(); it != route.m_list.end(); it++)
+            (*it)->stop();
+        route_it++;
+    }
+}
+
+
 /*
  * Local variables:
  * c-basic-offset: 4