Remove dynamic exceptions
[anna.git] / include / anna / diameter / codec / functions.hpp
index 9c4c5a8..cd6b4bf 100644 (file)
@@ -48,7 +48,7 @@ static const char *MessageDTD = "\
 <!ELEMENT message (avp*)>\n\
 <!ELEMENT avp (avp*)>\n\
 \n\
-<!ATTLIST message version CDATA #IMPLIED name CDATA #IMPLIED code CDATA #IMPLIED flags CDATA #IMPLIED p-bit (yes | no) #IMPLIED e-bit (yes | no) #IMPLIED t-bit (yes | no) #IMPLIED application-id CDATA #REQUIRED hop-by-hop-id CDATA #IMPLIED end-by-end-id CDATA #IMPLIED>\n\
+<!ATTLIST message version CDATA #IMPLIED name CDATA #IMPLIED code CDATA #IMPLIED flags CDATA #IMPLIED p-bit (yes | no) #IMPLIED e-bit (yes | no) #IMPLIED t-bit (yes | no) #IMPLIED application-id CDATA #REQUIRED hop-by-hop-id CDATA #IMPLIED end-to-end-id CDATA #IMPLIED>\n\
 <!--\n\
    version: Diameter version. Sets '1' by default\n\
    name:    Command name within working stack (dictionary identifier)\n\
@@ -65,7 +65,7 @@ static const char *MessageDTD = "\
 \n\
    application-id:   Message application id\n\
    hop-by-hop-id:    Message hop by hop id. Sets '0' by default\n\
-   end-by-end-id:    Message end by end id. Sets '0' by default\n\
+   end-to-end-id:    Message end to end id. Sets '0' by default\n\
 -->\n\
 \n\
 <!ATTLIST avp name CDATA #IMPLIED code CDATA #IMPLIED vendor-code CDATA #IMPLIED flags CDATA #IMPLIED data CDATA #IMPLIED hex-data CDATA #IMPLIED alias CDATA #IMPLIED>\n\
@@ -114,8 +114,6 @@ static const char *MessageDTD = "\
 ";
 
 
