ANNA Suite  2020b
Multipurpose development suite for Telco applications
Engine.hpp
Go to the documentation of this file.
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 #ifndef anna_diameter_codec_Engine_hpp
10 #define anna_diameter_codec_Engine_hpp
11 
12 
13 // STL
14 #include <string>
15 
17 
21 
22 
23 using namespace anna::diameter::codec;
24 
25 
26 //------------------------------------------------------------------------------
27 //---------------------------------------------------------------------- #define
28 //------------------------------------------------------------------------------
29 
30 
31 namespace anna {
32 
33 namespace diameter {
34 
35 namespace codec {
36 
37 
38 
42 class Engine : public EngineImpl {
43 
44 public:
45 
50  Engine(const char *className, const stack::Dictionary * dictionary) : EngineImpl(className, dictionary) {;}
51 
52  void releaseAvp(Avp* avp) {
53  if(avp == NULL) return;
54 
55  //Avp* aux = static_cast <Avp*> (avp);
56 // avp/*aux*/->clear(); // free internal data-part storage specially for grouped avps which will release its childrens
57  a_avps.release(avp/*aux*/);
58  }
59 
60  void releaseMessage(Message* message) {
61  if(message == NULL) return;
62 
63  //Message* aux = static_cast <Message*> (message);
64 // message/*aux*/->clear(); // free internal data-part storage specially for childrens releasing
65  a_messages.release(message/*aux*/);
66  }
67 
68 protected:
69 
72 
75 
76  friend class Message;
77  friend class Avp;
78 };
79 
80 }
81 }
82 }
83 
84 #endif
85 
void releaseAvp(Avp *avp)
Definition: Engine.hpp:52
Definition: Engine.hpp:42
T * create() noexcept(false)
Definition: Recycler.hpp:88
Definition: Avp.hpp:125
anna::diameter::codec::Message * allocateMessage()
Definition: Engine.hpp:74
Definition: Message.hpp:74
anna::diameter::codec::Avp * allocateAvp()
Definition: Engine.hpp:73
void releaseMessage(Message *message)
Definition: Engine.hpp:60
Definition: Recycler.hpp:30
Definition: Dictionary.hpp:50
anna::Recycler< Message > a_messages
Definition: Engine.hpp:71
Definition: app.hpp:12
Definition: Message.hpp:35
Engine(const char *className, const stack::Dictionary *dictionary)
Definition: Engine.hpp:50
Definition: EngineImpl.hpp:134
anna::Recycler< Avp > a_avps
Definition: Engine.hpp:70