1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
10 #include <anna/diameter.comm/OriginHostManager.hpp>
11 #include <anna/diameter.comm/OriginHost.hpp>
12 #include <anna/core/tracing/Logger.hpp>
13 #include <anna/xml/Node.hpp>
16 using namespace anna::diameter::comm;
18 OriginHost *OriginHostManager::getOriginHost(const std::string &name) const throw() {
19 origin_hosts_it it = a_origin_hosts.find(name);
20 if (it != a_origin_hosts.end())
26 void OriginHostManager::registerOriginHost(const std::string &name, OriginHost* originHost) throw() {
27 if (!originHost) return; // nothing done
28 a_origin_hosts[name] = originHost;
31 anna::xml::Node* OriginHostManager::asXML(anna::xml::Node* parent) const
33 anna::xml::Node* result = parent->createChild("OriginHostManager");
34 origin_hosts_it it_min(a_origin_hosts.begin());
35 origin_hosts_it it_max(a_origin_hosts.end());
36 for (origin_hosts_it it = it_min; it != it_max; it++)
37 it->second->asXML(result);