68add2b110797f9d3e2ee57e5da5943c77dae76b
[anna.git] / source / diameter / codec / EngineManager.cpp
1 // ANNA - Anna is Not Nothingness Anymore                                                         //
2 //                                                                                                //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
4 //                                                                                                //
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 //
7
8
9 // Project
10 #include <anna/diameter/codec/EngineManager.hpp>
11 #include <anna/diameter/stack/Engine.hpp>
12 #include <anna/diameter/stack/Dictionary.hpp>
13 #include <anna/core/tracing/Logger.hpp>
14
15 using namespace anna::diameter::codec;
16
17 Engine *EngineManager::getCodecEngine(const ApplicationId &appid) const throw() {
18   appid_codec_engines_it it = a_appid_codec_engines.find(appid);
19   if (it != a_appid_codec_engines.end())
20     return it->second;
21
22   return NULL;
23 }
24
25 void EngineManager::registerCodecEngine(const ApplicationId &appid, Engine* engine) throw() {
26   if (!engine) return; // nothing done
27   a_appid_codec_engines[appid] = engine;
28 }