metaproxy  1.15.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

◆ RouterFleXML() [1/2]

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

◆ RouterFleXML() [2/2]

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

◆ ~RouterFleXML()

metaproxy_1::RouterFleXML::~RouterFleXML ( )

Definition at line 449 of file router_flexml.cpp.

450 {
451 }

Member Function Documentation

◆ createpos()

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

Definition at line 472 of file router_flexml.cpp.

References m_p.

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

◆ start()

void metaproxy_1::RouterFleXML::start ( )

Definition at line 501 of file router_flexml.cpp.

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

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

◆ stop()

void metaproxy_1::RouterFleXML::stop ( int  signo)

Definition at line 518 of file router_flexml.cpp.

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

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

Member Data Documentation

◆ m_p

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

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