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