metaproxy  1.13.0
Classes | Public Member Functions | Private Attributes | List of all members
metaproxy_1::RouterFleXML Class Reference

#include <router_flexml.hpp>

Inheritance diagram for metaproxy_1::RouterFleXML:
Inheritance graph
Collaboration diagram for metaproxy_1::RouterFleXML:
Collaboration graph

Classes

class  Pos
 
class  Rep
 
class  Route
 

Public Member Functions

 RouterFleXML (std::string xmlconf, metaproxy_1::FactoryFilter &factory, bool test_only)
 
 RouterFleXML (xmlDocPtr doc, metaproxy_1::FactoryFilter &factory, bool test_only, const char *file_include_path)
 
 ~RouterFleXML ()
 
virtual RoutePos * createpos () const
 
void start ()
 
void stop (int signo)
 

Private Attributes

boost::scoped_ptr< Repm_p
 

Detailed Description

Definition at line 32 of file router_flexml.hpp.

Constructor & Destructor Documentation

metaproxy_1::RouterFleXML::RouterFleXML ( std::string  xmlconf,
metaproxy_1::FactoryFilter factory,
bool  test_only 
)

Definition at line 434 of file router_flexml.cpp.

References m_p.

436  : m_p(new Rep)
437 {
438  xmlDocPtr doc = xmlParseMemory(xmlconf.c_str(),
439  xmlconf.size());
440  if (!doc)
441  throw mp::XMLError("xmlParseMemory failed");
442  else
443  {
444  m_p->base(doc, factory, test_only, 0);
445  xmlFreeDoc(doc);
446  }
447 }
boost::scoped_ptr< Rep > m_p
metaproxy_1::RouterFleXML::RouterFleXML ( xmlDocPtr  doc,
metaproxy_1::FactoryFilter factory,
bool  test_only,
const char *  file_include_path 
)

Definition at line 427 of file router_flexml.cpp.

References m_p.

429  : m_p(new Rep)
430 {
431  m_p->base(doc, factory, test_only, file_include_path);
432 }
boost::scoped_ptr< Rep > m_p
metaproxy_1::RouterFleXML::~RouterFleXML ( )

Definition at line 449 of file router_flexml.cpp.

450 {
451 }

Member Function Documentation

mp::RoutePos * metaproxy_1::RouterFleXML::createpos ( ) const
virtual

Definition at line 473 of file router_flexml.cpp.

References m_p.

474 {
475  mp::RouterFleXML::Pos *p = new mp::RouterFleXML::Pos;
476 
477  p->m_route_it = m_p->m_routes.find(m_p->m_start_route);
478  if (p->m_route_it == m_p->m_routes.end())
479  {
480  delete p;
481  return 0;
482  }
483  p->m_filter_it = p->m_route_it->second.m_list.begin();
484  p->m_p = m_p.get();
485  return p;
486 }
boost::scoped_ptr< Rep > m_p
void metaproxy_1::RouterFleXML::start ( )

Definition at line 502 of file router_flexml.cpp.

References metaproxy_1::RouterFleXML::Route::m_list, and m_p.

503 {
504  std::map<std::string,RouterFleXML::Route>::iterator route_it;
505 
506  route_it = m_p->m_routes.begin();
507  while (route_it != m_p->m_routes.end())
508  {
509  RouterFleXML::Route route = route_it->second;
510 
511  std::list<boost::shared_ptr<const mp::filter::Base> >::iterator it;
512 
513  for (it = route.m_list.begin(); it != route.m_list.end(); it++)
514  (*it)->start();
515  route_it++;
516  }
517 }
boost::scoped_ptr< Rep > m_p
void metaproxy_1::RouterFleXML::stop ( int  signo)

Definition at line 519 of file router_flexml.cpp.

References metaproxy_1::RouterFleXML::Route::m_list, and m_p.

520 {
521  std::map<std::string,RouterFleXML::Route>::iterator route_it;
522 
523  route_it = m_p->m_routes.begin();
524  while (route_it != m_p->m_routes.end())
525  {
526  RouterFleXML::Route route = route_it->second;
527 
528  std::list<boost::shared_ptr<const mp::filter::Base> >::iterator it;
529 
530  for (it = route.m_list.begin(); it != route.m_list.end(); it++)
531  (*it)->stop(signo);
532  route_it++;
533  }
534 }
boost::scoped_ptr< Rep > m_p

Member Data Documentation

boost::scoped_ptr<Rep> metaproxy_1::RouterFleXML::m_p
private

The documentation for this class was generated from the following files: