Remove dynamic exceptions
[anna.git] / include / anna / diameter / helpers / tme / codectypes / ISDNAddress.hpp
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_helpers_tme_codectypes_ISDNAddress_hpp
10 #define anna_diameter_helpers_tme_codectypes_ISDNAddress_hpp
11
12
13 // Local
14 #include <anna/diameter/codec/basetypes/OctetString.hpp>
15
16
17 namespace anna {
18
19 namespace diameter {
20
21 namespace codec {
22 class Avp;
23 }
24
25 namespace helpers {
26
27 namespace tme {
28
29 namespace codectypes {
30
31 /**
32 * Diameter ISDNAddress container
33   Internal format is based in Called Party Number (Q763) but ignoring INN (is spare)
34 */
35 class ISDNAddress : public codec::basetypes::OctetString {
36
37   isup_number_t a_isupNumber;
38
39   // Only for derived diameter type:
40   void updateBasic() noexcept(false);
41
42 public:
43
44   // Class-specific ////////////////////////////////////////////////////////////////////////////////////
45   //
46   /**
47   * Gets the Q763 ISUP Number
48   *
49   * @return Q763 ISUP Number
50   */
51   const isup_number_t& getIsupNumber() const { return a_isupNumber; }
52
53   /**
54   * Sets the Q763 ISUP Number
55   *
56   * @param isupNumber Q763 ISUP Number
57   */
58   void setIsupNumber(const isup_number_t& isupNumber) { a_isupNumber = isupNumber; updateBasic(); }
59   //
60   //////////////////////////////////////////////////////////////////////////////////////////////////////
61
62   // gets
63
64   std::string getFormatName() const { return "ISDNAddress"; }
65
66
67   // helpers
68
69   std::string asString() noexcept(false) {
70     return a_isupNumber.asString(true /* called party number */);
71   }
72
73
74   // sets
75
76   void decode(const char* buffer, const int size) noexcept(false);
77
78
79   // exports /////////////////////////////
80   using AvpData::getSize;
81   using AvpData::code;
82   //using OctetString::asPrintableString;
83   using AvpData::asDataBlockString;
84   //using OctetString::asString;
85   using AvpData::asHexString;
86   //using OctetString::decode;
87   using AvpData::fromPrintableString;
88   using AvpData::fromHexString;
89
90 };
91
92 }
93 }
94 }
95 }
96 }
97
98 #endif
99