/// configuration during filter load
virtual void configure(const xmlNode * ptr, bool test_only);
+
+ virtual void start() const;
};
class FilterException : public std::runtime_error {
virtual ~Router(){};
virtual RoutePos *createpos() const = 0;
+ virtual void start() = 0;
};
class RoutePos : boost::noncopyable {
mp::xml::check_empty(ptr);
}
+void mp::filter::Base::start() const
+{
+
+}
+
+
/*
* Local variables:
* c-basic-offset: 4
private:
void init(Package &package, const Z_GDU *gdu,
FrontendPtr frontend);
+ void start();
boost::mutex m_mutex;
boost::condition m_cond_session_ready;
std::map<mp::Session, FrontendPtr> m_clients;
m_resultset_ttl = 30;
m_resultset_max = 10;
m_session_ttl = 90;
+}
+
+void yf::SessionShared::Rep::start()
+{
yf::SessionShared::Worker w(this);
m_thrds.add_thread(new boost::thread(w));
}
yf::SessionShared::~SessionShared() {
}
+void yf::SessionShared::start() const
+{
+ m_p->start();
+}
yf::SessionShared::Frontend::Frontend(Rep *rep) : m_is_virtual(false), m_p(rep)
{
SessionShared();
void process(metaproxy_1::Package & package) const;
void configure(const xmlNode * ptr, bool test_only);
+ void start() const;
private:
boost::scoped_ptr<Rep> m_p;
};
signal(SIGTERM, sig_term_handler);
#endif
+ routerp->start();
mp::Package pack;
pack.router(*routerp).move(); /* should never exit */
*/
#include "router_chain.hpp"
+#include <metaproxy/filter.hpp>
#include <list>
{
}
+void mp::RouterChain::start()
+{
+ std::list<const filter::Base *>::const_iterator it;
+
+ for (it = m_p->m_filter_list.begin(); it != m_p->m_filter_list.end(); it++)
+ (*it)->start();
+}
+
const mp::filter::Base *mp::RouterChain::Pos::move(const char *route)
{
if (it == m_p->m_filter_list.end())
virtual ~RouterChain();
virtual RoutePos *createpos() const;
RouterChain & append(const filter::Base &filter);
+ void start();
private:
boost::scoped_ptr<Rep> m_p;
/// disabled because class is singleton
}
+void mp::RouterFleXML::start()
+{
+ 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)->start();
+ route_it++;
+ }
+}
+
/*
* Local variables:
* c-basic-offset: 4
~RouterFleXML();
virtual RoutePos *createpos() const;
+ void start();
private:
boost::scoped_ptr<Rep> m_p;
};