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 //
9 #ifndef example_diameter_launcher_MyDiameterEngine_hpp
10 #define example_diameter_launcher_MyDiameterEngine_hpp
13 #include <anna/diameter.comm/Engine.hpp>
16 #include <MyDiameterEntity.hpp>
17 #include <MyLocalServer.hpp>
31 class MyDiameterEngine : public anna::diameter::comm::Engine {
34 MyDiameterEngine(const char *className, const anna::diameter::stack::Dictionary *baseProtocolDictionary) : Engine(className, baseProtocolDictionary) {;}
36 // Default implementation is enough
37 // void readDPA(anna::DataBlock &dpa, const anna::DataBlock & dpr) throw() {;} // DPA is not replied
38 // void readDWA(anna::DataBlock &dwa, const anna::DataBlock & dwr) throw() {;} // DWA is not replied
41 anna::Recycler<MyDiameterEntity> a_entitiesRecycler;
43 anna::diameter::comm::Entity* allocateEntity() throw() { return a_entitiesRecycler.create(); }
45 void releaseEntity(anna::diameter::comm::Entity* entity) throw() {
46 MyDiameterEntity* aux = static_cast <MyDiameterEntity*>(entity);
47 a_entitiesRecycler.release(aux);
50 anna::Recycler<MyLocalServer> a_localServersRecycler;
52 anna::diameter::comm::LocalServer* allocateLocalServer() throw() { return a_localServersRecycler.create(); }
54 void releaseLocalServer(anna::diameter::comm::LocalServer* localServer) throw() {
55 MyLocalServer* aux = static_cast <MyLocalServer*>(localServer);
56 a_localServersRecycler.release(aux);