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/codec/EngineManager.hpp>
11 #include <anna/diameter/codec/Engine.hpp>
12 #include <anna/diameter/stack/Engine.hpp>
13 #include <anna/diameter/stack/Dictionary.hpp>
14 #include <anna/core/tracing/Logger.hpp>
15 #include <anna/xml/Node.hpp>
18 using namespace anna::diameter::codec;
20 Engine *EngineManager::getCodecEngine(const ApplicationId &appid) const throw() {
21 appid_codec_engines_it it = a_appid_codec_engines.find(appid);
22 if (it != a_appid_codec_engines.end())
28 void EngineManager::registerCodecEngine(const ApplicationId &appid, Engine* engine) throw() {
29 if (!engine) return; // nothing done
30 a_appid_codec_engines[appid] = engine;
33 anna::xml::Node* EngineManager::asXML(anna::xml::Node* parent) const
35 anna::xml::Node* result = parent->createChild("EngineManager");
36 appid_codec_engines_it it_min(a_appid_codec_engines.begin());
37 appid_codec_engines_it it_max(a_appid_codec_engines.end());
38 for (appid_codec_engines_it it = it_min; it != it_max; it++)
39 it->second->asXML(result);