X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=include%2Fanna%2Fdiameter%2Fcodec%2Ffunctions.hpp;h=cd6b4bf10515ef3bb6cf06e4c861b0b2fcdce79b;hb=refs%2Fheads%2Fmaster;hp=9c4c5a83baabcba0d8039c287eba6eb957a3bb84;hpb=e80e62a5cf9aacad1a9551c68c432147ef98cd29;p=anna.git diff --git a/include/anna/diameter/codec/functions.hpp b/include/anna/diameter/codec/functions.hpp index 9c4c5a8..cd6b4bf 100644 --- a/include/anna/diameter/codec/functions.hpp +++ b/include/anna/diameter/codec/functions.hpp @@ -48,7 +48,7 @@ static const char *MessageDTD = "\ \n\ \n\ \n\ -\n\ +\n\ \n\ \n\ \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 AvpsId; std::vector 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 { - + @@ -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); };