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 anna_diameter_codec_tme_Engine_hpp
10 #define anna_diameter_codec_tme_Engine_hpp
16 #include <anna/core/util/Recycler.hpp>
18 #include <anna/diameter/codec/tme/Message.hpp>
19 #include <anna/diameter/codec/tme/Avp.hpp>
20 #include <anna/diameter/codec/EngineImpl.hpp>
23 using namespace anna::diameter::codec::tme;
26 //------------------------------------------------------------------------------
27 //---------------------------------------------------------------------- #define
28 //------------------------------------------------------------------------------
42 * Standard inheritance for engine component implementation, allocating basic Avp and Message classes.
44 class Engine : public EngineImpl {
48 static const char* getClassName() throw() { return "anna::diameter::codec::tme::Engine"; }
50 Engine() : EngineImpl(getClassName()) {;}
52 void releaseAvp(anna::diameter::codec::Avp* avp) throw() {
53 if(avp == NULL) return;
55 Avp* aux = static_cast <Avp*>(avp);
56 aux->clear(); // free internal data-part storage specially for grouped avps which will release its childrens
60 void releaseMessage(anna::diameter::codec::Message* message) throw() {
61 if(message == NULL) return;
63 Message* aux = static_cast <Message*>(message);
64 aux->clear(); // free internal data-part storage specially for childrens releasing
65 a_messages.release(aux);
70 anna::Recycler<Avp> a_avps;
71 anna::Recycler<Message> a_messages;
73 anna::diameter::codec::Avp* allocateAvp() throw() { return a_avps.create(); }
74 anna::diameter::codec::Message* allocateMessage() throw() { return a_messages.create(); }