Remove dynamic exceptions
[anna.git] / include / anna / diameter / app / dcca / Message.hpp
index 2cdc0c1..4063ea9 100644 (file)
@@ -1,37 +1,9 @@
-// ANNA - Anna is Not 'N' Anymore
-//
-// (c) Copyright 2005-2014 Eduardo Ramos Testillano & Francisco Ruiz Rayo
-//
-// https://bitbucket.org/testillano/anna
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: eduardo.ramos.testillano@gmail.com
-//          cisco.tierra@gmail.com
+// ANNA - Anna is Not Nothingness Anymore                                                         //
+//                                                                                                //
+// (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
+//                                                                                                //
+// See project site at http://redmine.teslayout.com/projects/anna-suite                           //
+// See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
 
 
 #ifndef anna_diameter_app_dcca_Message_hpp
@@ -82,7 +54,7 @@ typedef struct {
   int MaximumBitrateForDownlink;
 
 
-  void reset() throw() {
+  void reset() {
     qosProfile = "";
     Release = TrafficClass = HandlingPriority = MaximumBitrateForUplink = MaximumBitrateForDownlink = 0;
   }
@@ -107,12 +79,12 @@ public:
      @param Subscription-Id-Type value to filter the search. END_USER_E164 by default.
      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
   */
-  const UTF8String * getSubscriptionIdData(int subscriptionIdType = helpers::dcca::AVPVALUES__Subscription_Id_Type::END_USER_E164, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
+  const UTF8String * getSubscriptionIdData(int subscriptionIdType = helpers::dcca::AVPVALUES__Subscription_Id_Type::END_USER_E164, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
     ASSERT_APP_GETAVP(
       const anna::diameter::codec::Avp * sid;
       int pos = 1;
 
-      while(sid = getAvp(helpers::dcca::AVPID__Subscription_Id, pos++))
+      while((sid = getAvp(helpers::dcca::AVPID__Subscription_Id, pos++)))
       if(subscriptionIdType == sid->getAvp(helpers::dcca::AVPID__Subscription_Id_Type)->getEnumerated()->getValue())
         return sid->getAvp(helpers::dcca::AVPID__Subscription_Id_Data)->getUTF8String();
         return NULL;
@@ -123,7 +95,7 @@ public:
      Avp Multiple-Services-Credit-Control pointer reference
      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
   */
-  const anna::diameter::codec::Avp * getMultipleServicesCreditControl(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
+  const anna::diameter::codec::Avp * getMultipleServicesCreditControl(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
     ASSERT_APP_GETAVP(return getAvp(helpers::dcca::AVPID__Multiple_Services_Credit_Control));
   }
 
@@ -131,7 +103,7 @@ public:
      Avp Service-Identifier data-part pointer reference
      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
   */
-  const Unsigned32 * getServiceIdentifier(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
+  const Unsigned32 * getServiceIdentifier(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
     ASSERT_APP_GETAVP(return getAvp(helpers::dcca::AVPID__Multiple_Services_Credit_Control)->getAvp(helpers::dcca::AVPID__Service_Identifier)->getUnsigned32());
   }
 
@@ -139,7 +111,7 @@ public:
      Avp Rating-Group data-part pointer reference
      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
   */
-  const Unsigned32 * getRatingGroup(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
+  const Unsigned32 * getRatingGroup(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
     ASSERT_APP_GETAVP(return getAvp(helpers::dcca::AVPID__Multiple_Services_Credit_Control)->getAvp(helpers::dcca::AVPID__Rating_Group)->getUnsigned32());
   }
 
@@ -147,7 +119,7 @@ public:
      Avp Tariff-Change-Usage data-part pointer reference
      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
   */
-  const Enumerated * getTariffChangeUsage(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
+  const Enumerated * getTariffChangeUsage(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
     ASSERT_APP_GETAVP(
       return   getAvp(helpers::dcca::AVPID__Multiple_Services_Credit_Control)->
                getAvp(helpers::dcca::AVPID__Used_Service_Unit)->
@@ -159,7 +131,7 @@ public:
      Avp Validity-Time data-part pointer reference
      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
   */
-  const Unsigned32 * getValidityTime(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
+  const Unsigned32 * getValidityTime(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
     ASSERT_APP_GETAVP(return getAvp(helpers::dcca::AVPID__Multiple_Services_Credit_Control)->getAvp(helpers::dcca::AVPID__Validity_Time)->getUnsigned32());
   }
 
@@ -167,7 +139,7 @@ public:
      Avp Requested-Service-Unit pointer reference
      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
   */
-  const anna::diameter::codec::Avp * getRequestedServiceUnit(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
+  const anna::diameter::codec::Avp * getRequestedServiceUnit(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
     ASSERT_APP_GETAVP(return getAvp(helpers::dcca::AVPID__Multiple_Services_Credit_Control)->getAvp(helpers::dcca::AVPID__Requested_Service_Unit));
   }
 
@@ -176,7 +148,7 @@ public:
      @param ocurrence Select the n-th USU within the MSCC. First by default.
      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
   */
-  const anna::diameter::codec::Avp * getUsedServiceUnit(int ocurrence = 1, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
+  const anna::diameter::codec::Avp * getUsedServiceUnit(int ocurrence = 1, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
     ASSERT_APP_GETAVP(
       return   getAvp(helpers::dcca::AVPID__Multiple_Services_Credit_Control)->
                getAvp(helpers::dcca::AVPID__Used_Service_Unit, ocurrence);
@@ -187,7 +159,7 @@ public:
      Avp CC_Request_Type data-part pointer reference
      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
   */
-  const Enumerated * getCCRequestType(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
+  const Enumerated * getCCRequestType(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
     ASSERT_APP_GETAVP(return getAvp(helpers::dcca::AVPID__CC_Request_Type)->getEnumerated());
   }
 
@@ -195,7 +167,7 @@ public:
      Avp CC_Request_Number data-part pointer reference
      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
   */
-  const Unsigned32 * getCCRequestNumber(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
+  const Unsigned32 * getCCRequestNumber(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
     ASSERT_APP_GETAVP(return getAvp(helpers::dcca::AVPID__CC_Request_Number)->getUnsigned32());
   }
 
@@ -203,7 +175,7 @@ public:
      Avp Multiple-Services-Indicator data-part pointer reference
      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
   */
-  const Enumerated * getMultipleServicesIndicator(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
+  const Enumerated * getMultipleServicesIndicator(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
     ASSERT_APP_GETAVP(return getAvp(helpers::dcca::AVPID__Multiple_Services_Indicator)->getEnumerated());
   }
 
@@ -211,7 +183,7 @@ public:
      Avp Service-Context-Id data-part pointer reference
      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
   */
-  const UTF8String * getServiceContextId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
+  const UTF8String * getServiceContextId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
     ASSERT_APP_GETAVP(return getAvp(helpers::dcca::AVPID__Service_Context_Id)->getUTF8String());
   }
 
@@ -219,7 +191,7 @@ public:
      Avp 3GPP-NSAPI data-part pointer reference
      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
   */
-  const UTF8String * get3GPPNSAPI(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
+  const UTF8String * get3GPPNSAPI(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
     ASSERT_APP_GETAVP(return getAvp(helpers::tgpp::AVPID__3GPP_NSAPI)->getUTF8String());
   }
 
@@ -227,7 +199,7 @@ public:
      Avp 3GPP-Selection-Mode data-part pointer reference
      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
   */
-  const UTF8String * get3GPPSelectionMode(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
+  const UTF8String * get3GPPSelectionMode(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
     ASSERT_APP_GETAVP(return getAvp(helpers::tgpp::AVPID__3GPP_Selection_Mode)->getUTF8String());
   }
 
@@ -235,7 +207,7 @@ public:
      Avp 3GPP-Session-Stop-Indicator data-part pointer reference
      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
   */
-  const OctetString * get3GPPSessionStopIndicator(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
+  const OctetString * get3GPPSessionStopIndicator(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
     ASSERT_APP_GETAVP(return getAvp(helpers::tgpp::AVPID__3GPP_Session_Stop_Indicator)->getOctetString());
   }
 
@@ -243,7 +215,7 @@ public:
      Avp User-Equipment-Info pointer reference
      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
   */
-  const anna::diameter::codec::Avp * getUserEquipmentInfo(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
+  const anna::diameter::codec::Avp * getUserEquipmentInfo(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
     ASSERT_APP_GETAVP(return getAvp(helpers::dcca::AVPID__User_Equipment_Info));
   }
 
@@ -253,12 +225,12 @@ public:
      @param User-Equipment-Info-Type value to filter the search. IMEISV by default.
      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
   */
-  const OctetString * getUserEquipmentInfoValue(int userEquipmentInfoType = helpers::dcca::AVPVALUES__User_Equipment_Info_Type::IMEISV, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) {
+  const OctetString * getUserEquipmentInfoValue(int userEquipmentInfoType = helpers::dcca::AVPVALUES__User_Equipment_Info_Type::IMEISV, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
     ASSERT_APP_GETAVP(
       const anna::diameter::codec::Avp * uei;
       int pos = 1;
 
-      while(uei = getAvp(helpers::dcca::AVPID__User_Equipment_Info, pos++))
+      while((uei = getAvp(helpers::dcca::AVPID__User_Equipment_Info, pos++)))
       if(userEquipmentInfoType == uei->getAvp(helpers::dcca::AVPID__User_Equipment_Info_Type)->getEnumerated()->getValue())
         return uei->getAvp(helpers::dcca::AVPID__User_Equipment_Info_Value)->getOctetString();
         return NULL;
@@ -268,7 +240,7 @@ public:
   // there has to be at least one out-of-line definition of a non-pure-virtual function (http://www.daniweb.com/software-development/cpp/threads/114299/undefined-reference-to-vtable-for-)
   // Lo que dice es que las virtuales no puras de una clase deben tener al menos una definicion en el .cc (lo contrario de in-line). Parece una limitaciĆ³n del compilador.
   // Podemos hacer una definicion por defecto (return NULL), o mejor, hacerla virtual pura (porque se necesitara por parte del decodificador de QoS):
-  virtual const UTF8String * get3GPPGPRSNegQoSProfile(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) = 0;
+  virtual const UTF8String * get3GPPGPRSNegQoSProfile(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) = 0;
 
 
   /**
@@ -276,7 +248,7 @@ public:
 
      @return 3GPP-GPRS-Neg-QoS-Profile decoded on struct
   */
-  const qosProfile_t & decode3GPPGPRSNegQoSProfile() throw(anna::RuntimeException);
+  const qosProfile_t & decode3GPPGPRSNegQoSProfile() noexcept(false);
 
 
 
@@ -295,8 +267,8 @@ public:
 //                  bool &hayUSUantes, bool &hayUSUdespues);
 //
 //
-//   bool getConsumedTime(int &beforeSwitch, int &afterSwitch, int &withoutSwitch) const throw();
-//   bool getConsumedVolume(int volumeType, int &upBeforeSwitch, int &upAfterSwitch, int &downBeforeSwitch, int &downAfterSwitch, int &upWithoutSwitch, int &downWithoutSwitch, bool &tariffChangeError) const throw();
+//   bool getConsumedTime(int &beforeSwitch, int &afterSwitch, int &withoutSwitch) const ;
+//   bool getConsumedVolume(int volumeType, int &upBeforeSwitch, int &upAfterSwitch, int &downBeforeSwitch, int &downAfterSwitch, int &upWithoutSwitch, int &downWithoutSwitch, bool &tariffChangeError) const ;
 //