ANNA Suite  2020b
Multipurpose development suite for Telco applications
Avp.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_tme_Avp_hpp
10 #define anna_diameter_codec_tme_Avp_hpp
11 
12 // Local
15 
16 //------------------------------------------------------------------------------
17 //---------------------------------------------------------------------- #define
18 //------------------------------------------------------------------------------
19 
20 namespace anna {
21 namespace xml {
22 class Attribute;
23 }
24 }
25 
26 
27 
28 namespace anna {
29 
30 namespace diameter {
31 
32 namespace helpers {
33 namespace tme {
34 namespace codectypes {
35 class Unsigned16;
36 class ISDNNumber;
37 class ISDNAddress;
38 }
39 }
40 }
41 
42 namespace codec {
43 
44 class Engine;
45 
46 namespace tme {
47 
48 class Avp;
49 class Message;
50 //class Engine;
51 
52 
53 using namespace helpers::tme::codectypes;
54 
60 
61  // Data containers
62  ISDNNumber *a_ISDNNumber;
63  ISDNAddress *a_ISDNAddress;
64  Unsigned16 *a_Unsigned16;
65 
66  virtual void initializeByFormat() ;
67  virtual U24 getLengthByFormat(const anna::diameter::stack::Format *stackFormat) const ;
68  virtual std::string getXMLdataByFormat(bool & isHex, const anna::diameter::stack::Format *stackFormat) const ;
69  virtual void fromXMLByFormat(const anna::xml::Attribute* data, const anna::xml::Attribute* hexData, const anna::diameter::stack::Format *stackFormat) noexcept(false);
70  virtual void codeByFormat(char* dataPart, const anna::diameter::stack::Format *stackFormat) const noexcept(false);
71  virtual void decodeDataPartByFormat(const char * buffer, int size, const anna::diameter::stack::Format *stackFormat) noexcept(false);
72  virtual void allocationByFormat(const anna::diameter::stack::Format *stackFormat) ;
73  virtual void clearByFormat() ;
74 
75 //protected:
76 
77 // /** Codec Engine getter: avoids have to create base engine when using its child */
78 // virtual anna::diameter::codec::Engine * getEngine() const noexcept(false);
79 
80 
81 public:
82 
87  Avp(Engine *engine = NULL) : anna::diameter::codec::Avp(engine) {;}
88 
94  Avp(AvpId id, Engine *engine = NULL) : anna::diameter::codec::Avp(id, engine) {;}
95 
96 
100  ~Avp();
101 
102 
104  ISDNNumber * getISDNNumber() noexcept(false) { assertFormat("ISDNNumber"); return a_ISDNNumber; }
106  ISDNAddress * getISDNAddress() noexcept(false) { assertFormat("ISDNAddress"); return a_ISDNAddress; }
108  Unsigned16 * getUnsigned16() noexcept(false) { assertFormat("Unsigned16"); return a_Unsigned16; }
109 
110 
112  const ISDNNumber * getISDNNumber() const noexcept(false) { assertFormat("ISDNNumber"); return a_ISDNNumber; }
114  const ISDNAddress * getISDNAddress() const noexcept(false) { assertFormat("ISDNAddress"); return a_ISDNAddress; }
116  const Unsigned16 * getUnsigned16() const noexcept(false) { assertFormat("Unsigned16"); return a_Unsigned16; }
117 
118 
119 
120 
121  friend class Message;
123 };
124 
125 }
126 }
127 }
128 }
129 
130 
131 #endif
ISDNNumber * getISDNNumber() noexcept(false)
Definition: Avp.hpp:104
Definition: Engine.hpp:42
const ISDNNumber * getISDNNumber() const noexcept(false)
Definition: Avp.hpp:112
std::pair< S32, S32 > AvpId
Definition: defines.hpp:31
Definition: Avp.hpp:125
Definition: Attribute.hpp:35
U32 U24
Definition: defines.hpp:96
Definition: Avp.hpp:59
Avp(AvpId id, Engine *engine=NULL)
Definition: Avp.hpp:94
const Unsigned16 * getUnsigned16() const noexcept(false)
Definition: Avp.hpp:116
const ISDNAddress * getISDNAddress() const noexcept(false)
Definition: Avp.hpp:114
ISDNAddress * getISDNAddress() noexcept(false)
Definition: Avp.hpp:106
Unsigned16 * getUnsigned16() noexcept(false)
Definition: Avp.hpp:108
Definition: app.hpp:12
Definition: Message.hpp:38
Definition: Format.hpp:45
Avp(Engine *engine=NULL)
Definition: Avp.hpp:87