Remove dynamic exceptions
[anna.git] / include / anna / diameter / stack / Format.hpp
index 08ff900..ebbd5e5 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_stack_Format_hpp
@@ -75,7 +47,7 @@ class Format {
   std::string a_name;
   std::string a_parentName;
 
-  void _initialize(const Dictionary *d) throw() {
+  void _initialize(const Dictionary *d) {
     a_dictionary = d;
     a_name = "";
     a_parentName = "";
@@ -94,14 +66,14 @@ public:
   *
   * @return Format type name
   */
-  const std::string & getName(void) const throw() { return a_name; }
+  const std::string & getName(void) const { return a_name; }
 
   /**
   * Gets the format parent type name
   *
   * @return Format parent type name, empty string for diameter basic format types (and reserved like 'Any, Unknown')
   */
-  const std::string & getParentName(void) const throw() { return a_parentName; }
+  const std::string & getParentName(void) const { return a_parentName; }
 
   // helpers
 
@@ -110,14 +82,14 @@ public:
   *
   * @return Diameter parent type reference, NULL for diameter basic format types (and reserved like 'Any, Unknown')
   */
-  const Format * getParent(void) const throw();
+  const Format * getParent(void) const ;
 
   /**
   * The diameter format is a derived type
   *
   * @return The format is derived
   */
-  bool isDerived(void) const throw() { return (a_parentName != ""); }
+  bool isDerived(void) const { return (a_parentName != ""); }
 
   /**
   * The diameter format is a basic type:
@@ -125,14 +97,14 @@ public:
   *
   * @return The format is basic
   */
-  bool isBasic(void) const throw() { return (!isDerived() && !isReserved()); }
+  bool isBasic(void) const { return (!isDerived() && !isReserved()); }
 
   /**
   * Gets the diameter basic format type from which a derived type inherit, or basic type itself for non-derived
   *
   * @return Diameter basic format type
   */
-  codec::Format::_v getBasicType(void) const throw(anna::RuntimeException);
+  codec::Format::_v getBasicType(void) const noexcept(false);
 
   /**
   * The diameter format belongs to RFC3588 diameter format family:
@@ -140,75 +112,75 @@ public:
   *
   * @return The format belongs to RFC3588
   */
-  bool isRFC3588(void) const throw() { return (codec::Format::isRFC3588(a_name)); }
+  bool isRFC3588(void) const { return (codec::Format::isRFC3588(a_name)); }
 
   // Reserved
   /** @return The format is 'Any' (generic AVP) */
-  bool isAny() const throw() { return (a_name == codec::Format::asText(codec::Format::Any)); }
+  bool isAny() const { return (a_name == codec::Format::asText(codec::Format::Any)); }
 //   /** @return The format is 'Unknown' */
-//   bool isUnknown() const throw() { return (a_name == codec::Format::asText(codec::Format::Unknown)); }
+//   bool isUnknown() const { return (a_name == codec::Format::asText(codec::Format::Unknown)); }
 
   // RFC 3588
   /** @return The format is 'OctetString' */
-  bool isOctetString() const throw() { return (a_name == codec::Format::asText(codec::Format::OctetString)); }
+  bool isOctetString() const { return (a_name == codec::Format::asText(codec::Format::OctetString)); }
   /** @return The format is 'Integer32' */
-  bool isInteger32() const throw() { return (a_name == codec::Format::asText(codec::Format::Integer32)); }
+  bool isInteger32() const { return (a_name == codec::Format::asText(codec::Format::Integer32)); }
   /** @return The format is 'Integer64' */
-  bool isInteger64() const throw() { return (a_name == codec::Format::asText(codec::Format::Integer64)); }
+  bool isInteger64() const { return (a_name == codec::Format::asText(codec::Format::Integer64)); }
   /** @return The format is 'Unsigned32' */
-  bool isUnsigned32() const throw() { return (a_name == codec::Format::asText(codec::Format::Unsigned32)); }
+  bool isUnsigned32() const { return (a_name == codec::Format::asText(codec::Format::Unsigned32)); }
   /** @return The format is 'Unsigned64' */
-  bool isUnsigned64() const throw() { return (a_name == codec::Format::asText(codec::Format::Unsigned64)); }
+  bool isUnsigned64() const { return (a_name == codec::Format::asText(codec::Format::Unsigned64)); }
   /** @return The format is 'Float32' */
-  bool isFloat32() const throw() { return (a_name == codec::Format::asText(codec::Format::Float32)); }
+  bool isFloat32() const { return (a_name == codec::Format::asText(codec::Format::Float32)); }
   /** @return The format is 'Float64' */
-  bool isFloat64() const throw() { return (a_name == codec::Format::asText(codec::Format::Float64)); }
+  bool isFloat64() const { return (a_name == codec::Format::asText(codec::Format::Float64)); }
   /** @return The format is 'Grouped' */
-  bool isGrouped() const throw() { return (a_name == codec::Format::asText(codec::Format::Grouped)); }
+  bool isGrouped() const { return (a_name == codec::Format::asText(codec::Format::Grouped)); }
   /** @return The format is 'Address' */
-  bool isAddress() const throw() { return (a_name == codec::Format::asText(codec::Format::Address)); }
+  bool isAddress() const { return (a_name == codec::Format::asText(codec::Format::Address)); }
   /** @return The format is 'Time' */
-  bool isTime() const throw() { return (a_name == codec::Format::asText(codec::Format::Time)); }
+  bool isTime() const { return (a_name == codec::Format::asText(codec::Format::Time)); }
   /** @return The format is 'UTF8String' */
-  bool isUTF8String() const throw() { return (a_name == codec::Format::asText(codec::Format::UTF8String)); }
+  bool isUTF8String() const { return (a_name == codec::Format::asText(codec::Format::UTF8String)); }
   /** @return The format is 'DiameterIdentity' */
-  bool isDiameterIdentity() const throw() { return (a_name == codec::Format::asText(codec::Format::DiameterIdentity)); }
+  bool isDiameterIdentity() const { return (a_name == codec::Format::asText(codec::Format::DiameterIdentity)); }
   /** @return The format is 'DiameterURI' */
-  bool isDiameterURI() const throw() { return (a_name == codec::Format::asText(codec::Format::DiameterURI)); }
+  bool isDiameterURI() const { return (a_name == codec::Format::asText(codec::Format::DiameterURI)); }
   /** @return The format is 'Enumerated' */
-  bool isEnumerated() const throw() { return (a_name == codec::Format::asText(codec::Format::Enumerated)); }
+  bool isEnumerated() const { return (a_name == codec::Format::asText(codec::Format::Enumerated)); }
   /** @return The format is 'IPFilterRule' */
-  bool isIPFilterRule() const throw() { return (a_name == codec::Format::asText(codec::Format::IPFilterRule)); }
+  bool isIPFilterRule() const { return (a_name == codec::Format::asText(codec::Format::IPFilterRule)); }
   /** @return The format is 'QoSFilterRule' */
-  bool isQoSFilterRule() const throw() { return (a_name == codec::Format::asText(codec::Format::QoSFilterRule)); }
+  bool isQoSFilterRule() const { return (a_name == codec::Format::asText(codec::Format::QoSFilterRule)); }
 
   /**
   * The diameter format is application-specific or a format type name not registered on dictionary
   *
   * @return The format is application-specific
   */
-  bool isApplicationSpecific(void) const throw() { return (!isRFC3588() && !isReserved()); }
+  bool isApplicationSpecific(void) const { return (!isRFC3588() && !isReserved()); }
 
   /**
   * The diameter format is reserved ('Any' for generic AVP, 'Unknown' for not registered avps)
   *
   * @return The format is reserved
   */
-  bool isReserved(void) const throw() { return (codec::Format::isReserved(a_name)); }
+  bool isReserved(void) const { return (codec::Format::isReserved(a_name)); }
 
   /**
   * Class string representation
   *
   * @return String with class content
   */
-  std::string asString(void) const throw();
+  std::string asString(void) const ;
 
   /**
   * Class xml representation
   *
   * @return XML document with relevant information for this instance.
   */
-  anna::xml::Node* asXML(anna::xml::Node* parent) const throw();
+  anna::xml::Node* asXML(anna::xml::Node* parent) const ;
 
   // operators
 
@@ -227,14 +199,14 @@ public:
   /**
   * Initializes the class content
   */
-  void initialize(const Dictionary *d = NULL) throw() { _initialize(d); }
+  void initialize(const Dictionary *d = NULL) { _initialize(d); }
 
   /**
   * Sets Avp format type name
   *
   * @param type Avp format type name
   */
-  void setName(const char * name) throw(anna::RuntimeException) {
+  void setName(const char * name) noexcept(false) {
     if(name == NULL) throw anna::RuntimeException("Null Format-name not allowed", ANNA_FILE_LOCATION);
 
     a_name = name;
@@ -247,7 +219,7 @@ public:
   *
   * @param rfc3588Format RFC3588 format type
   */
-  void setRFC3588(codec::Format::_v rfc3588Format) throw() {
+  void setRFC3588(codec::Format::_v rfc3588Format) {
     setName(codec::Format::asText(rfc3588Format));
   }
 
@@ -256,7 +228,7 @@ public:
   *
   * @param parent Diameter-basic avp format parent
   */
-  void setParentName(const std::string & parentName) throw(anna::RuntimeException);
+  void setParentName(const std::string & parentName) noexcept(false);
 };