-
-
 // Used for alarms, tracing and Failed-AVP construction:
 typedef struct parent {
 
@@ -126,9 +124,9 @@ typedef struct parent {
   std::vector<anna::diameter::AvpId> AvpsId;
   std::vector<std::string> AvpsName;
 
-  void setMessage(const anna::diameter::CommandId & mid, const char *mname = NULL /* well known in validation */) throw();
-  void addAvp(const anna::diameter::AvpId & aid, const char *aname = NULL /* well known in validation */) throw();
-  std::string asString() const throw();
+  void setMessage(const anna::diameter::CommandId & mid, const char *mname = NULL /* well known in validation */) ;
+  void addAvp(const anna::diameter::AvpId & aid, const char *aname = NULL /* well known in validation */) ;
+  std::string asString() const ;
 
 } parent_t;
 
@@ -138,21 +136,21 @@ typedef struct parent {
 struct functions {
 
   // getters & helpers
-  static CommandId getCommandId(const anna::DataBlock &) throw(anna::RuntimeException);
-  static ApplicationId getApplicationId(const anna::DataBlock &) throw(anna::RuntimeException);
-  static HopByHop getHopByHop(const anna::DataBlock &) throw(anna::RuntimeException);
-  static EndToEnd getEndToEnd(const anna::DataBlock &) throw(anna::RuntimeException);
+  static CommandId getCommandId(const anna::DataBlock &) noexcept(false);
+  static ApplicationId getApplicationId(const anna::DataBlock &) noexcept(false);
+  static HopByHop getHopByHop(const anna::DataBlock &) noexcept(false);
+  static EndToEnd getEndToEnd(const anna::DataBlock &) noexcept(false);
 
-  static bool requestBit(const anna::DataBlock &) throw(anna::RuntimeException);
-  static bool proxiableBit(const anna::DataBlock &) throw(anna::RuntimeException);
-  static bool errorBit(const anna::DataBlock &) throw(anna::RuntimeException);
-  static bool potentiallyReTransmittedMessageBit(const anna::DataBlock &) throw(anna::RuntimeException);
+  static bool requestBit(const anna::DataBlock &) noexcept(false);
+  static bool proxiableBit(const anna::DataBlock &) noexcept(false);
+  static bool errorBit(const anna::DataBlock &) noexcept(false);
+  static bool potentiallyReTransmittedMessageBit(const anna::DataBlock &) noexcept(false);
 
-  static bool isRequest(const CommandId & cid) throw() { return (cid.second); }
-  static bool isRequest(const anna::DataBlock & db) throw(anna::RuntimeException) { return requestBit(db); }
+  static bool isRequest(const CommandId & cid) { return (cid.second); }
+  static bool isRequest(const anna::DataBlock & db) noexcept(false) { return requestBit(db); }
 
-  static bool isAnswer(const CommandId & cid) throw() { return (!isRequest(cid)); }
-  static bool isAnswer(const anna::DataBlock & db) throw(anna::RuntimeException) { return (!isRequest(db)); }
+  static bool isAnswer(const CommandId & cid) { return (!isRequest(cid)); }
+  static bool isAnswer(const anna::DataBlock & db) noexcept(false) { return (!isRequest(db)); }
 
 
 
@@ -168,7 +166,7 @@ struct functions {
    * @param hbh Hop-by-Hop Identifier.
    * @param ete End-to-End Identifier.
    */
-  static void decodeCommandHeader(const char *start, char & version, U24 & length, char & flags, CommandId & id, int & appId, int & hbh, int & ete) throw(anna::RuntimeException);
+  static void decodeCommandHeader(const char *start, char & version, U24 & length, char & flags, CommandId & id, int & appId, int & hbh, int & ete) noexcept(false);
 
   /**
    * Decodes an AVP. This helper cannot check boundaries. start pointer must be a valid avp context.
@@ -179,7 +177,7 @@ struct functions {
    * @param length Avp length (includes code, flags, length itself, vendorId if exists and data length).
    * @param data Avp data part.
    */
-  static void decodeAVP(const char *start, AvpId & id, char & flags, int & length, std::string & data) throw(anna::RuntimeException);
+  static void decodeAVP(const char *start, AvpId & id, char & flags, int & length, std::string & data) noexcept(false);
 
   /**
    * Gets the next AVP pointer reference starting from a first-avp data block. It could be the first avp within
@@ -191,7 +189,7 @@ struct functions {
    *
    * @return Pointer to the next AVP found. NULL if no more.
    */
-  static const char * nextAVP(const char *avpsDB, int avpsLen, const char *start) throw(anna::RuntimeException);
+  static const char * nextAVP(const char *avpsDB, int avpsLen, const char *start) noexcept(false);
 
   //  /**
   //  * Gets the next AVP pointer reference starting from a first-avp datablock. It could be the first avp within
@@ -202,7 +200,7 @@ struct functions {
   //  *
   //  * @return Pointer to the next AVP found. NULL if no more.
   //  */
-  //  static const char * nextAVP(const anna::DataBlock & avpsDB, const char *start) throw(anna::RuntimeException);
+  //  static const char * nextAVP(const anna::DataBlock & avpsDB, const char *start) noexcept(false);
 
   /**
    * Gets the next AVP pointer reference within an AVPs set data block with a certain AVP identification.
@@ -214,7 +212,7 @@ struct functions {
    *
    * @return Pointer to first AVP found with identification provided. NULL if not found.
    */
-  static const char *findAVP(const char *avpsDB, int avpsLen, const diameter::AvpId & id, int n = 1) throw(anna::RuntimeException);
+  static const char *findAVP(const char *avpsDB, int avpsLen, const diameter::AvpId & id, int n = 1) noexcept(false);
 
   //  /**
   //  * Gets the next AVP pointer reference within an AVPs set datablock with a certain AVP identification.
@@ -225,14 +223,14 @@ struct functions {
   //  *
   //  * @return Pointer to first AVP found with identification provided. NULL if not found.
   //  */
-  //  static const char * findAVP(const anna::DataBlock & avpsDB, const AvpId & id, int n = 1) throw(anna::RuntimeException);
+  //  static const char * findAVP(const anna::DataBlock & avpsDB, const AvpId & id, int n = 1) noexcept(false);
 
 
 
   // modifiers
-  static void setHopByHop(anna::DataBlock &, HopByHop) throw(anna::RuntimeException);
-  static void setEndToEnd(anna::DataBlock &, EndToEnd) throw(anna::RuntimeException);
-  static void setPotentiallyReTransmittedMessageBit(const anna::DataBlock & db, bool activate = true) throw(anna::RuntimeException);
+  static void setHopByHop(anna::DataBlock &, HopByHop) noexcept(false);
+  static void setEndToEnd(anna::DataBlock &, EndToEnd) noexcept(false);
+  static void setPotentiallyReTransmittedMessageBit(const anna::DataBlock & db, bool activate = true) noexcept(false);
 
 
   /**
@@ -243,7 +241,7 @@ struct functions {
      <!ELEMENT message (avp*)>
      <!ELEMENT avp (avp*)>
 
-     <!ATTLIST message version CDATA #IMPLIED name CDATA #IMPLIED code CDATA #IMPLIED flags CDATA #IMPLIED application-id CDATA #REQUIRED hop-by-hop-id CDATA #IMPLIED end-by-end-id CDATA #IMPLIED>
+     <!ATTLIST message version CDATA #IMPLIED name CDATA #IMPLIED code CDATA #IMPLIED flags CDATA #IMPLIED application-id CDATA #REQUIRED hop-by-hop-id CDATA #IMPLIED end-to-end-id CDATA #IMPLIED>
      <!--
         version: Diameter version. Sets '1' by default
         name:    Command name within working stack (dictionary identifier)
@@ -257,7 +255,7 @@ struct functions {
 
         application-id:   Message application id
         hop-by-hop-id:    Message hop by hop id. Sets '0' by default
-        end-by-end-id:    Message end by end id. Sets '0' by default
+        end-to-end-id:    Message end to end id. Sets '0' by default
      -->
 
      <!ATTLIST avp name CDATA #IMPLIED code CDATA #IMPLIED vendor-code CDATA #IMPLIED flags CDATA #IMPLIED data CDATA #IMPLIED hex-data CDATA #IMPLIED>
@@ -306,7 +304,7 @@ struct functions {
      For example, you could load the document to be decoded over a codec Message by mean #Message::fromXML (using
      the xml document #getRootNode) during document lifetime. After that, it could be destroyed.
    */
-  static void messageXmlDocumentFromXmlFile(anna::xml::DocumentFile &xmlDocument, const std::string & xmlPathFile) throw(anna::RuntimeException);
+  static void messageXmlDocumentFromXmlFile(anna::xml::DocumentFile &xmlDocument, const std::string & xmlPathFile) noexcept(false);
 
   /**
      Interpret xml string representation in order to create a memory xml document.
@@ -320,7 +318,7 @@ struct functions {
      For example, you could load the document to be decoded over a codec Message by mean #Message::fromXML (using
      the xml document #getRootNode) during document lifetime. After that, it could be destroyed.
    */
-  static void messageXmlDocumentFromXmlString(anna::xml::DocumentFile &xmlDocument, const std::string &xmlString) throw(anna::RuntimeException);
+  static void messageXmlDocumentFromXmlString(anna::xml::DocumentMemory &xmlDocument, const std::string &xmlString) noexcept(false);
 };