Remove dynamic exceptions
[anna.git] / include / anna / diameter / stack / Avp.hpp
index eafb99a..edd4e91 100644 (file)
@@ -86,7 +86,7 @@ public:
     * @param v FlagRule type
     * @return FlagRule description
     */
-    static const char* asText(const FlagRule::_v v) throw(anna::RuntimeException) {
+    static const char* asText(const FlagRule::_v v) noexcept(false) {
       return asCString(v);
     }
   };
@@ -112,7 +112,7 @@ private:
   bool a_allowFixedRule;
   int a_avprulePosition;
 
-  void _initializeEnumsLabelsAndRules() throw() {
+  void _initializeEnumsLabelsAndRules() {
     a_enums.setLiteral("");
     a_labels.clear();
     a_avprules.clear();
@@ -120,7 +120,7 @@ private:
     a_avprulePosition = 0;
   }
 
-  void _initialize(const Dictionary *d) throw() {
+  void _initialize(const Dictionary *d) {
     a_dictionary = d;
     a_name = "";
     a_formatName = "";
@@ -139,77 +139,77 @@ public:
 
 
   // get
-  const AvpId & getId(void) const throw() { return a_id; }
-  const std::string & getName(void) const throw() { return a_name; }
-  const std::string & getFormatName(void) const throw() { return a_formatName; }
+  const AvpId & getId(void) const { return a_id; }
+  const std::string & getName(void) const { return a_name; }
+  const std::string & getFormatName(void) const { return a_formatName; }
 
-  const FlagRule::_v & getVbit(void) const throw() { return a_vBit; }
-  const FlagRule::_v & getMbit(void) const throw() { return a_mBit; }
-  const FlagRule::_v & getPbit(void) const throw() { return a_pBit; }
-  bool mayEncrypt(void) const throw() { return a_mayEncrypt; }
+  const FlagRule::_v & getVbit(void) const { return a_vBit; }
+  const FlagRule::_v & getMbit(void) const { return a_mBit; }
+  const FlagRule::_v & getPbit(void) const { return a_pBit; }
+  bool mayEncrypt(void) const { return a_mayEncrypt; }
 
-  const char * getEnums(void) const throw() { return a_enums.getLiteral(); }
-  const char * getAlias(const std::string data) const throw() {
+  const char * getEnums(void) const { return a_enums.getLiteral(); }
+  const char * getAlias(const std::string data) const {
     std::map<std::string, std::string>::const_iterator it = a_labels.find(data);
     return ((it != a_labels.end()) ? ((*it).second.c_str()) : NULL);
   }
 
   // containers
-  const_avprule_iterator avprule_begin() const throw() { return a_avprules.begin(); }
-  const_avprule_iterator avprule_end() const throw() { return a_avprules.end(); }
-  int avprule_size() const throw() { return a_avprules.size(); }
+  const_avprule_iterator avprule_begin() const { return a_avprules.begin(); }
+  const_avprule_iterator avprule_end() const { return a_avprules.end(); }
+  int avprule_size() const { return a_avprules.size(); }
 
-  const_label_iterator label_begin() const throw() { return a_labels.begin(); }
-  const_label_iterator label_end() const throw() { return a_labels.end(); }
-  int label_size() const throw() { return a_labels.size(); }
+  const_label_iterator label_begin() const { return a_labels.begin(); }
+  const_label_iterator label_end() const { return a_labels.end(); }
+  int label_size() const { return a_labels.size(); }
 
 
   // helpers
-  bool allowEnum(int value) const throw() { return a_enums.contain(value); }
-  bool hasAliases(void) const throw() { return (a_labels.size() != 0); }
-  bool isChild(const AvpId & avp) const throw();
-  std::string getFlagsDescription(void) const throw();
-  std::string getFlagRulesDescription(void) const throw();
-  const Format * getFormat() const throw();
+  bool allowEnum(int value) const { return a_enums.contain(value); }
+  bool hasAliases(void) const { return (a_labels.size() != 0); }
+  bool isChild(const AvpId & avp) const ;
+  std::string getFlagsDescription(void) const ;
+  std::string getFlagRulesDescription(void) const ;
+  const Format * getFormat() const ;
 
-  std::string asString(void) const throw();
-  anna::xml::Node* asXML(anna::xml::Node* parent) const throw();
+  std::string asString(void) const ;
+  anna::xml::Node* asXML(anna::xml::Node* parent) const ;
 
   // operators
 
   // set
-  void setCode(const S32 & c) throw(anna::RuntimeException) {
+  void setCode(const S32 & c) noexcept(false) {
     if(c < 0) throw anna::RuntimeException("Negative avp-code not allowed", ANNA_FILE_LOCATION);
 
     a_id.first = c;
   }
 
-  void setVendorId(const S32 & v) throw(anna::RuntimeException) {
+  void setVendorId(const S32 & v) noexcept(false) {
     if(v < 0) throw anna::RuntimeException("Negative vendor-id not allowed", ANNA_FILE_LOCATION);
 
     a_id.second = v;
   }
 
-  void setName(const std::string & n) throw(anna::RuntimeException) {
+  void setName(const std::string & n) noexcept(false) {
     if(n == "") throw anna::RuntimeException("Empty avp-name string not allowed", ANNA_FILE_LOCATION);
 
     a_name = n;
   }
 
-  void initialize(const Dictionary *d = NULL) throw() { _initialize(d); }
-  void setVendorName(const std::string & vn) throw() { a_vendorName = vn; }
-  void setFormatName(const std::string & fn) throw() { a_formatName = fn; }
-  void setVbit(const FlagRule::_v &v) throw() { a_vBit = v; }
-  void setMbit(const FlagRule::_v &m) throw() { a_mBit = m; }
-  void setPbit(const FlagRule::_v &p) throw() { a_pBit = p; } // deprecated flag ...
-  void setMayEncrypt(bool me) throw() { a_mayEncrypt = me; }
+  void initialize(const Dictionary *d = NULL) { _initialize(d); }
+  void setVendorName(const std::string & vn) { a_vendorName = vn; }
+  void setFormatName(const std::string & fn) { a_formatName = fn; }
+  void setVbit(const FlagRule::_v &v) { a_vBit = v; }
+  void setMbit(const FlagRule::_v &m) { a_mBit = m; }
+  void setPbit(const FlagRule::_v &p) { a_pBit = p; } // deprecated flag ...
+  void setMayEncrypt(bool me) { a_mayEncrypt = me; }
 
-  void setEnums(const char * e) throw() { a_enums.setLiteral(e); }
-  void addEnums(const char * e) throw() { a_enums.addLiteral(e); a_enums.simplifyLiteral(); }
+  void setEnums(const char * e) { a_enums.setLiteral(e); }
+  void addEnums(const char * e) { a_enums.addLiteral(e); a_enums.simplifyLiteral(); }
 
   // After format configuration:
-  void addLabel(const std::string & data,  const std::string & alias) throw(anna::RuntimeException);
-  void addAvpRule(const AvpRule & avpRule) throw(anna::RuntimeException);
+  void addLabel(const std::string & data,  const std::string & alias) noexcept(false);
+  void addAvpRule(const AvpRule & avpRule) noexcept(false);
 };