From: Eduardo Ramos Testillano (eramedu) Date: Sun, 24 May 2020 18:48:20 +0000 (+0200) Subject: Remove dynamic exceptions X-Git-Url: https://git.teslayout.com/public/public/public/?a=commitdiff_plain;h=5a6cba5fde2b2f538a7515f8293cc0a8d9589dfa;p=anna.git Remove dynamic exceptions Dynamic exceptions were deprecated at C++11 https://redmine.teslayout.com/issues/47 --- diff --git a/README.md b/README.md index 27d8115..b9bc6ae 100644 --- a/README.md +++ b/README.md @@ -72,12 +72,18 @@ You could avoid database resources compilation to ease the add of requirements: > sudo apt-get install libmysqlclient-dev ### Oracle: - https://help.ubuntu.com/community/Oracle%20Instant%20Client + Go to https://help.ubuntu.com/community/Oracle%20Instant%20Client and download development packages: - After instalation of basic/sqlplus/devel, edit CMakeLists.txt - and update oracle includes, for example: + For example: - include_directories(/usr/include/oracle//client64/include) + > wget https://download.oracle.com/otn_software/linux/instantclient/19600/oracle-instantclient19.6-devel-19.6.0.0.0-1.x86_64.rpm + > sudo alien -i oracle-instantclient19.6-devel-19.6.0.0.0-1.x86_64.rpm + + (probably basic & sqlplus is also needed) + + Edit CMakeLists.txt and update oracle includes, for example: + + > include_directories(/usr/include/oracle//client64/include) ### Oracle-OpenLDAP conflict: as usual, Oracle is doing things very bad. Move the ldap.h from oracle includes, i.e.: diff --git a/dynamic/launcher/default/Procedure.cpp b/dynamic/launcher/default/Procedure.cpp index 6649e62..a3ef970 100644 --- a/dynamic/launcher/default/Procedure.cpp +++ b/dynamic/launcher/default/Procedure.cpp @@ -16,7 +16,7 @@ // Local #include "Procedure.hpp" -void Procedure::execute(const std::string &args, std::string &response) throw(anna::RuntimeException) { +void Procedure::execute(const std::string &args, std::string &response) noexcept(false) { response = "Empty default implementation. Make dynamic library and reimplement this method."; if (args != "" ) { response += " Provided argument(s) ignored: "; @@ -24,6 +24,6 @@ void Procedure::execute(const std::string &args, std::string &response) throw(an } } -void Procedure::execute(const nlohmann::json &args, std::string &response) throw(anna::RuntimeException) { +void Procedure::execute(const nlohmann::json &args, std::string &response) noexcept(false) { execute(args.dump(), response); } diff --git a/dynamic/launcher/default/Procedure.hpp b/dynamic/launcher/default/Procedure.hpp index 4d85411..9ed0622 100644 --- a/dynamic/launcher/default/Procedure.hpp +++ b/dynamic/launcher/default/Procedure.hpp @@ -20,8 +20,8 @@ class Procedure { public: Procedure(anna::comm::Application *app) : a_app(app) {;} - virtual void execute(const std::string &args, std::string &response) throw(anna::RuntimeException); - virtual void execute(const nlohmann::json &args, std::string &response) throw(anna::RuntimeException); + virtual void execute(const std::string &args, std::string &response) noexcept(false); + virtual void execute(const nlohmann::json &args, std::string &response) noexcept(false); }; #endif diff --git a/dynamic/launcher/gx/00001/Procedure.cpp b/dynamic/launcher/gx/00001/Procedure.cpp index 042efee..03e02eb 100644 --- a/dynamic/launcher/gx/00001/Procedure.cpp +++ b/dynamic/launcher/gx/00001/Procedure.cpp @@ -59,7 +59,7 @@ namespace { } } -void Procedure::execute(const std::string &args, std::string &response) throw(anna::RuntimeException) { +void Procedure::execute(const std::string &args, std::string &response) noexcept(false) { response = "Dynamic procedure failed to process '"; response += args; response += "': "; @@ -294,7 +294,7 @@ void Procedure::execute(const std::string &args, std::string &response) throw(a response += "CCR-Initial"; if (haveTermination) response += " + CCR-Termination"; } -void Procedure::execute(const nlohmann::json &args, std::string &response) throw(anna::RuntimeException) { +void Procedure::execute(const nlohmann::json &args, std::string &response) noexcept(false) { // Build the arguments string and call the previous centralized logic procedure execution: // ||||[|CCR-T xml file] diff --git a/dynamic/launcher/gx/00001/Procedure.hpp b/dynamic/launcher/gx/00001/Procedure.hpp index 7c833f9..e89dc3d 100644 --- a/dynamic/launcher/gx/00001/Procedure.hpp +++ b/dynamic/launcher/gx/00001/Procedure.hpp @@ -20,8 +20,8 @@ class Procedure { public: Procedure(anna::comm::Application *app) : a_app(app) {;} - virtual void execute(const std::string &args, std::string &response) throw(anna::RuntimeException); - virtual void execute(const nlohmann::json &args, std::string &response) throw(anna::RuntimeException); + virtual void execute(const std::string &args, std::string &response) noexcept(false); + virtual void execute(const nlohmann::json &args, std::string &response) noexcept(false); }; #endif diff --git a/example/comm/blocker/main.cpp b/example/comm/blocker/main.cpp index 354d9b0..c166abf 100644 --- a/example/comm/blocker/main.cpp +++ b/example/comm/blocker/main.cpp @@ -31,7 +31,7 @@ public: MyCommunicator () {;} private: - void eventReceiveMessage (comm::ClientSocket&, const Message&) throw (RuntimeException); + void eventReceiveMessage (comm::ClientSocket&, const Message&) noexcept(false); }; class Blocker : public comm::Application { @@ -42,8 +42,8 @@ private: MyCommunicator a_communicator; comm::ServerSocket* a_blockerSocket; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); }; using namespace std; @@ -88,7 +88,7 @@ Blocker::Blocker () : // Inicializa el servidor de sockets. //----------------------------------------------------------------------------------------- void Blocker::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -104,7 +104,7 @@ void Blocker::initialize () // Cuando hay un nuevo mensaje invocar�a Communicator::eventReceiveMessage //----------------------------------------------------------------------------------------- void Blocker::run () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -120,7 +120,7 @@ void Blocker::run () // Cuando recibe el primer mensaje deja al sistema bloqueado esperando una tecla. //----------------------------------------------------------------------------------------- void MyCommunicator::eventReceiveMessage (ClientSocket& clientSocket, const Message& message) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("MyCommunicator", "eventReceiveMessage", ANNA_FILE_LOCATION)); static bool blocking = true; diff --git a/example/comm/brkClient/main.cpp b/example/comm/brkClient/main.cpp index de70fda..e8f4bfe 100644 --- a/example/comm/brkClient/main.cpp +++ b/example/comm/brkClient/main.cpp @@ -36,8 +36,8 @@ private: test::Response a_response; test::Request a_request; - void eventReceiveMessage (ClientSocket&, const Message&) throw (RuntimeException); - void eventUser (const char* id, const void* context) throw (); + void eventReceiveMessage (ClientSocket&, const Message&) noexcept(false); + void eventUser (const char* id, const void* context) ; }; typedef comm::ByRangeDelivery MyService; @@ -47,16 +47,16 @@ public: BRKClient (); - MyService* getService () const throw () { return a_service; } - const test::Menu& getMenu () const throw () { return a_menu; } + MyService* getService () const { return a_service; } + const test::Menu& getMenu () const { return a_menu; } private: MyCommunicator a_communicator; test::Menu a_menu; MyService* a_service; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); }; using namespace std; @@ -95,7 +95,7 @@ BRKClient::BRKClient () : } void BRKClient::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -128,14 +128,14 @@ void BRKClient::initialize () } void BRKClient::run () - throw (RuntimeException) + noexcept(false) { a_menu.paint (); a_communicator.accept (); } void MyCommunicator::eventReceiveMessage (ClientSocket&, const Message& message) - throw (RuntimeException) + noexcept(false) { a_response.decode (message.getBody ()); @@ -152,7 +152,7 @@ void MyCommunicator::eventReceiveMessage (ClientSocket&, const Message& message) // notifica al comunicador mediante un evento de usuario. //----------------------------------------------------------------------------------------- void MyCommunicator::eventUser (const char* id, const void* context) - throw () + { LOGMETHOD (TraceMethod tm ("MyCommunicator", "eventUser", ANNA_FILE_LOCATION)); diff --git a/example/comm/client/main.cpp b/example/comm/client/main.cpp index d201821..c9663ec 100644 --- a/example/comm/client/main.cpp +++ b/example/comm/client/main.cpp @@ -40,9 +40,9 @@ public: a_txMessageCounter (0) {;} - void setMessageBySecond (const int messageBySecond) throw () { a_messageBySecond = messageBySecond; } + void setMessageBySecond (const int messageBySecond) { a_messageBySecond = messageBySecond; } - int getTxMessageCounter () const throw () { return a_txMessageCounter; } + int getTxMessageCounter () const { return a_txMessageCounter; } private: int a_messageBySecond; @@ -51,7 +51,7 @@ private: int a_txMessageCounter; ThreadData a_requests; - bool tick () throw (RuntimeException); + bool tick () noexcept(false); }; class MyCommunicator : public Communicator { @@ -64,30 +64,30 @@ private: int a_rxMessageCounter; void eventReceiveMessage (ClientSocket &, const Message&) - throw (RuntimeException); + noexcept(false); protected: using Communicator::eventBreakConnection; - void eventBreakConnection (const ClientSocket&) throw (); + void eventBreakConnection (const ClientSocket&) ; - void eventBreakConnection (Server* server) throw () { + void eventBreakConnection (Server* server) { comm::Communicator::eventBreakConnection (server); } - void eventBreakConnection (const Service* service) throw () { + void eventBreakConnection (const Service* service) { comm::Communicator::eventBreakConnection (service); } - static bool isOk (const test::Response& response) throw (); + static bool isOk (const test::Response& response) ; }; class HeavyClient : public anna::comm::Application { public: HeavyClient (); - Server* getServer () const throw () { return a_server; } - const Sender* getSender () const throw () { return &a_sender; } + Server* getServer () const { return a_server; } + const Sender* getSender () const { return &a_sender; } private: MyCommunicator a_communicator; @@ -95,8 +95,8 @@ private: Sender a_sender; Server* a_server; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); }; using namespace std; @@ -141,7 +141,7 @@ HeavyClient::HeavyClient () : } void HeavyClient::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -155,7 +155,7 @@ void HeavyClient::initialize () } void HeavyClient::run () - throw (RuntimeException) + noexcept(false) { a_timeController.activate (a_sender); @@ -163,7 +163,7 @@ void HeavyClient::run () } void MyCommunicator::eventReceiveMessage (ClientSocket&, const Message& message) - throw (RuntimeException) + noexcept(false) { test::Response& response = a_responses.get (); response.decode (message.getBody ()); @@ -196,7 +196,7 @@ void MyCommunicator::eventReceiveMessage (ClientSocket&, const Message& message) } void MyCommunicator::eventBreakConnection (const ClientSocket& clientSocket) - throw () + { if (a_rxMessageCounter == 0) return; @@ -217,7 +217,7 @@ void MyCommunicator::eventBreakConnection (const ClientSocket& clientSocket) } bool MyCommunicator::isOk (const test::Response& response) - throw () + { if (response.op != '+' && response.op != '-' && response.op != '*' && response.op != '/') return false; @@ -243,7 +243,7 @@ bool MyCommunicator::isOk (const test::Response& response) } bool Sender::tick () - throw (RuntimeException) + noexcept(false) { Server* server = static_cast (anna::app::functions::getApp ()).getServer (); Communicator* communicator = anna::app::functions::component (ANNA_FILE_LOCATION); diff --git a/example/comm/codec/main.cpp b/example/comm/codec/main.cpp index 761dadb..2efa125 100644 --- a/example/comm/codec/main.cpp +++ b/example/comm/codec/main.cpp @@ -32,18 +32,18 @@ public: attach ("double", a_double); } - void set (const std::string& value) throw () { a_string = a_string2 = value; a_string2 += value; } - void set (const int value) throw () { a_integer = value; } - void set (const anna::DataBlock& value) throw () { a_dataBlock = value; } - void set (const float value) throw () { a_float = value; } - void set (const double value) throw () { a_double = value; } + void set (const std::string& value) { a_string = a_string2 = value; a_string2 += value; } + void set (const int value) { a_integer = value; } + void set (const anna::DataBlock& value) { a_dataBlock = value; } + void set (const float value) { a_float = value; } + void set (const double value) { a_double = value; } - const std::string& getString () const throw () { return a_string; } - const int getInteger () const throw () { return a_integer; } - const anna::DataBlock& getDataBlock () const throw (anna::RuntimeException) { return a_dataBlock; } - const std::string& getString2 () const throw () { return a_string2; } - float getFloat () const throw () { return a_float; } - float getDouble () const throw () { return a_double; } + const std::string& getString () const { return a_string; } + const int getInteger () const { return a_integer; } + const anna::DataBlock& getDataBlock () const noexcept(false) { return a_dataBlock; } + const std::string& getString2 () const { return a_string2; } + float getFloat () const { return a_float; } + float getDouble () const { return a_double; } private: std::string a_string; @@ -62,7 +62,7 @@ private: MyCodec a_input; MyCodec a_output; - void run () throw (anna::RuntimeException); + void run () noexcept(false); }; using namespace std; @@ -102,7 +102,7 @@ Test::Test () : } void Test::run () - throw (RuntimeException) + noexcept(false) { CommandLine& cm (CommandLine::instantiate ()); diff --git a/example/comm/datagramKClient/main.cpp b/example/comm/datagramKClient/main.cpp index 82688b4..9fe3ce1 100644 --- a/example/comm/datagramKClient/main.cpp +++ b/example/comm/datagramKClient/main.cpp @@ -32,16 +32,16 @@ private: test::Response a_response; test::Request a_request; - void eventReceiveMessage (ClientSocket&, const Message&) throw (RuntimeException); - void eventUser (const char* id, const void* context) throw (); + void eventReceiveMessage (ClientSocket&, const Message&) noexcept(false); + void eventUser (const char* id, const void* context) ; }; class KClient : public anna::comm::Application { public: KClient (); - comm::DatagramSocket* getServer () const throw () { return a_output; } - const test::Menu& getMenu () const throw () { return a_menu; } + comm::DatagramSocket* getServer () const { return a_output; } + const test::Menu& getMenu () const { return a_menu; } private: MyCommunicator a_communicator; @@ -49,8 +49,8 @@ private: comm::DatagramSocket* a_output; comm::DatagramSocket* a_input; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); }; using namespace std; @@ -92,7 +92,7 @@ KClient::KClient () : } void KClient::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -118,14 +118,14 @@ void KClient::initialize () } void KClient::run () - throw (RuntimeException) + noexcept(false) { a_menu.paint (); a_communicator.accept (); } void MyCommunicator::eventReceiveMessage (ClientSocket&, const Message& message) - throw (RuntimeException) + noexcept(false) { a_response.decode (message.getBody ()); @@ -142,7 +142,7 @@ void MyCommunicator::eventReceiveMessage (ClientSocket&, const Message& message) // notifica al comunicador mediante un evento de usuario. //----------------------------------------------------------------------------------------- void MyCommunicator::eventUser (const char* id, const void* context) - throw () + { LOGMETHOD (TraceMethod tm ("MyCommunicator", "eventUser", ANNA_FILE_LOCATION)); diff --git a/example/comm/datagramRServer/main.cpp b/example/comm/datagramRServer/main.cpp index 255b63e..d2d29d9 100644 --- a/example/comm/datagramRServer/main.cpp +++ b/example/comm/datagramRServer/main.cpp @@ -44,7 +44,7 @@ public: class MyReceiver : public Receiver { public: virtual ~MyReceiver() {;} - static const char* className () throw () { return "MyReceiver"; } + static const char* className () { return "MyReceiver"; } private: Request a_request; @@ -52,8 +52,8 @@ private: MyCommunicator* a_communicator; MyReceiver () : Receiver ("MyReceiver") { ; } - void initialize () throw (RuntimeException); - void apply (comm::ClientSocket &, const Message&) throw (RuntimeException); + void initialize () noexcept(false); + void apply (comm::ClientSocket &, const Message&) noexcept(false); friend class Allocator ; }; @@ -62,7 +62,7 @@ class ArithmeticServer : public comm::Application { public: ArithmeticServer (); - comm::DatagramSocket* getOutput () throw () { return a_output; } + comm::DatagramSocket* getOutput () { return a_output; } private: MyCommunicator* a_communicator; @@ -70,9 +70,9 @@ private: comm::DatagramSocket* a_input; comm::DatagramSocket* a_output; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); - xml::Node* asXML (xml::Node* app) const throw (); + void initialize () noexcept(false); + void run () noexcept(false); + xml::Node* asXML (xml::Node* app) const ; }; using namespace std; @@ -118,7 +118,7 @@ ArithmeticServer::ArithmeticServer () : // Inicializa el servidor de sockets. //----------------------------------------------------------------------------------------- void ArithmeticServer::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -145,7 +145,7 @@ void ArithmeticServer::initialize () // Cuando hay un nuevo mensaje invocar�a Communicator::eventReceiveMessage //----------------------------------------------------------------------------------------- void ArithmeticServer::run () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -156,7 +156,7 @@ void ArithmeticServer::run () } xml::Node* ArithmeticServer::asXML (xml::Node* app) const - throw () + { xml::Node* node = app::Application::asXML (app); @@ -167,13 +167,13 @@ xml::Node* ArithmeticServer::asXML (xml::Node* app) const } void MyReceiver::initialize () - throw (RuntimeException) + noexcept(false) { a_communicator = app::functions::component (ANNA_FILE_LOCATION); } void MyReceiver::apply (ClientSocket&, const Message& message) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("MyReceiver", "apply", ANNA_FILE_LOCATION)); diff --git a/example/comm/irkClient/main.cpp b/example/comm/irkClient/main.cpp index e504698..fe231f3 100644 --- a/example/comm/irkClient/main.cpp +++ b/example/comm/irkClient/main.cpp @@ -35,8 +35,8 @@ private: test::Response a_response; test::Request a_request; - void eventReceiveMessage (ClientSocket&, const Message&) throw (RuntimeException); - void eventUser (const char* id, const void* context) throw (); + void eventReceiveMessage (ClientSocket&, const Message&) noexcept(false); + void eventUser (const char* id, const void* context) ; }; typedef comm::IndexedDelivery MyService; @@ -46,16 +46,16 @@ public: IRKClient (); - MyService* getService () const throw () { return a_service; } - const test::Menu& getMenu () const throw () { return a_menu; } + MyService* getService () const { return a_service; } + const test::Menu& getMenu () const { return a_menu; } private: MyCommunicator a_communicator; test::Menu a_menu; MyService* a_service; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); }; using namespace std; @@ -97,7 +97,7 @@ IRKClient::IRKClient () : } void IRKClient::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -127,14 +127,14 @@ void IRKClient::initialize () } void IRKClient::run () - throw (RuntimeException) + noexcept(false) { a_menu.paint (); a_communicator.accept (); } void MyCommunicator::eventReceiveMessage (ClientSocket&, const Message& message) - throw (RuntimeException) + noexcept(false) { a_response.decode (message.getBody ()); @@ -151,7 +151,7 @@ void MyCommunicator::eventReceiveMessage (ClientSocket&, const Message& message) // notifica al comunicador mediante un evento de usuario. //----------------------------------------------------------------------------------------- void MyCommunicator::eventUser (const char* id, const void* context) - throw () + { LOGMETHOD (TraceMethod tm ("MyCommunicator", "eventUser", ANNA_FILE_LOCATION)); int index; diff --git a/example/comm/kClient/main.cpp b/example/comm/kClient/main.cpp index 44524dc..61bba74 100644 --- a/example/comm/kClient/main.cpp +++ b/example/comm/kClient/main.cpp @@ -32,24 +32,24 @@ private: test::Response a_response; test::Request a_request; - void eventReceiveMessage (ClientSocket&, const Message&) throw (RuntimeException); - void eventUser (const char* id, const void* context) throw (); + void eventReceiveMessage (ClientSocket&, const Message&) noexcept(false); + void eventUser (const char* id, const void* context) ; }; class KClient : public anna::comm::Application { public: KClient (); - Server* getServer () const throw () { return a_server; } - const test::Menu& getMenu () const throw () { return a_menu; } + Server* getServer () const { return a_server; } + const test::Menu& getMenu () const { return a_menu; } private: MyCommunicator a_communicator; test::Menu a_menu; Server* a_server; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); }; using namespace std; @@ -92,7 +92,7 @@ KClient::KClient () : } void KClient::initialize () - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("MyCommunicator", "initialize", ANNA_FILE_LOCATION)); @@ -117,7 +117,7 @@ void KClient::initialize () } void KClient::run () - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("MyCommunicator", "run", ANNA_FILE_LOCATION)); @@ -126,7 +126,7 @@ void KClient::run () } void MyCommunicator::eventReceiveMessage (ClientSocket&, const Message& message) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("MyCommunicator", "eventReceiveMessage", ANNA_FILE_LOCATION)); @@ -145,7 +145,7 @@ void MyCommunicator::eventReceiveMessage (ClientSocket&, const Message& message) // notifica al comunicador mediante un evento de usuario. //----------------------------------------------------------------------------------------- void MyCommunicator::eventUser (const char* id, const void* context) - throw () + { LOGMETHOD (TraceMethod tm ("MyCommunicator", "eventUser", ANNA_FILE_LOCATION)); diff --git a/example/comm/kxClient/main.cpp b/example/comm/kxClient/main.cpp index 87bf3c6..5fe1d0c 100644 --- a/example/comm/kxClient/main.cpp +++ b/example/comm/kxClient/main.cpp @@ -37,8 +37,8 @@ public: class ClientSocketAllocator { public: static comm::INetAddress* st_inetAddress; - static comm::ClientSocket* create () throw () { return new comm::ClientSocket (*st_inetAddress); } - static void destroy (comm::ClientSocket* clientSocket) throw () { delete clientSocket; } + static comm::ClientSocket* create () { return new comm::ClientSocket (*st_inetAddress); } + static void destroy (comm::ClientSocket* clientSocket) { delete clientSocket; } }; private: @@ -49,25 +49,25 @@ private: comm::INetAddress a_inetAddress; Recycler a_clientSockets; - void do_initialize () throw (RuntimeException); + void do_initialize () noexcept(false); - void eventReceiveMessage (comm::ClientSocket&, const comm::Message&) throw (RuntimeException); - void eventBreakConnection (const comm::ClientSocket&) throw (); - void eventUser (const char* id, const void* context) throw (); + void eventReceiveMessage (comm::ClientSocket&, const comm::Message&) noexcept(false); + void eventBreakConnection (const comm::ClientSocket&) ; + void eventUser (const char* id, const void* context) ; }; class KXClient : public anna::comm::Application { public: KXClient (); - const test::Menu& getMenu () const throw () { return a_menu; } + const test::Menu& getMenu () const { return a_menu; } private: MyCommunicator a_communicator; test::Menu a_menu; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); }; using namespace std; @@ -107,13 +107,13 @@ KXClient::KXClient () : } void KXClient::initialize () - throw (RuntimeException) + noexcept(false) { a_communicator.attach (&a_menu); } void KXClient::run () - throw (RuntimeException) + noexcept(false) { a_menu.paint (); a_communicator.accept (); @@ -123,7 +123,7 @@ void KXClient::run () // Crea la direccion a la que se conectaran los ClientSocket para enviar las peticiones. //-------------------------------------------------------------------------------------------- void MyCommunicator::do_initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -140,7 +140,7 @@ void MyCommunicator::do_initialize () } void MyCommunicator::eventReceiveMessage (comm::ClientSocket&, const comm::Message& message) - throw (RuntimeException) + noexcept(false) { a_response.decode (message.getBody ()); @@ -154,7 +154,7 @@ void MyCommunicator::eventReceiveMessage (comm::ClientSocket&, const comm::Messa // reutilizar la instancia (no la conexion). //----------------------------------------------------------------------------------------- void MyCommunicator::eventBreakConnection (const comm::ClientSocket& clientSocket) - throw () + { a_clientSockets.release (&clientSocket); } @@ -164,7 +164,7 @@ void MyCommunicator::eventBreakConnection (const comm::ClientSocket& clientSocke // notifica al comunicador mediante un evento de usuario. //----------------------------------------------------------------------------------------- void MyCommunicator::eventUser (const char* id, const void* context) - throw () + { LOGMETHOD (TraceMethod tm ("MyCommunicator", "eventUser", ANNA_FILE_LOCATION)); diff --git a/example/comm/largeBinaryCodec/main.cpp b/example/comm/largeBinaryCodec/main.cpp index 0b99468..c029c8f 100644 --- a/example/comm/largeBinaryCodec/main.cpp +++ b/example/comm/largeBinaryCodec/main.cpp @@ -25,11 +25,11 @@ public: attach ("integer", a_integer); } - void set (const char* value) throw () { a_string = value; } - void set (const int value) throw () { a_integer = value; } + void set (const char* value) { a_string = value; } + void set (const int value) { a_integer = value; } - const std::string& getString () const throw () { return a_string; } - const int getInteger () const throw () { return a_integer; } + const std::string& getString () const { return a_string; } + const int getInteger () const { return a_integer; } private: std::string a_string; @@ -43,9 +43,9 @@ public: private: MyCodec a_input; - void show (const LargeBinaryCodec& lbc) throw (anna::RuntimeException); + void show (const LargeBinaryCodec& lbc) noexcept(false); - void run () throw (anna::RuntimeException); + void run () noexcept(false); }; using namespace std; @@ -82,7 +82,7 @@ Test::Test () : } void Test::run () - throw (RuntimeException) + noexcept(false) { CommandLine& cm (CommandLine::instantiate ()); LargeBinaryCodec input (1, false); @@ -110,7 +110,7 @@ void Test::run () } void Test::show (const LargeBinaryCodec& lbc) - throw (RuntimeException) + noexcept(false) { MyCodec output; diff --git a/example/comm/rServer/main.cpp b/example/comm/rServer/main.cpp index d09404f..768fc84 100644 --- a/example/comm/rServer/main.cpp +++ b/example/comm/rServer/main.cpp @@ -44,7 +44,7 @@ public: class MyReceiver : public Receiver { public: virtual ~MyReceiver() {;} - static const char* className () throw () { return "MyReceiver"; } + static const char* className () { return "MyReceiver"; } private: Request a_request; @@ -52,8 +52,8 @@ private: MyCommunicator* a_communicator; MyReceiver () : Receiver ("MyReceiver") { ; } - void initialize () throw (RuntimeException); - void apply (comm::ClientSocket &, const Message&) throw (RuntimeException); + void initialize () noexcept(false); + void apply (comm::ClientSocket &, const Message&) noexcept(false); friend class Allocator ; }; @@ -68,10 +68,10 @@ private: ReceiverFactoryImpl a_receiverFactory; comm::ServerSocket* a_serverSocket; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); - xml::Node* asXML (xml::Node* app) const throw (); - void signalTerminate () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); + xml::Node* asXML (xml::Node* app) const ; + void signalTerminate () noexcept(false); }; using namespace std; @@ -125,7 +125,7 @@ ArithmeticServer::ArithmeticServer () : // Inicializa el servidor de sockets. //----------------------------------------------------------------------------------------- void ArithmeticServer::initialize () - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("ArithmeticServer", "initialize", ANNA_FILE_LOCATION)); @@ -154,7 +154,7 @@ void ArithmeticServer::initialize () // Cuando hay un nuevo mensaje invocar�a Communicator::eventReceiveMessage //----------------------------------------------------------------------------------------- void ArithmeticServer::run () - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("ArithmeticServer", "run", ANNA_FILE_LOCATION)); @@ -177,7 +177,7 @@ void ArithmeticServer::run () } xml::Node* ArithmeticServer::asXML (xml::Node* app) const - throw () + { xml::Node* node = app::Application::asXML (app); @@ -188,20 +188,20 @@ xml::Node* ArithmeticServer::asXML (xml::Node* app) const } void ArithmeticServer::signalTerminate () - throw (RuntimeException) + noexcept(false) { a_communicator->terminate (); comm::Application::signalTerminate (); } void MyReceiver::initialize () - throw (RuntimeException) + noexcept(false) { a_communicator = app::functions::component (ANNA_FILE_LOCATION); } void MyReceiver::apply (ClientSocket& clientSocket, const Message& message) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("MyReceiver", "apply", ANNA_FILE_LOCATION)); diff --git a/example/comm/rrClient/main.cpp b/example/comm/rrClient/main.cpp index 252167f..9a1ba5f 100644 --- a/example/comm/rrClient/main.cpp +++ b/example/comm/rrClient/main.cpp @@ -39,9 +39,9 @@ public: a_txMessageCounter (0) {;} - void setMessageBySecond (const int messageBySecond) throw () { a_messageBySecond = messageBySecond; } + void setMessageBySecond (const int messageBySecond) { a_messageBySecond = messageBySecond; } - int getTxMessageCounter () const throw () { return a_txMessageCounter; } + int getTxMessageCounter () const { return a_txMessageCounter; } private: int a_messageBySecond; @@ -50,7 +50,7 @@ private: int a_txMessageCounter; ThreadData a_requests; - bool tick () throw (RuntimeException); + bool tick () noexcept(false); }; class MyCommunicator : public Communicator { @@ -64,25 +64,25 @@ private: int a_avgResponseTime; int a_rxMessageCounter; - void eventReceiveMessage (ClientSocket &, const Message&) throw (RuntimeException); + void eventReceiveMessage (ClientSocket &, const Message&) noexcept(false); /* - void eventBreakConnection (const ClientSocket&) throw (); + void eventBreakConnection (const ClientSocket&) ; - void eventBreakConnection (Server* server) throw () { + void eventBreakConnection (Server* server) { comm::Communicator::eventBreakConnection (server); } */ - void eventBreakConnection (const Service* service) throw (); + void eventBreakConnection (const Service* service) ; - static bool isOk (const test::Response& response) throw (); + static bool isOk (const test::Response& response) ; }; class RRClient : public anna::comm::Application { public: RRClient (); - Service* getService () const throw () { return a_service; } - const Sender* getSender () const throw () { return &a_sender; } + Service* getService () const { return a_service; } + const Sender* getSender () const { return &a_sender; } private: MyCommunicator a_communicator; @@ -90,8 +90,8 @@ private: Sender a_sender; Service* a_service; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); }; using namespace std; @@ -136,7 +136,7 @@ RRClient::RRClient () : } void RRClient::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -160,7 +160,7 @@ void RRClient::initialize () } void RRClient::run () - throw (RuntimeException) + noexcept(false) { a_timeController.activate (a_sender); @@ -168,7 +168,7 @@ void RRClient::run () } void MyCommunicator::eventReceiveMessage (ClientSocket&, const Message& message) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("MyCommunicator", "eventReceiveMessage", ANNA_FILE_LOCATION)); @@ -203,7 +203,7 @@ void MyCommunicator::eventReceiveMessage (ClientSocket&, const Message& message) } void MyCommunicator::eventBreakConnection (const Service* service) - throw () + { LOGMETHOD (TraceMethod tm ("MyCommunicator", "eventBreakConnection", ANNA_FILE_LOCATION)); @@ -232,7 +232,7 @@ void MyCommunicator::eventBreakConnection (const Service* service) } bool MyCommunicator::isOk (const test::Response& response) - throw () + { if (response.op != '+' && response.op != '-' && response.op != '*' && response.op != '/') return false; @@ -258,7 +258,7 @@ bool MyCommunicator::isOk (const test::Response& response) } bool Sender::tick () - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm (Logger::Local7, "Sender", "tick", ANNA_FILE_LOCATION)); diff --git a/example/comm/rrkClient/main.cpp b/example/comm/rrkClient/main.cpp index d87014f..3c0e0de 100644 --- a/example/comm/rrkClient/main.cpp +++ b/example/comm/rrkClient/main.cpp @@ -32,24 +32,24 @@ private: test::Response a_response; test::Request a_request; - void eventReceiveMessage (ClientSocket&, const Message&) throw (RuntimeException); - void eventUser (const char* id, const void* context) throw (); + void eventReceiveMessage (ClientSocket&, const Message&) noexcept(false); + void eventUser (const char* id, const void* context) ; }; class RRKClient : public anna::comm::Application { public: RRKClient (); - Service* getService () const throw () { return a_service; } - const test::Menu& getMenu () const throw () { return a_menu; } + Service* getService () const { return a_service; } + const test::Menu& getMenu () const { return a_menu; } private: MyCommunicator a_communicator; test::Menu a_menu; Service* a_service; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); }; using namespace std; @@ -88,7 +88,7 @@ RRKClient::RRKClient () : } void RRKClient::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -112,14 +112,14 @@ void RRKClient::initialize () } void RRKClient::run () - throw (RuntimeException) + noexcept(false) { a_menu.paint (); a_communicator.accept (); } void MyCommunicator::eventReceiveMessage (ClientSocket&, const Message& message) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm (Logger::Local7, "MyCommunicator", "eventReceiveMessage", ANNA_FILE_LOCATION)); @@ -138,7 +138,7 @@ void MyCommunicator::eventReceiveMessage (ClientSocket&, const Message& message) // notifica al comunicador mediante un evento de usuario. //----------------------------------------------------------------------------------------- void MyCommunicator::eventUser (const char* id, const void* context) - throw () + { LOGMETHOD (TraceMethod tm (Logger::Local7, "MyCommunicator", "eventUser", ANNA_FILE_LOCATION)); diff --git a/example/comm/server/main.cpp b/example/comm/server/main.cpp index d9c5a3b..ab29cf5 100644 --- a/example/comm/server/main.cpp +++ b/example/comm/server/main.cpp @@ -46,7 +46,7 @@ public: private: ThreadData a_contexts; - void eventReceiveMessage (comm::ClientSocket&, const Message&) throw (RuntimeException); + void eventReceiveMessage (comm::ClientSocket&, const Message&) noexcept(false); }; class ArithmeticServer : public comm::Application { @@ -57,9 +57,9 @@ private: MyCommunicator a_communicator; comm::ServerSocket* a_serverSocket; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); - xml::Node* asXML (xml::Node* app) const throw (); + void initialize () noexcept(false); + void run () noexcept(false); + xml::Node* asXML (xml::Node* app) const ; }; using namespace std; @@ -111,7 +111,7 @@ ArithmeticServer::ArithmeticServer () : // Inicializa el servidor de sockets. //----------------------------------------------------------------------------------------- void ArithmeticServer::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -127,7 +127,7 @@ void ArithmeticServer::initialize () // Cuando hay un nuevo mensaje invocar�a Communicator::eventReceiveMessage //----------------------------------------------------------------------------------------- void ArithmeticServer::run () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -146,7 +146,7 @@ void ArithmeticServer::run () } xml::Node* ArithmeticServer::asXML (xml::Node* app) const - throw () + { xml::Node* node = app::Application::asXML (app); @@ -164,7 +164,7 @@ xml::Node* ArithmeticServer::asXML (xml::Node* app) const // transport: Instancia del transporto que ha interpretado el mensaje (getMessage). //----------------------------------------------------------------------------------------- void MyCommunicator::eventReceiveMessage (ClientSocket& clientSocket, const Message& message) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("MyCommunicator", "eventReceiveMessage", ANNA_FILE_LOCATION)); diff --git a/example/core/genLogon/main.cpp b/example/core/genLogon/main.cpp index 8beb114..9649fb6 100644 --- a/example/core/genLogon/main.cpp +++ b/example/core/genLogon/main.cpp @@ -23,10 +23,10 @@ class Test : public app::Application { public: Test (); - void initialize () throw (RuntimeException); + void initialize () noexcept(false); private: - void run () throw (RuntimeException); + void run () noexcept(false); }; using namespace std; @@ -60,13 +60,13 @@ Test::Test () : } void Test::initialize () - throw (RuntimeException) + noexcept(false) { Encoder::initialize (); } void Test::run () - throw (RuntimeException) + noexcept(false) { CommandLine& commandLine (CommandLine::instantiate ()); diff --git a/example/core/recycler/main.cpp b/example/core/recycler/main.cpp index 0aeb7bf..bba9253 100644 --- a/example/core/recycler/main.cpp +++ b/example/core/recycler/main.cpp @@ -29,7 +29,7 @@ void print_const (const Recycler& numbers) } void debug (const char* str, Recycler::iterator ii) - throw () + { int* p = Recycler::data (ii); @@ -41,7 +41,7 @@ void debug (const char* str, Recycler::iterator ii) } void run (const bool randomAccess, const int freeCounter) - throw (RuntimeException) + noexcept(false) { Recycler numbers (randomAccess); int* p; @@ -92,7 +92,7 @@ void run (const bool randomAccess, const int freeCounter) } void recycling (const bool randomAccess, const int freeCounter) - throw (RuntimeException) + noexcept(false) { Recycler numbers (randomAccess); int** pp; @@ -118,7 +118,7 @@ void recycling (const bool randomAccess, const int freeCounter) } void reuse (const int freeCounter) - throw (RuntimeException) + noexcept(false) { int** pp; int* p; diff --git a/example/core/selectiveTracing/main.cpp b/example/core/selectiveTracing/main.cpp index 3203fa8..792fe50 100644 --- a/example/core/selectiveTracing/main.cpp +++ b/example/core/selectiveTracing/main.cpp @@ -28,7 +28,7 @@ void _exit(const std::string & msg) { exit(-1); } -void test(const std::string & value) throw() { +void test(const std::string & value) { LOGINFORMATION( std::string msg = "Starting test for "; msg += value; diff --git a/example/core/showLogon/main.cpp b/example/core/showLogon/main.cpp index 52f448c..da5aa84 100644 --- a/example/core/showLogon/main.cpp +++ b/example/core/showLogon/main.cpp @@ -23,10 +23,10 @@ class Test : public app::Application { public: Test (); - void initialize () throw (RuntimeException); + void initialize () noexcept(false); private: - void run () throw (RuntimeException); + void run () noexcept(false); }; using namespace std; @@ -58,14 +58,14 @@ Test::Test () : } void Test::initialize () - throw (RuntimeException) + noexcept(false) { Encoder::initialize (); xml::functions::initialize (); } void Test::run () - throw (RuntimeException) + noexcept(false) { CommandLine& commandLine (CommandLine::instantiate ()); diff --git a/example/core/sort/main.cpp b/example/core/sort/main.cpp index 5e7bcb0..f84b6f7 100644 --- a/example/core/sort/main.cpp +++ b/example/core/sort/main.cpp @@ -15,12 +15,12 @@ using namespace std; struct Accesor { - static int value (int* i) throw () { return *i; } - static int value (const int* i) throw () { return *i; } + static int value (int* i) { return *i; } + static int value (const int* i) { return *i; } }; void run () - throw (RuntimeException) + noexcept(false) { int values [] = { diff --git a/example/core/sortName/main.cpp b/example/core/sortName/main.cpp index 6b6cb85..5a40f97 100644 --- a/example/core/sortName/main.cpp +++ b/example/core/sortName/main.cpp @@ -18,14 +18,14 @@ class Object { public: Object (); - const std::string& getName () const throw () { return a_name; } + const std::string& getName () const { return a_name; } private: std::string a_name; }; struct SortByName { - static const std::string& value (const Object* oo) throw () { return oo->getName (); } + static const std::string& value (const Object* oo) { return oo->getName (); } }; string generate () @@ -49,7 +49,7 @@ Object::Object () } void run () - throw (RuntimeException) + noexcept(false) { typedef SortedVector container; typedef container::iterator iterator; diff --git a/example/core/thread/main.cpp b/example/core/thread/main.cpp index 2f454d4..596e9d5 100644 --- a/example/core/thread/main.cpp +++ b/example/core/thread/main.cpp @@ -30,31 +30,31 @@ private: const int a_id; const int a_value; - void run () throw (RuntimeException); + void run () noexcept(false); anna_complete_runnable (Client); }; class SOAP { public: - static int theMethod (const int id, const int value) throw (RuntimeException); + static int theMethod (const int id, const int value) noexcept(false); }; class Receiver; class Waiter { public: - int getId () const throw () { return a_id; } - int getValue () const throw () { return a_value; } + int getId () const { return a_id; } + int getValue () const { return a_value; } - void setId (const int id) throw () { a_id = id; } - void setValue (const int value) throw () { a_value = value; } + void setId (const int id) { a_id = id; } + void setValue (const int value) { a_value = value; } - void sendRequest () throw (RuntimeException); - int waitResponse () throw (RuntimeException); - void notifyResponse (const int result) throw (RuntimeException); + void sendRequest () noexcept(false); + int waitResponse () noexcept(false); + void notifyResponse (const int result) noexcept(false); - void initialize () throw (RuntimeException); + void initialize () noexcept(false); private: static const int ReadChannel = 0; @@ -71,13 +71,13 @@ private: class Context : public SafeRecycler { public: - Waiter* createWaiter (const int id, const int value) throw (RuntimeException); - void destroyWaiter (Waiter* waiter) throw (RuntimeException); - Waiter* findWaiter (const int id) throw () { return a_waiters.find (id); } + Waiter* createWaiter (const int id, const int value) noexcept(false); + void destroyWaiter (Waiter* waiter) noexcept(false); + Waiter* findWaiter (const int id) { return a_waiters.find (id); } private: struct SortByID { - static int value (const Waiter* waiter) throw () { return waiter->getId (); } + static int value (const Waiter* waiter) { return waiter->getId (); } }; typedef SortedVector waiter_container; @@ -93,7 +93,7 @@ private: int a_id; int a_value; - void run () throw (RuntimeException); + void run () noexcept(false); anna_complete_runnable (Waiter); }; @@ -163,7 +163,7 @@ int main (const int argc, const char** argv) // Esto simula el proceso cliente que envía la petición al proceso gSOAP /* Se ejecuta desde el thread Tx */ void Client::run () - throw (RuntimeException) + noexcept(false) { int result = SOAP::theMethod (a_id, a_value); @@ -179,7 +179,7 @@ void Client::run () // que será el que le dé la respuesta "real" en algún momento. /* Tx */ int SOAP::theMethod (const int id, const int value) - throw (RuntimeException) + noexcept(false) { int result = -1; @@ -205,7 +205,7 @@ int SOAP::theMethod (const int id, const int value) /* Tx */ void Waiter::initialize () - throw (RuntimeException) + noexcept(false) { if (pipe (a_pipe) == -1) { string msg (functions::asText ("Waiter::initialize | Id: ", a_id)); @@ -215,7 +215,7 @@ void Waiter::initialize () /* Tx */ void Waiter::sendRequest () - throw (RuntimeException) + noexcept(false) { try { /* Ojo que esto generará memory-leaks, pero no es el objeto de éste ejemplo la buena gestión de la memoria */ @@ -231,7 +231,7 @@ void Waiter::sendRequest () /* Tx */ int Waiter::waitResponse () - throw (RuntimeException) + noexcept(false) { bool receive = io::functions::waitInput (a_pipe [ReadChannel], (Millisecond)500); @@ -248,7 +248,7 @@ int Waiter::waitResponse () /* Ty */ void Waiter::notifyResponse (const int result) - throw (RuntimeException) + noexcept(false) { int byte = 0; @@ -261,7 +261,7 @@ void Waiter::notifyResponse (const int result) // que debería haber un Waiter esperando. /* Ty */ void Receiver::run () - throw (RuntimeException) + noexcept(false) { anna::functions::sleep ((Millisecond)(rand () % 1000)); @@ -282,7 +282,7 @@ void Receiver::run () } Waiter* Context::createWaiter (const int id, const int value) - throw (RuntimeException) + noexcept(false) { Guard guard (*this, "Context::createWaiter"); @@ -302,7 +302,7 @@ Waiter* Context::createWaiter (const int id, const int value) } void Context::destroyWaiter (Waiter* waiter) - throw (RuntimeException) + noexcept(false) { Guard guard (this, "Context::destroyWaiter"); diff --git a/example/core/threadManager/main.cpp b/example/core/threadManager/main.cpp index 3abe87b..c41c356 100644 --- a/example/core/threadManager/main.cpp +++ b/example/core/threadManager/main.cpp @@ -24,9 +24,9 @@ public: MyRunnable () : Runnable () {;} private: - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); - void terminate () throw (); + void initialize () noexcept(false); + void run () noexcept(false); + void terminate () ; anna_complete_runnable (MyRunnable); }; @@ -78,7 +78,7 @@ int main (const int argc, const char** argv) } void MyRunnable::initialize () - throw (RuntimeException) + noexcept(false) { LOGDEBUG ( string msg (asString ()); @@ -88,7 +88,7 @@ void MyRunnable::initialize () } void MyRunnable::run () - throw (RuntimeException) + noexcept(false) { const int delay = rand () % 2000; @@ -103,7 +103,7 @@ void MyRunnable::run () } void MyRunnable::terminate () - throw () + { LOGDEBUG ( string msg (asString ()); diff --git a/example/core/trace/main.cpp b/example/core/trace/main.cpp index 9b66508..83b7970 100644 --- a/example/core/trace/main.cpp +++ b/example/core/trace/main.cpp @@ -18,10 +18,10 @@ class Test : public app::Application { public: Test (); - void initialize () throw (RuntimeException); + void initialize () noexcept(false); private: - void run () throw (RuntimeException); + void run () noexcept(false); }; using namespace std; @@ -60,7 +60,7 @@ Test::Test () : } void Test::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& commandLine (CommandLine::instantiate ()); @@ -69,7 +69,7 @@ void Test::initialize () } void Test::run () - throw (RuntimeException) + noexcept(false) { CommandLine& commandLine (CommandLine::instantiate ()); diff --git a/example/dbms.mysql/xInsert/main.cpp b/example/dbms.mysql/xInsert/main.cpp index d52b9a1..61d1d49 100644 --- a/example/dbms.mysql/xInsert/main.cpp +++ b/example/dbms.mysql/xInsert/main.cpp @@ -23,8 +23,8 @@ public: private: anna::dbms::Database* a_db; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); }; using namespace std; @@ -68,7 +68,7 @@ Insert::Insert () : * correspondiente y anna.dbms.mysql lo hace autom�ticamente. */ void Insert::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& ccll = CommandLine::instantiate (); const char* host = ccll.exists ("host") ? ccll.getValue ("host"): NULL; @@ -78,7 +78,7 @@ void Insert::initialize () } void Insert::run () - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("Insert", "run", ANNA_FILE_LOCATION)); diff --git a/example/dbms.mysql/xSelect/main.cpp b/example/dbms.mysql/xSelect/main.cpp index 6f7fdcc..32b23ac 100644 --- a/example/dbms.mysql/xSelect/main.cpp +++ b/example/dbms.mysql/xSelect/main.cpp @@ -23,8 +23,8 @@ public: private: anna::dbms::Database* a_db; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); }; using namespace std; @@ -68,7 +68,7 @@ Select::Select () : * correspondiente y anna.dbms.mysql lo hace autom�ticamente. */ void Select::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& ccll = CommandLine::instantiate (); const char* host = ccll.exists ("host") ? ccll.getValue ("host"): NULL; @@ -78,7 +78,7 @@ void Select::initialize () } void Select::run () - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("Select", "run", ANNA_FILE_LOCATION)); diff --git a/example/dbos/workdir/filesystem/Abstract.cpp b/example/dbos/workdir/filesystem/Abstract.cpp index f304470..296d0fb 100644 --- a/example/dbos/workdir/filesystem/Abstract.cpp +++ b/example/dbos/workdir/filesystem/Abstract.cpp @@ -39,7 +39,7 @@ filesystem::Abstract::~Abstract () /* static */ string filesystem::Abstract::calculePath (const filesystem::Abstract* parent, const std::string& shortPath) - throw () + { string result; diff --git a/example/dbos/workdir/filesystem/Abstract.hpp b/example/dbos/workdir/filesystem/Abstract.hpp index de28336..ec68ab1 100644 --- a/example/dbos/workdir/filesystem/Abstract.hpp +++ b/example/dbos/workdir/filesystem/Abstract.hpp @@ -30,24 +30,24 @@ public: virtual ~Abstract (); - Abstract* getParent () const throw () { return a_parent; } - ClassType::_v getClassType () const throw () { return a_classType; } - const std::string& getName () const throw () { return a_name; } - const std::string& getPath () const throw () { return a_path; } + Abstract* getParent () const { return a_parent; } + ClassType::_v getClassType () const { return a_classType; } + const std::string& getName () const { return a_name; } + const std::string& getPath () const { return a_path; } - int child_size () const throw () { return a_children.size (); } + int child_size () const { return a_children.size (); } - child_iterator child_begin () throw () { return a_children.begin (); } - child_iterator child_end () throw () { return a_children.end (); } - static Abstract* child (child_iterator ii) throw () { return *ii; } + child_iterator child_begin () { return a_children.begin (); } + child_iterator child_end () { return a_children.end (); } + static Abstract* child (child_iterator ii) { return *ii; } - const_child_iterator child_begin () const throw () { return a_children.begin (); } - const_child_iterator child_end () const throw () { return a_children.end (); } - static const Abstract* child (const_child_iterator ii) throw () { return *ii; } + const_child_iterator child_begin () const { return a_children.begin (); } + const_child_iterator child_end () const { return a_children.end (); } + static const Abstract* child (const_child_iterator ii) { return *ii; } - static std::string calculePath (const Abstract* parent, const std::string& shortPath) throw (); + static std::string calculePath (const Abstract* parent, const std::string& shortPath) ; - virtual void print (const int level) const throw () = 0; + virtual void print (const int level) const = 0; protected: Abstract (const ClassType::_v, const std::string& name); diff --git a/example/dbos/workdir/filesystem/Directory.cpp b/example/dbos/workdir/filesystem/Directory.cpp index e22c859..976964c 100644 --- a/example/dbos/workdir/filesystem/Directory.cpp +++ b/example/dbos/workdir/filesystem/Directory.cpp @@ -16,7 +16,7 @@ using namespace anna; using namespace workdir; void filesystem::Directory::print (const int level) const - throw () + { filesystem::Directory::const_child_iterator ii; filesystem::Directory::const_child_iterator maxii = child_end (); diff --git a/example/dbos/workdir/filesystem/Directory.hpp b/example/dbos/workdir/filesystem/Directory.hpp index 95490d7..67faedd 100644 --- a/example/dbos/workdir/filesystem/Directory.hpp +++ b/example/dbos/workdir/filesystem/Directory.hpp @@ -22,12 +22,12 @@ public: Directory (const std::string& name) : Abstract (ClassType::Directory, name) {;} Directory (Directory* parent, const std::string& name) : Abstract (ClassType::Directory, parent, name) {;} - void print (const int level = 0) const throw (); + void print (const int level = 0) const ; - static Directory* down_cast (Abstract* abstract) throw () { + static Directory* down_cast (Abstract* abstract) { return (abstract->getClassType () == ClassType::Directory) ? static_cast (abstract): NULL; } - static const Directory* down_cast (const Abstract* abstract) throw () { + static const Directory* down_cast (const Abstract* abstract) { return (abstract->getClassType () == ClassType::Directory) ? static_cast (abstract): NULL; } }; diff --git a/example/dbos/workdir/filesystem/File.cpp b/example/dbos/workdir/filesystem/File.cpp index 888f46a..1a6fae1 100644 --- a/example/dbos/workdir/filesystem/File.cpp +++ b/example/dbos/workdir/filesystem/File.cpp @@ -15,7 +15,7 @@ using namespace anna; using namespace workdir; void filesystem::File::print (const int) const - throw () + { cout << getName () << " " << flush; } diff --git a/example/dbos/workdir/filesystem/File.hpp b/example/dbos/workdir/filesystem/File.hpp index f3da2df..7e6decc 100644 --- a/example/dbos/workdir/filesystem/File.hpp +++ b/example/dbos/workdir/filesystem/File.hpp @@ -22,12 +22,12 @@ class File : public Abstract { public: File (Directory* parent, const std::string& name) : Abstract (ClassType::File, parent, name) {;} - void print (const int level) const throw (); + void print (const int level) const ; - static File* down_cast (Abstract* abstract) throw () { + static File* down_cast (Abstract* abstract) { return (abstract->getClassType () == ClassType::File) ? static_cast (abstract): NULL; } - static const File* down_cast (const Abstract* abstract) throw () { + static const File* down_cast (const Abstract* abstract) { return (abstract->getClassType () == ClassType::File) ? static_cast (abstract): NULL; } }; diff --git a/example/dbos/workdir/main.cpp b/example/dbos/workdir/main.cpp index 3b9c99f..fa3dbd8 100644 --- a/example/dbos/workdir/main.cpp +++ b/example/dbos/workdir/main.cpp @@ -29,7 +29,7 @@ using namespace std; using namespace workdir; -template void message (const char* text, T* tt) throw () { +template void message (const char* text, T* tt) { if (Logger::isActive (Logger::Debug) == false) return; @@ -51,7 +51,7 @@ public: WorkDirectory (); - xml::Node* asXML (xml::Node* parent) const throw (); + xml::Node* asXML (xml::Node* parent) const ; private: typedef vector file_container; @@ -62,17 +62,17 @@ private: filesystem::Directory* a_root; file_container a_files; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); - void forward (filesystem::Directory*) throw (RuntimeException); - void instantiateOne (filesystem::Directory*) throw (RuntimeException); - void fullCache (filesystem::Directory*, file_container&, const int flags) throw (RuntimeException); - void reuseHoles (filesystem::Directory*, file_container&) throw (RuntimeException); - void destroyObjects (filesystem::Directory* dir, file_container&) throw (RuntimeException); - void clear (file_container&) throw (); + void forward (filesystem::Directory*) noexcept(false); + void instantiateOne (filesystem::Directory*) noexcept(false); + void fullCache (filesystem::Directory*, file_container&, const int flags) noexcept(false); + void reuseHoles (filesystem::Directory*, file_container&) noexcept(false); + void destroyObjects (filesystem::Directory* dir, file_container&) noexcept(false); + void clear (file_container&) ; - static void load (filesystem::Directory* parent, const int maxLevel, const int level = 0) throw (RuntimeException); + static void load (filesystem::Directory* parent, const int maxLevel, const int level = 0) noexcept(false); }; using namespace std; @@ -111,12 +111,12 @@ WorkDirectory::WorkDirectory () : } void WorkDirectory::initialize () - throw (RuntimeException) + noexcept(false) { } void WorkDirectory::run () - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("WorkDirectory", "run", ANNA_FILE_LOCATION)); @@ -146,7 +146,7 @@ void WorkDirectory::run () } xml::Node* WorkDirectory::asXML (xml::Node* parent) const - throw () + { xml::Node* result = app::Application::asXML (parent); a_repository.asXML (result); @@ -154,7 +154,7 @@ xml::Node* WorkDirectory::asXML (xml::Node* parent) const } void WorkDirectory::forward (filesystem::Directory* dir) - throw (RuntimeException) + noexcept(false) { cout << "forward: " << dir->getPath () << endl; @@ -182,7 +182,7 @@ void WorkDirectory::forward (filesystem::Directory* dir) * de verdad sea necesario. */ void WorkDirectory::instantiateOne (filesystem::Directory* dir) - throw (RuntimeException) + noexcept(false) { TraceMethod tm ("WorkDirectory", "instantiateOne", ANNA_FILE_LOCATION); @@ -210,7 +210,7 @@ void WorkDirectory::instantiateOne (filesystem::Directory* dir) } void WorkDirectory::fullCache (filesystem::Directory* dir, WorkDirectory::file_container& files, const int flags) - throw (RuntimeException) + noexcept(false) { TraceMethod tm ("WorkDirectory", "fullCache", ANNA_FILE_LOCATION); @@ -246,7 +246,7 @@ void WorkDirectory::fullCache (filesystem::Directory* dir, WorkDirectory::file_c } void WorkDirectory::reuseHoles (filesystem::Directory* dir, WorkDirectory::file_container& files) - throw (RuntimeException) + noexcept(false) { TraceMethod tm ("WorkDirectory", "reuseHoles", ANNA_FILE_LOCATION); @@ -257,7 +257,7 @@ void WorkDirectory::reuseHoles (filesystem::Directory* dir, WorkDirectory::file_ } void WorkDirectory::destroyObjects (filesystem::Directory* dir, WorkDirectory::file_container& files) - throw (RuntimeException) + noexcept(false) { TraceMethod tm ("WorkDirectory", "destroyObjects", ANNA_FILE_LOCATION); @@ -293,7 +293,7 @@ void WorkDirectory::destroyObjects (filesystem::Directory* dir, WorkDirectory::f void WorkDirectory::clear (WorkDirectory::file_container& files) - throw () + { storage::File* file; @@ -319,7 +319,7 @@ void WorkDirectory::clear (WorkDirectory::file_container& files) /*static*/ void WorkDirectory::load (filesystem::Directory* parent, const int maxLevel, const int level) - throw (RuntimeException) + noexcept(false) { if (level == maxLevel) return; diff --git a/example/dbos/workdir/storage/Directory.cpp b/example/dbos/workdir/storage/Directory.cpp index 7c35dc6..46ce59c 100644 --- a/example/dbos/workdir/storage/Directory.cpp +++ b/example/dbos/workdir/storage/Directory.cpp @@ -36,7 +36,7 @@ int storage::Directory::st_maxSize = 0; dbos_prepare_object (storage::Directory); void storage::Directory::setup (dbos::Repository& repository, const int maxSize) - throw (RuntimeException) + noexcept(false) { st_loader = new Directory::Loader (); st_maxSize = maxSize; @@ -50,7 +50,7 @@ void storage::Directory::setup (dbos::Repository& repository, const int maxSize) } storage::Directory* storage::Directory::instantiate (const filesystem::Directory* directory) - throw (RuntimeException) + noexcept(false) { if (st_loader == NULL) throw RuntimeException ("storage::Directory::setup no ha sido invocado", ANNA_FILE_LOCATION); @@ -69,13 +69,13 @@ storage::Directory* storage::Directory::instantiate (const filesystem::Directory } void storage::Directory::initialize (dbos::Loader& loader) - throw (RuntimeException, dbms::DatabaseException) + noexcept(false) { Directory::Loader& dbLoader = static_cast (loader); - + a_filesystemDirectory = dbLoader.getDirectory (); a_inode = dbLoader.getINode (); - + LOGINFORMATION ( string msg ("storage::Directory::initialize | "); msg += asString (); @@ -84,7 +84,7 @@ void storage::Directory::initialize (dbos::Loader& loader) } void storage::Directory::destroy () - throw () + { LOGINFORMATION ( string msg ("storage::Directory::destroy | "); @@ -94,7 +94,7 @@ void storage::Directory::destroy () } string storage::Directory::asString () const - throw () + { std::string result ("storage::Directory { Name: "); result += a_filesystemDirectory->getPath (); @@ -102,25 +102,25 @@ string storage::Directory::asString () const return result += " }"; } -/* +/* * Transfiere la información del medio físico al primer nivel de C++. * Posteriormente será interpretada en storage::Directory::initialize */ -bool storage::Directory::Loader::load (dbms::Connection*, const dbos::StorageArea* ssaa) - throw (RuntimeException) +bool storage::Directory::Loader::load (dbms::Connection*, const dbos::StorageArea* ssaa) + noexcept(false) { a_inode = io::functions::getINode (a_filesystemDirectory->getPath ()); return true; } -dbos::Index storage::Directory::Loader::getIndex () const - throw () +dbos::Index storage::Directory::Loader::getIndex () const + { - return st_hash.calcule (a_filesystemDirectory->getPath ()); + return st_hash.calcule (a_filesystemDirectory->getPath ()); } string storage::Directory::Loader::asString () const - throw () + { std::string result ("storage::Loader::Directory { Name: "); result += a_filesystemDirectory->getPath (); diff --git a/example/dbos/workdir/storage/Directory.hpp b/example/dbos/workdir/storage/Directory.hpp index 3bffdf3..8b04b23 100644 --- a/example/dbos/workdir/storage/Directory.hpp +++ b/example/dbos/workdir/storage/Directory.hpp @@ -35,40 +35,40 @@ using namespace anna; class Directory : public dbos::Object, public dbos::ObjectFacade { public: - const filesystem::Directory* getFilesystemDirectory() const throw() { return a_filesystemDirectory; } - int getINode() const throw() { return a_inode; } + const filesystem::Directory* getFilesystemDirectory() const { return a_filesystemDirectory; } + int getINode() const { return a_inode; } - std::string asString() const throw(); + std::string asString() const ; - static void setup(dbos::Repository&, const int maxSize) throw(RuntimeException); - static Directory* instantiate(const filesystem::Directory*) throw(RuntimeException); + static void setup(dbos::Repository&, const int maxSize) noexcept(false); + static Directory* instantiate(const filesystem::Directory*) noexcept(false); - static const char* getStorageAreaName() throw() { return "storage::Directory"; } - static const dbos::Size getMaxSize() throw() { return st_maxSize; } + static const char* getStorageAreaName() { return "storage::Directory"; } + static const dbos::Size getMaxSize() { return st_maxSize; } private: class Loader : public dbos::Loader { public: Loader() : dbos::Loader() {;} - Loader& setKey(const filesystem::Directory* directory) throw() { + Loader& setKey(const filesystem::Directory* directory) { a_filesystemDirectory = directory; return *this; } - const filesystem::Directory* getDirectory() const throw() { return a_filesystemDirectory; } - int getINode() const throw() { return a_inode; } + const filesystem::Directory* getDirectory() const { return a_filesystemDirectory; } + int getINode() const { return a_inode; } - dbos::Index getIndex() const throw(); - std::string asString() const throw(); + dbos::Index getIndex() const ; + std::string asString() const ; private: const filesystem::Directory* a_filesystemDirectory; int a_inode; // dbms::Statement is not required - dbms::Statement* initialize(dbms::Database&) throw(RuntimeException) { return NULL; } - bool load(dbms::Connection*, const dbos::StorageArea*) throw(RuntimeException); + dbms::Statement* initialize(dbms::Database&) noexcept(false) { return NULL; } + bool load(dbms::Connection*, const dbos::StorageArea*) noexcept(false); }; const filesystem::Directory* a_filesystemDirectory; @@ -81,8 +81,8 @@ private: Directory() { ; } Directory(const Directory&); - void initialize(dbos::Loader& loader) throw(RuntimeException, dbms::DatabaseException); - void destroy() throw(); + void initialize(dbos::Loader& loader) noexcept(false); + void destroy() ; dbos_declare_object(Directory); }; diff --git a/example/dbos/workdir/storage/File.cpp b/example/dbos/workdir/storage/File.cpp index 6a23430..a9357de 100644 --- a/example/dbos/workdir/storage/File.cpp +++ b/example/dbos/workdir/storage/File.cpp @@ -38,7 +38,7 @@ int storage::File::st_maxSize = 0; dbos_prepare_object (storage::File); void storage::File::setup (dbos::Repository& repository, const int maxSize) - throw (RuntimeException) + noexcept(false) { st_loader = new File::Loader (); st_maxSize = maxSize; @@ -52,7 +52,7 @@ void storage::File::setup (dbos::Repository& repository, const int maxSize) } storage::File* storage::File::instantiate (const filesystem::File* file) - throw (RuntimeException) + noexcept(false) { if (st_loader == NULL) throw RuntimeException ("storage::File::setup no ha sido invocado", ANNA_FILE_LOCATION); @@ -71,14 +71,14 @@ storage::File* storage::File::instantiate (const filesystem::File* file) } void storage::File::initialize (dbos::Loader& loader) - throw (RuntimeException, dbms::DatabaseException) + noexcept(false) { File::Loader& dbLoader = static_cast (loader); - + a_filesystemFile = dbLoader.getFile (); a_parent = Directory::instantiate (filesystem::Directory::down_cast (a_filesystemFile->getParent ())); a_inode = dbLoader.getINode (); - + LOGINFORMATION ( string msg ("storage::File::initialize | "); msg += asString (); @@ -87,18 +87,18 @@ void storage::File::initialize (dbos::Loader& loader) } void storage::File::destroy () - throw () -{ + +{ LOGINFORMATION ( string msg ("storage::File::destroy | "); msg += asString (); Logger::information (msg, ANNA_FILE_LOCATION); ); - Directory::release (a_parent); + Directory::release (a_parent); } string storage::File::asString () const - throw () + { std::string result ("storage::File { Name: "); result += a_filesystemFile->getPath (); @@ -106,25 +106,25 @@ string storage::File::asString () const return result += " }"; } -/* +/* * Transfiere la información del medio físico al primer nivel de C++. * Posteriormente será interpretada en storage::File::initialize */ -bool storage::File::Loader::load (dbms::Connection*, const dbos::StorageArea* ssaa) - throw (RuntimeException) +bool storage::File::Loader::load (dbms::Connection*, const dbos::StorageArea* ssaa) + noexcept(false) { a_inode = io::functions::getINode (a_filesystemFile->getPath ()); return true; } -dbos::Index storage::File::Loader::getIndex () const - throw () +dbos::Index storage::File::Loader::getIndex () const + { - return st_hash.calcule (a_filesystemFile->getPath ()); + return st_hash.calcule (a_filesystemFile->getPath ()); } string storage::File::Loader::asString () const - throw () + { std::string result ("storage::Loader::File { Name: "); result += a_filesystemFile->getPath (); diff --git a/example/dbos/workdir/storage/File.hpp b/example/dbos/workdir/storage/File.hpp index 51d4293..412e06c 100644 --- a/example/dbos/workdir/storage/File.hpp +++ b/example/dbos/workdir/storage/File.hpp @@ -37,41 +37,41 @@ using namespace anna; class File : public dbos::Object, public dbos::ObjectFacade { public: - const Directory* getParent() const throw() { return a_parent; } - const filesystem::File* getFilesystemFile() const throw() { return a_filesystemFile; } - int getINode() const throw() { return a_inode; } + const Directory* getParent() const { return a_parent; } + const filesystem::File* getFilesystemFile() const { return a_filesystemFile; } + int getINode() const { return a_inode; } - std::string asString() const throw(); + std::string asString() const ; - static void setup(dbos::Repository&, const int maxSize) throw(RuntimeException); - static File* instantiate(const filesystem::File*) throw(RuntimeException); + static void setup(dbos::Repository&, const int maxSize) noexcept(false); + static File* instantiate(const filesystem::File*) noexcept(false); - static const char* getStorageAreaName() throw() { return "storage::File"; } - static const dbos::Size getMaxSize() throw() { return st_maxSize; } + static const char* getStorageAreaName() { return "storage::File"; } + static const dbos::Size getMaxSize() { return st_maxSize; } private: class Loader : public dbos::Loader { public: Loader() : dbos::Loader() {;} - Loader& setKey(const filesystem::File* file) throw() { + Loader& setKey(const filesystem::File* file) { a_filesystemFile = file; return *this; } - const filesystem::File* getFile() const throw() { return a_filesystemFile; } - int getINode() const throw() { return a_inode; } + const filesystem::File* getFile() const { return a_filesystemFile; } + int getINode() const { return a_inode; } - dbos::Index getIndex() const throw(); - std::string asString() const throw(); + dbos::Index getIndex() const ; + std::string asString() const ; private: const filesystem::File* a_filesystemFile; int a_inode; // dbms::Statement is not required - dbms::Statement* initialize(dbms::Database&) throw(RuntimeException) { return NULL; } - bool load(dbms::Connection*, const dbos::StorageArea*) throw(RuntimeException); + dbms::Statement* initialize(dbms::Database&) noexcept(false) { return NULL; } + bool load(dbms::Connection*, const dbos::StorageArea*) noexcept(false); }; Directory* a_parent; @@ -85,8 +85,8 @@ private: File() : a_parent(NULL) { ; } File(const File&); - void initialize(dbos::Loader& loader) throw(RuntimeException, dbms::DatabaseException); - void destroy() throw(); + void initialize(dbos::Loader& loader) noexcept(false); + void destroy() ; dbos_declare_object(File); }; diff --git a/example/diameter/batchConverter/main.cpp b/example/diameter/batchConverter/main.cpp index 7a7a2f4..9009b61 100644 --- a/example/diameter/batchConverter/main.cpp +++ b/example/diameter/batchConverter/main.cpp @@ -25,7 +25,7 @@ #include #include #include -//#include // ApplicationId anna::diameter::codec::functions::getApplicationId(const anna::DataBlock &) throw(anna::RuntimeException); +//#include // ApplicationId anna::diameter::codec::functions::getApplicationId(const anna::DataBlock &) noexcept(false); using namespace anna; @@ -33,7 +33,7 @@ using namespace anna::diameter; anna::diameter::codec::Message G_codecMsg; -bool getDataBlockFromHexFile(const std::string &pathfile, anna::DataBlock &db) throw() { +bool getDataBlockFromHexFile(const std::string &pathfile, anna::DataBlock &db) { // Get hex string static char buffer[8192]; std::ifstream infile(pathfile.c_str(), std::ifstream::in); @@ -68,7 +68,7 @@ void _exit(const std::string &message, int resultCode = 1) { } // Decodes a diameter message coming from a datablock -bool decodeDataBlock(const anna::DataBlock &db/*, unsigned int & detectedApplicationId*/) throw() { +bool decodeDataBlock(const anna::DataBlock &db/*, unsigned int & detectedApplicationId*/) { try { G_codecMsg.clear(); G_codecMsg.decode(db); diff --git a/example/diameter/launcher/Launcher.cpp b/example/diameter/launcher/Launcher.cpp index 30637be..d3a9373 100644 --- a/example/diameter/launcher/Launcher.cpp +++ b/example/diameter/launcher/Launcher.cpp @@ -150,16 +150,16 @@ Launcher::Launcher() : anna::comm::Application("launcher", "DiameterLauncher", " } -std::string Launcher::getSignalUSR2InputFile() const throw() { +std::string Launcher::getSignalUSR2InputFile() const { return (getInitialWorkingDirectory() + "/" + SIGUSR2_TASKS_INPUT_FILENAME); } -std::string Launcher::getSignalUSR2OutputFile() const throw() { +std::string Launcher::getSignalUSR2OutputFile() const { return (getInitialWorkingDirectory() + "/" + SIGUSR2_TASKS_OUTPUT_FILENAME); } -void Launcher::servicesFromXML(const anna::xml::Node* servicesNode, bool bindResources) throw(anna::RuntimeException) { +void Launcher::servicesFromXML(const anna::xml::Node* servicesNode, bool bindResources) noexcept(false) { CommandLine& cl(anna::CommandLine::instantiate()); bool allLogsDisabled = cl.exists("disableLogs"); @@ -437,7 +437,7 @@ void Launcher::servicesFromXML(const anna::xml::Node* servicesNode, bool bindRes } -void Launcher::loadServicesFromFile(const std::string & xmlPathFile, bool bindResources) throw(anna::RuntimeException) { +void Launcher::loadServicesFromFile(const std::string & xmlPathFile, bool bindResources) noexcept(false) { if (xmlPathFile == "null" || xmlPathFile == "") { LOGWARNING(anna::Logger::warning("Ignoring services configuration on start: empty or 'null' string provided as xml file. Use management interface (operation 'services') in order to add services", ANNA_FILE_LOCATION)); @@ -478,7 +478,7 @@ void Launcher::loadServicesFromFile(const std::string & xmlPathFile, bool bindRe } -void Launcher::loadServicesFromXMLString(const std::string & xmlString, bool bindResources) throw(anna::RuntimeException) { +void Launcher::loadServicesFromXMLString(const std::string & xmlString, bool bindResources) noexcept(false) { anna::xml::DocumentMemory xmlDocument; // has private copy constructor defined but not implemented to avoid inhenrit/copy (is very heavy) anna::xml::DTDMemory xmlDTD; @@ -506,7 +506,7 @@ void Launcher::loadServicesFromXMLString(const std::string & xmlString, bool bin } -anna::Millisecond Launcher::checkTimeMeasure(const std::string ¶meter, const std::string &value) throw(anna::RuntimeException) { +anna::Millisecond Launcher::checkTimeMeasure(const std::string ¶meter, const std::string &value) noexcept(false) { if(anna::functions::isLike("^[0-9]+$", value)) { // para incluir numeros decimales: ^[0-9]+(.[0-9]+)?$ int msecs; @@ -547,7 +547,7 @@ anna::Millisecond Launcher::checkTimeMeasure(const std::string ¶meter, const throw RuntimeException(msg, ANNA_FILE_LOCATION); } -bool Launcher::setWorkingNode(const std::string &name) throw() { +bool Launcher::setWorkingNode(const std::string &name) { bool result = false; anna::diameter::comm::OriginHostManager &ohm = anna::diameter::comm::OriginHostManager::instantiate(); @@ -561,7 +561,7 @@ bool Launcher::setWorkingNode(const std::string &name) throw() { return result; } -anna::diameter::comm::OriginHost *Launcher::getOriginHost(const std::string &name) const throw(anna::RuntimeException) { +anna::diameter::comm::OriginHost *Launcher::getOriginHost(const std::string &name) const noexcept(false) { anna::diameter::comm::OriginHostManager &ohm = anna::diameter::comm::OriginHostManager::instantiate(); anna::diameter::comm::OriginHost *result = ohm.getOriginHost(name); @@ -571,39 +571,39 @@ anna::diameter::comm::OriginHost *Launcher::getOriginHost(const std::string &nam return result; } -anna::diameter::comm::OriginHost *Launcher::getOriginHost(const anna::diameter::codec::Message &message) const throw(anna::RuntimeException) { +anna::diameter::comm::OriginHost *Launcher::getOriginHost(const anna::diameter::codec::Message &message) const noexcept(false) { std::string originHost = message.getAvp(anna::diameter::helpers::base::AVPID__Origin_Host)->getDiameterIdentity()->getValue(); return (getOriginHost(originHost)); } -anna::diameter::comm::OriginHost *Launcher::getOriginHost(const anna::DataBlock &messageDataBlock) const throw(anna::RuntimeException) { +anna::diameter::comm::OriginHost *Launcher::getOriginHost(const anna::DataBlock &messageDataBlock) const noexcept(false) { std::string originHost = anna::diameter::helpers::base::functions::getOriginHost(messageDataBlock); return (getOriginHost(originHost)); } -bool Launcher::uniqueOriginHost() const throw() { +bool Launcher::uniqueOriginHost() const { anna::diameter::comm::OriginHostManager &ohm = anna::diameter::comm::OriginHostManager::instantiate(); return (ohm.size() == 1); } -void Launcher::updateOperatedOriginHostWithMessage(const anna::diameter::codec::Message &message) throw(anna::RuntimeException) { +void Launcher::updateOperatedOriginHostWithMessage(const anna::diameter::codec::Message &message) noexcept(false) { if (!a_operatedHost) // priority for working node by mean 'node' operation a_operatedHost = getOriginHost(message); } -void Launcher::updateOperatedOriginHostWithMessage(const anna::DataBlock &messageDataBlock) throw(anna::RuntimeException) { +void Launcher::updateOperatedOriginHostWithMessage(const anna::DataBlock &messageDataBlock) noexcept(false) { if (!a_operatedHost) // priority for working node by mean 'node' operation a_operatedHost = getOriginHost(messageDataBlock); } -anna::diameter::comm::OriginHost *Launcher::getWorkingNode() const throw(anna::RuntimeException) { +anna::diameter::comm::OriginHost *Launcher::getWorkingNode() const noexcept(false) { if(!a_workingNode) throw anna::RuntimeException("Working node not identified (try to load services)", ANNA_FILE_LOCATION); return a_workingNode; } -anna::diameter::comm::OriginHost *Launcher::getOperatedHost() const throw(anna::RuntimeException) { +anna::diameter::comm::OriginHost *Launcher::getOperatedHost() const noexcept(false) { if(!a_operatedHost) throw anna::RuntimeException("Node not identified (try to force a specific Origin-Host with 'node' operation)", ANNA_FILE_LOCATION); @@ -614,26 +614,26 @@ void Launcher::setOperatedHost(anna::diameter::comm::OriginHost *op) { a_operatedHost = op; } -MyDiameterEntity *Launcher::getOperatedEntity() const throw(anna::RuntimeException) { +MyDiameterEntity *Launcher::getOperatedEntity() const noexcept(false) { MyDiameterEntity *result = (MyDiameterEntity *)(getOperatedHost()->getEntity()); if (!result) throw anna::RuntimeException("No entity configured for the operated node", ANNA_FILE_LOCATION); return result; } -MyLocalServer *Launcher::getOperatedServer() const throw(anna::RuntimeException) { +MyLocalServer *Launcher::getOperatedServer() const noexcept(false) { MyLocalServer *result = (MyLocalServer *)(getOperatedHost()->getDiameterServer()); if (!result) throw anna::RuntimeException("No local server configured for the operated node", ANNA_FILE_LOCATION); return result; } -MyDiameterEngine *Launcher::getOperatedEngine() const throw(anna::RuntimeException) { +MyDiameterEngine *Launcher::getOperatedEngine() const noexcept(false) { return (MyDiameterEngine *)getOperatedHost()->getCommEngine(); // never will be NULL } void Launcher::initialize() -throw(anna::RuntimeException) { +noexcept(false) { anna::comm::Application::initialize(); CommandLine& cl(anna::CommandLine::instantiate()); anna::comm::Communicator::WorkMode::_v workMode(anna::comm::Communicator::WorkMode::Single); @@ -672,7 +672,7 @@ throw(anna::RuntimeException) { } void Launcher::run() -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("Launcher", "run", ANNA_FILE_LOCATION)); CommandLine& cl(anna::CommandLine::instantiate()); anna::diameter::stack::Engine::instantiate(); @@ -854,7 +854,7 @@ throw(anna::RuntimeException) { a_communicator->accept(); } -bool Launcher::getDataBlockFromHexFile(const std::string &pathfile, anna::DataBlock &db) const throw(anna::RuntimeException) { +bool Launcher::getDataBlockFromHexFile(const std::string &pathfile, anna::DataBlock &db) const noexcept(false) { // Get hex string static char buffer[8192]; std::ifstream infile(pathfile.c_str(), std::ifstream::in); @@ -879,7 +879,7 @@ bool Launcher::getDataBlockFromHexFile(const std::string &pathfile, anna::DataBl return false; } -void Launcher::resetStatistics() throw() { +void Launcher::resetStatistics() { if (a_workingNode) { a_workingNode->getCommEngine()->resetStatistics(); } @@ -891,13 +891,13 @@ void Launcher::resetStatistics() throw() { } } -void Launcher::resetCounters() throw() { +void Launcher::resetCounters() { anna::diameter::comm::OamModule::instantiate().resetCounters(); anna::diameter::comm::ApplicationMessageOamModule::instantiate().resetCounters(); anna::diameter::codec::OamModule::instantiate().resetCounters(); } -void Launcher::signalTerminate() throw(anna::RuntimeException) { +void Launcher::signalTerminate() noexcept(false) { LOGMETHOD(anna::TraceMethod tm("Launcher", "signalTerminate", ANNA_FILE_LOCATION)); forceCountersRecord(); @@ -906,7 +906,7 @@ void Launcher::signalTerminate() throw(anna::RuntimeException) { comm::Application::signalTerminate (); } -void Launcher::signalUSR2() throw(anna::RuntimeException) { +void Launcher::signalUSR2() noexcept(false) { std::string inputFile = getSignalUSR2InputFile(); std::string outputFile = getSignalUSR2OutputFile(); @@ -956,7 +956,7 @@ void Launcher::signalUSR2() throw(anna::RuntimeException) { } -void Launcher::logStatisticsSamples(const std::string &conceptsList) throw() { +void Launcher::logStatisticsSamples(const std::string &conceptsList) { anna::statistics::Engine &statEngine = anna::statistics::Engine::instantiate(); if(conceptsList == "all") { @@ -987,7 +987,7 @@ void Launcher::logStatisticsSamples(const std::string &conceptsList) throw() { } -bool Launcher::eventOperation(const std::string &operation, std::string &response) throw(anna::RuntimeException) { +bool Launcher::eventOperation(const std::string &operation, std::string &response) noexcept(false) { bool result = true; @@ -1905,7 +1905,7 @@ bool Launcher::eventOperation(const std::string &operation, std::string &respons } anna::xml::Node* Launcher::asXML(anna::xml::Node* parent) const -throw() { +{ anna::xml::Node* result = parent->createChild("launcher"); anna::comm::Application::asXML(result); // Timming: @@ -1933,7 +1933,7 @@ throw() { } anna::xml::Node* Launcher::oamAsXML(anna::xml::Node* parent) const -throw() { +{ anna::xml::Node* result = parent->createChild("Oam"); // OAM: @@ -1945,7 +1945,7 @@ throw() { } anna::xml::Node* Launcher::statsAsXML(anna::xml::Node* parent) const -throw() { +{ anna::xml::Node* result = parent->createChild("Statistics"); // Statistics: diff --git a/example/diameter/launcher/Launcher.hpp b/example/diameter/launcher/Launcher.hpp index 4a7f392..c7181ee 100644 --- a/example/diameter/launcher/Launcher.hpp +++ b/example/diameter/launcher/Launcher.hpp @@ -71,12 +71,12 @@ class Launcher : public anna::comm::Application { // comm resources: anna::comm::ServerSocket* a_httpServerSocket; // HTTP - std::string getSignalUSR2InputFile() const throw(); - std::string getSignalUSR2OutputFile() const throw(); + std::string getSignalUSR2InputFile() const ; + std::string getSignalUSR2OutputFile() const ; - void servicesFromXML(const anna::xml::Node* servicesNode, bool bindResources) throw(anna::RuntimeException); - void initialize() throw(anna::RuntimeException); // HTTP - void run() throw(anna::RuntimeException); + void servicesFromXML(const anna::xml::Node* servicesNode, bool bindResources) noexcept(false); + void initialize() noexcept(false); // HTTP + void run() noexcept(false); @@ -84,49 +84,49 @@ public: Launcher(); //~Launcher(); TODO - anna::Millisecond checkTimeMeasure(const std::string ¶meter, const std::string &value) throw(anna::RuntimeException); + anna::Millisecond checkTimeMeasure(const std::string ¶meter, const std::string &value) noexcept(false); - void loadServicesFromFile(const std::string & xmlPathFile, bool bindResources) throw(anna::RuntimeException); - void loadServicesFromXMLString(const std::string & xmlString, bool bindResources) throw(anna::RuntimeException); - void startServices() throw(anna::RuntimeException); + void loadServicesFromFile(const std::string & xmlPathFile, bool bindResources) noexcept(false); + void loadServicesFromXMLString(const std::string & xmlString, bool bindResources) noexcept(false); + void startServices() noexcept(false); - bool setWorkingNode(const std::string &name) throw(); + bool setWorkingNode(const std::string &name) ; void setNodeAuto() { a_workingNode = NULL; a_operatedHost = NULL; } - anna::diameter::comm::OriginHost *getOriginHost(const std::string &name) const throw(anna::RuntimeException); - anna::diameter::comm::OriginHost *getOriginHost(const anna::diameter::codec::Message &message) const throw(anna::RuntimeException); - anna::diameter::comm::OriginHost *getOriginHost(const anna::DataBlock &messageDataBlock) const throw(anna::RuntimeException); + anna::diameter::comm::OriginHost *getOriginHost(const std::string &name) const noexcept(false); + anna::diameter::comm::OriginHost *getOriginHost(const anna::diameter::codec::Message &message) const noexcept(false); + anna::diameter::comm::OriginHost *getOriginHost(const anna::DataBlock &messageDataBlock) const noexcept(false); - bool uniqueOriginHost() const throw(); + bool uniqueOriginHost() const ; // Operated host for communication resources smart assignment //////////////////////////////////////////////////////////// - void updateOperatedOriginHostWithMessage(const anna::diameter::codec::Message &message) throw(anna::RuntimeException); - void updateOperatedOriginHostWithMessage(const anna::DataBlock &messageDataBlock) throw(anna::RuntimeException); - anna::diameter::comm::OriginHost *getWorkingNode() const throw(anna::RuntimeException); - anna::diameter::comm::OriginHost *getOperatedHost() const throw(anna::RuntimeException); + void updateOperatedOriginHostWithMessage(const anna::diameter::codec::Message &message) noexcept(false); + void updateOperatedOriginHostWithMessage(const anna::DataBlock &messageDataBlock) noexcept(false); + anna::diameter::comm::OriginHost *getWorkingNode() const noexcept(false); + anna::diameter::comm::OriginHost *getOperatedHost() const noexcept(false); void setOperatedHost(anna::diameter::comm::OriginHost *); - MyDiameterEntity *getOperatedEntity() const throw(anna::RuntimeException); - MyLocalServer *getOperatedServer() const throw(anna::RuntimeException); - MyDiameterEngine *getOperatedEngine() const throw(anna::RuntimeException); + MyDiameterEntity *getOperatedEntity() const noexcept(false); + MyLocalServer *getOperatedServer() const noexcept(false); + MyDiameterEngine *getOperatedEngine() const noexcept(false); /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// const std::string & getInitialWorkingDirectory() const { return a_initialWorkingDirectory; } - MyCommunicator *getCommunicator() throw() { return a_communicator; } - bool eventOperation(const std::string &, std::string &) throw(anna::RuntimeException); // returns success/failed - void forceCountersRecord() throw(anna::RuntimeException) { if (a_counterRecorderClock) a_counterRecorderClock->tick(); } - void logStatisticsSamples(const std::string &conceptsList) throw(); + MyCommunicator *getCommunicator() { return a_communicator; } + bool eventOperation(const std::string &, std::string &) noexcept(false); // returns success/failed + void forceCountersRecord() noexcept(false) { if (a_counterRecorderClock) a_counterRecorderClock->tick(); } + void logStatisticsSamples(const std::string &conceptsList) ; - anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); - void resetStatistics() throw(); - void resetCounters() throw(); - void signalUSR2() throw(anna::RuntimeException); - void signalTerminate() throw(anna::RuntimeException); - anna::xml::Node* oamAsXML(anna::xml::Node* parent) const throw(); - anna::xml::Node* statsAsXML(anna::xml::Node* parent) const throw(); + anna::xml::Node* asXML(anna::xml::Node* parent) const ; + void resetStatistics() ; + void resetCounters() ; + void signalUSR2() noexcept(false); + void signalTerminate() noexcept(false); + anna::xml::Node* oamAsXML(anna::xml::Node* parent) const ; + anna::xml::Node* statsAsXML(anna::xml::Node* parent) const ; // helpers - bool getDataBlockFromHexFile(const std::string &pathfile, anna::DataBlock &db) const throw(anna::RuntimeException); + bool getDataBlockFromHexFile(const std::string &pathfile, anna::DataBlock &db) const noexcept(false); friend class TestManager; }; diff --git a/example/diameter/launcher/MyCommunicator.cpp b/example/diameter/launcher/MyCommunicator.cpp index d3c1370..2f180cc 100644 --- a/example/diameter/launcher/MyCommunicator.cpp +++ b/example/diameter/launcher/MyCommunicator.cpp @@ -15,7 +15,7 @@ #include -void MyCommunicator::prepareAnswer(anna::diameter::codec::Message *answer, const anna::DataBlock &request) const throw() { +void MyCommunicator::prepareAnswer(anna::diameter::codec::Message *answer, const anna::DataBlock &request) const { // Sequence values (hop-by-hop and end-to-end), session-id and subscription-id avps, are mirrored to the peer which sent the request. // If user wants to test a specific answer without changing it, use send operations better than programming. // Sequence substitution: @@ -62,7 +62,7 @@ void MyCommunicator::prepareAnswer(anna::diameter::codec::Message *answer, const // HTTP void MyCommunicator::eventReceiveMessage(anna::comm::ClientSocket& clientSocket, const anna::comm::Message& message) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("MyCommunicator", "eventReceiveMessage", ANNA_FILE_LOCATION)); if(clientSocket.support(anna::http::Transport::className()) == false) @@ -73,14 +73,14 @@ throw(anna::RuntimeException) { } void MyCommunicator::eventBreakConnection(Server* server) -throw() { +{ LOGMETHOD(anna::TraceMethod tm("MyCommunicator", "eventBreakConnection", ANNA_FILE_LOCATION)); terminate(); anna::comm::Communicator::eventBreakConnection(server); } void MyCommunicator::terminate() -throw() { +{ if(hasRequestedStop() == true) return; diff --git a/example/diameter/launcher/MyCommunicator.hpp b/example/diameter/launcher/MyCommunicator.hpp index f573069..f4bdaa3 100644 --- a/example/diameter/launcher/MyCommunicator.hpp +++ b/example/diameter/launcher/MyCommunicator.hpp @@ -24,15 +24,15 @@ public: a_contexts("Contexts") {;} - void prepareAnswer(anna::diameter::codec::Message *answer, const anna::DataBlock &request) const throw(); - void terminate() throw(); + void prepareAnswer(anna::diameter::codec::Message *answer, const anna::DataBlock &request) const ; + void terminate() ; private: using anna::comm::Communicator::eventBreakConnection; anna::ThreadData a_contexts; - void eventReceiveMessage(anna::comm::ClientSocket&, const anna::comm::Message&) throw(anna::RuntimeException); - void eventBreakConnection(Server* server) throw(); + void eventReceiveMessage(anna::comm::ClientSocket&, const anna::comm::Message&) noexcept(false); + void eventBreakConnection(Server* server) ; }; #endif diff --git a/example/diameter/launcher/MyCounterRecorder.cpp b/example/diameter/launcher/MyCounterRecorder.cpp index fd29422..3d6efab 100644 --- a/example/diameter/launcher/MyCounterRecorder.cpp +++ b/example/diameter/launcher/MyCounterRecorder.cpp @@ -15,7 +15,7 @@ MyCounterRecorder::MyCounterRecorder(const std::string &fnp) : a_stream(-1), a_f } // pure virtual definitions: -void MyCounterRecorder::open() throw(anna::RuntimeException) { +void MyCounterRecorder::open() noexcept(false) { static char str [256]; const time_t now = ::time(NULL); struct tm tmNow; @@ -46,7 +46,7 @@ void MyCounterRecorder::open() throw(anna::RuntimeException) { a_fixedLine = str; } -void MyCounterRecorder::apply(const anna::oam::Counter& counter) throw(anna::RuntimeException) { +void MyCounterRecorder::apply(const anna::oam::Counter& counter) noexcept(false) { static char line [356]; anna::oam::Counter::type_t value = counter; sprintf(line, "%s|%06d|%07u|%s\n", a_fixedLine.c_str(), counter.getReference(), value, counter.getName().c_str()); @@ -55,7 +55,7 @@ void MyCounterRecorder::apply(const anna::oam::Counter& counter) throw(anna::Run throw RuntimeException(anna::functions::asString("Error writting to file '%s'; errno = %d", a_fileName.c_str(), errno), ANNA_FILE_LOCATION); } -void MyCounterRecorder::close() throw() { +void MyCounterRecorder::close() { if(a_stream != -1) { ::close(a_stream); a_stream = -1; @@ -65,7 +65,7 @@ void MyCounterRecorder::close() throw() { a_previousTime = ::time(NULL); } -std::string MyCounterRecorder::asString() const throw() { +std::string MyCounterRecorder::asString() const { std::string result = "Physical counters dump at file '"; result += a_fileName; result += "'. Another way to see counters: context dump (kill -10 "; diff --git a/example/diameter/launcher/MyCounterRecorder.hpp b/example/diameter/launcher/MyCounterRecorder.hpp index 708c408..d6b8158 100644 --- a/example/diameter/launcher/MyCounterRecorder.hpp +++ b/example/diameter/launcher/MyCounterRecorder.hpp @@ -28,10 +28,10 @@ class MyCounterRecorder : public anna::oam::CounterRecorder { std::string a_fixedLine; // pure virtual definitions: - void open() throw(anna::RuntimeException); - void apply(const anna::oam::Counter& counter) throw(anna::RuntimeException); - void close() throw(); - std::string asString() const throw(); + void open() noexcept(false); + void apply(const anna::oam::Counter& counter) noexcept(false); + void close() ; + std::string asString() const ; public: MyCounterRecorder(const std::string &fnp); diff --git a/example/diameter/launcher/MyCounterRecorderClock.hpp b/example/diameter/launcher/MyCounterRecorderClock.hpp index 56a47a3..f9a837c 100644 --- a/example/diameter/launcher/MyCounterRecorderClock.hpp +++ b/example/diameter/launcher/MyCounterRecorderClock.hpp @@ -22,7 +22,7 @@ public: anna::timex::Clock(clockName, timeout) {;} //virtual ~MyCounterRecorderClock(); - virtual bool tick() throw(anna::RuntimeException) { + virtual bool tick() noexcept(false) { anna::diameter::comm::OamModule::instantiate().recordCounters(); anna::diameter::codec::OamModule::instantiate().recordCounters(); return true; diff --git a/example/diameter/launcher/MyDiameterEngine.hpp b/example/diameter/launcher/MyDiameterEngine.hpp index 4fe049f..860fa67 100644 --- a/example/diameter/launcher/MyDiameterEngine.hpp +++ b/example/diameter/launcher/MyDiameterEngine.hpp @@ -34,24 +34,24 @@ public: MyDiameterEngine(const char *className, const anna::diameter::stack::Dictionary *baseProtocolDictionary) : Engine(className, baseProtocolDictionary) {;} // Default implementation is enough -// void readDPA(anna::DataBlock &dpa, const anna::DataBlock & dpr) throw() {;} // DPA is not replied -// void readDWA(anna::DataBlock &dwa, const anna::DataBlock & dwr) throw() {;} // DWA is not replied +// void readDPA(anna::DataBlock &dpa, const anna::DataBlock & dpr) {;} // DPA is not replied +// void readDWA(anna::DataBlock &dwa, const anna::DataBlock & dwr) {;} // DWA is not replied private: anna::Recycler a_entitiesRecycler; - anna::diameter::comm::Entity* allocateEntity() throw() { return a_entitiesRecycler.create(); } + anna::diameter::comm::Entity* allocateEntity() { return a_entitiesRecycler.create(); } - void releaseEntity(anna::diameter::comm::Entity* entity) throw() { + void releaseEntity(anna::diameter::comm::Entity* entity) { MyDiameterEntity* aux = static_cast (entity); a_entitiesRecycler.release(aux); } anna::Recycler a_localServersRecycler; - anna::diameter::comm::LocalServer* allocateLocalServer() throw() { return a_localServersRecycler.create(); } + anna::diameter::comm::LocalServer* allocateLocalServer() { return a_localServersRecycler.create(); } - void releaseLocalServer(anna::diameter::comm::LocalServer* localServer) throw() { + void releaseLocalServer(anna::diameter::comm::LocalServer* localServer) { MyLocalServer* aux = static_cast (localServer); a_localServersRecycler.release(aux); } diff --git a/example/diameter/launcher/MyDiameterEntity.cpp b/example/diameter/launcher/MyDiameterEntity.cpp index 3e50d70..7bac08a 100644 --- a/example/diameter/launcher/MyDiameterEntity.cpp +++ b/example/diameter/launcher/MyDiameterEntity.cpp @@ -24,7 +24,7 @@ #include -void MyDiameterEntity::eventRequestRetransmission(const anna::diameter::comm::ClientSession* clientSession, anna::diameter::comm::Message *request) throw() { +void MyDiameterEntity::eventRequestRetransmission(const anna::diameter::comm::ClientSession* clientSession, anna::diameter::comm::Message *request) { LOGMETHOD(anna::TraceMethod tm("launcher::MyDiameterEntity", "eventRequestRetransmission", ANNA_FILE_LOCATION)); @@ -53,7 +53,7 @@ void MyDiameterEntity::eventRequestRetransmission(const anna::diameter::comm::Cl void MyDiameterEntity::eventRequest(anna::diameter::comm::ClientSession *clientSession, const anna::DataBlock &message) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("launcher::MyDiameterEntity", "eventRequest", ANNA_FILE_LOCATION)); // Performance stats: Launcher& my_app = static_cast (anna::app::functions::getApp()); @@ -138,7 +138,7 @@ throw(anna::RuntimeException) { } void MyDiameterEntity::eventResponse(const anna::diameter::comm::Response &response) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("launcher::MyDiameterEntity", "eventResponse", ANNA_FILE_LOCATION)); Launcher& my_app = static_cast (anna::app::functions::getApp()); anna::diameter::comm::OriginHost *my_node = my_app.getOriginHost(getEngine()->getOriginHostName()); @@ -231,7 +231,7 @@ throw(anna::RuntimeException) { } void MyDiameterEntity::eventUnknownResponse(anna::diameter::comm::ClientSession *clientSession, const anna::DataBlock &message) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("launcher::MyDiameterEntity", "eventUnknownResponse", ANNA_FILE_LOCATION)); // Performance stats: Launcher& my_app = static_cast (anna::app::functions::getApp()); @@ -254,7 +254,7 @@ throw(anna::RuntimeException) { } void MyDiameterEntity::eventDPA(anna::diameter::comm::ClientSession *clientSession, const anna::DataBlock &message) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("launcher::MyDiameterEntity", "eventDPA", ANNA_FILE_LOCATION)); // Performance stats: Launcher& my_app = static_cast (anna::app::functions::getApp()); diff --git a/example/diameter/launcher/MyDiameterEntity.hpp b/example/diameter/launcher/MyDiameterEntity.hpp index c238a76..554267b 100644 --- a/example/diameter/launcher/MyDiameterEntity.hpp +++ b/example/diameter/launcher/MyDiameterEntity.hpp @@ -24,11 +24,11 @@ namespace anna { class MyDiameterEntity : public anna::diameter::comm::Entity { - void eventRequestRetransmission(const anna::diameter::comm::ClientSession *, anna::diameter::comm::Message*) throw(); - void eventResponse(const anna::diameter::comm::Response&) throw(anna::RuntimeException); - void eventRequest(anna::diameter::comm::ClientSession *, const anna::DataBlock&) throw(anna::RuntimeException); - void eventUnknownResponse(anna::diameter::comm::ClientSession *, const anna::DataBlock&) throw(anna::RuntimeException); - void eventDPA(anna::diameter::comm::ClientSession *, const anna::DataBlock&) throw(anna::RuntimeException); + void eventRequestRetransmission(const anna::diameter::comm::ClientSession *, anna::diameter::comm::Message*) ; + void eventResponse(const anna::diameter::comm::Response&) noexcept(false); + void eventRequest(anna::diameter::comm::ClientSession *, const anna::DataBlock&) noexcept(false); + void eventUnknownResponse(anna::diameter::comm::ClientSession *, const anna::DataBlock&) noexcept(false); + void eventDPA(anna::diameter::comm::ClientSession *, const anna::DataBlock&) noexcept(false); public: @@ -36,7 +36,7 @@ public: virtual ~MyDiameterEntity() {;} anna::diameter::codec::MessagesDeque a_reactingAnswers; - anna::diameter::codec::MessagesDeque *getReactingAnswers() throw() { return (anna::diameter::codec::MessagesDeque*)&a_reactingAnswers; } + anna::diameter::codec::MessagesDeque *getReactingAnswers() { return (anna::diameter::codec::MessagesDeque*)&a_reactingAnswers; } }; #endif diff --git a/example/diameter/launcher/MyHandler.cpp b/example/diameter/launcher/MyHandler.cpp index 9086582..dfc29bd 100644 --- a/example/diameter/launcher/MyHandler.cpp +++ b/example/diameter/launcher/MyHandler.cpp @@ -49,7 +49,7 @@ void MyHandler::sendResponse(anna::comm::ClientSocket& clientSocket, anna::http: } void MyHandler::evRequest(anna::comm::ClientSocket& clientSocket, const anna::http::Request& request) -throw(anna::RuntimeException) { +noexcept(false) { const anna::DataBlock& body = request.getBody(); anna::http::Method::Type::_v method = request.getMethod(); diff --git a/example/diameter/launcher/MyHandler.hpp b/example/diameter/launcher/MyHandler.hpp index 9e849a3..31758b5 100644 --- a/example/diameter/launcher/MyHandler.hpp +++ b/example/diameter/launcher/MyHandler.hpp @@ -28,8 +28,8 @@ private: bool doGET(const std::string &uri, std::string &response); bool doPOST(const std::string &uri, const nlohmann::json &j, std::string &reponse); - void evRequest(anna::comm::ClientSocket&, const anna::http::Request& request) throw(anna::RuntimeException); - void evResponse(anna::comm::ClientSocket&, const anna::http::Response&) throw(anna::RuntimeException) {;} + void evRequest(anna::comm::ClientSocket&, const anna::http::Request& request) noexcept(false); + void evResponse(anna::comm::ClientSocket&, const anna::http::Response&) noexcept(false) {;} }; #endif diff --git a/example/diameter/launcher/MyLocalServer.cpp b/example/diameter/launcher/MyLocalServer.cpp index f18653f..42b8b1e 100644 --- a/example/diameter/launcher/MyLocalServer.cpp +++ b/example/diameter/launcher/MyLocalServer.cpp @@ -25,7 +25,7 @@ void MyLocalServer::eventRequest(anna::diameter::comm::ServerSession *serverSession, const anna::DataBlock &message) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("launcher::MyLocalServer", "eventRequest", ANNA_FILE_LOCATION)); // Performance stats: Launcher& my_app = static_cast (anna::app::functions::getApp()); @@ -140,7 +140,7 @@ throw(anna::RuntimeException) { } void MyLocalServer::eventResponse(const anna::diameter::comm::Response &response) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("launcher::MyLocalServer", "eventResponse", ANNA_FILE_LOCATION)); Launcher& my_app = static_cast (anna::app::functions::getApp()); anna::diameter::comm::OriginHost * my_node = my_app.getOriginHost(getEngine()->getOriginHostName()); @@ -231,7 +231,7 @@ throw(anna::RuntimeException) { } void MyLocalServer::eventUnknownResponse(anna::diameter::comm::ServerSession *serverSession, const anna::DataBlock &message) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("launcher::MyLocalServer", "eventUnknownResponse", ANNA_FILE_LOCATION)); // Performance stats: Launcher& my_app = static_cast (anna::app::functions::getApp()); @@ -253,7 +253,7 @@ throw(anna::RuntimeException) { } void MyLocalServer::eventDPA(anna::diameter::comm::ServerSession *serverSession, const anna::DataBlock &message) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("launcher::MyLocalServer", "eventDPA", ANNA_FILE_LOCATION)); // Performance stats: Launcher& my_app = static_cast (anna::app::functions::getApp()); diff --git a/example/diameter/launcher/MyLocalServer.hpp b/example/diameter/launcher/MyLocalServer.hpp index 4613173..17caf35 100644 --- a/example/diameter/launcher/MyLocalServer.hpp +++ b/example/diameter/launcher/MyLocalServer.hpp @@ -24,16 +24,16 @@ namespace anna { class MyLocalServer : public anna::diameter::comm::LocalServer { - void eventResponse(const anna::diameter::comm::Response&) throw(anna::RuntimeException); - void eventRequest(anna::diameter::comm::ServerSession *, const anna::DataBlock&) throw(anna::RuntimeException); - void eventUnknownResponse(anna::diameter::comm::ServerSession *, const anna::DataBlock&) throw(anna::RuntimeException); - void eventDPA(anna::diameter::comm::ServerSession *, const anna::DataBlock&) throw(anna::RuntimeException); + void eventResponse(const anna::diameter::comm::Response&) noexcept(false); + void eventRequest(anna::diameter::comm::ServerSession *, const anna::DataBlock&) noexcept(false); + void eventUnknownResponse(anna::diameter::comm::ServerSession *, const anna::DataBlock&) noexcept(false); + void eventDPA(anna::diameter::comm::ServerSession *, const anna::DataBlock&) noexcept(false); public: virtual ~MyLocalServer() {;} anna::diameter::codec::MessagesDeque a_reactingAnswers; - anna::diameter::codec::MessagesDeque *getReactingAnswers() throw() { return (anna::diameter::codec::MessagesDeque*)&a_reactingAnswers; } + anna::diameter::codec::MessagesDeque *getReactingAnswers() { return (anna::diameter::codec::MessagesDeque*)&a_reactingAnswers; } }; #endif diff --git a/example/diameter/pcapDecoder/main.cpp b/example/diameter/pcapDecoder/main.cpp index cdada35..97474e8 100644 --- a/example/diameter/pcapDecoder/main.cpp +++ b/example/diameter/pcapDecoder/main.cpp @@ -49,20 +49,20 @@ public: } } - void setSourceIP(const std::string &srcIP) throw() { + void setSourceIP(const std::string &srcIP) { _sourceIP = srcIP; } - void setDestinationIP(const std::string &dstIP) throw() { + void setDestinationIP(const std::string &dstIP) { _destinationIP = dstIP; } - void setTimestamp(time_t ts) throw() { + void setTimestamp(time_t ts) { _timestamp = ts; } - void setTimestampU(int tsu) throw() { + void setTimestampU(int tsu) { _timestampU = tsu; } // Returns true if completed: - bool appendData(const char *data, size_t size) throw(RuntimeException) { + bool appendData(const char *data, size_t size) noexcept(false) { LOGDEBUG( Logger::debug(anna::functions::asString("Appending %d bytes", size), ANNA_FILE_LOCATION)); _data.append(data, size); @@ -79,7 +79,7 @@ public: return true; } - void reset() throw() { + void reset() { _sourceIP = ""; _destinationIP = ""; _timestamp = 0; @@ -88,22 +88,22 @@ public: _diameterLength = -1; // not calculated yet } - const std::string &getSourceIP() const throw() { + const std::string &getSourceIP() const { return _sourceIP; } - const std::string &getDestinationIP() const throw() { + const std::string &getDestinationIP() const { return _destinationIP; } - time_t getTimestamp() const throw() { + time_t getTimestamp() const { return _timestamp; } - int getTimestampU() const throw() { + int getTimestampU() const { return _timestampU; } - const std::string &getData() const throw() { + const std::string &getData() const { return _data; } - std::string getDataAsHex() const throw() { + std::string getDataAsHex() const { return anna::functions::asHexString( anna::DataBlock(_data.c_str(), _data.size())); } @@ -253,7 +253,7 @@ void my_callback(u_char *useless, const struct pcap_pkthdr* pkthdr, count++; } -bool getDataBlockFromHexFile(const std::string &pathfile, anna::DataBlock &db) throw() { +bool getDataBlockFromHexFile(const std::string &pathfile, anna::DataBlock &db) { // Get hex string static char buffer[8192]; std::ifstream infile(pathfile.c_str(), std::ifstream::in); diff --git a/example/diameter/rxSimpleTest/MyCommunicator.cpp b/example/diameter/rxSimpleTest/MyCommunicator.cpp index 777ac2f..e48bd01 100755 --- a/example/diameter/rxSimpleTest/MyCommunicator.cpp +++ b/example/diameter/rxSimpleTest/MyCommunicator.cpp @@ -15,7 +15,7 @@ #include -void MyCommunicator::prepareAnswer(anna::diameter::codec::Message *answer, const anna::DataBlock &request) const throw() { +void MyCommunicator::prepareAnswer(anna::diameter::codec::Message *answer, const anna::DataBlock &request) const { // Sequence values (hop-by-hop and end-to-end), session-id and subscription-id avps, are mirrored to the peer which sent the request. // If user wants to test a specific answer without changing it, use send operations better than programming. // Sequence substitution: @@ -62,19 +62,19 @@ void MyCommunicator::prepareAnswer(anna::diameter::codec::Message *answer, const // HTTP void MyCommunicator::eventReceiveMessage(anna::comm::ClientSocket& clientSocket, const anna::comm::Message& message) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("MyCommunicator", "eventReceiveMessage", ANNA_FILE_LOCATION)); } void MyCommunicator::eventBreakConnection(Server* server) -throw() { +{ LOGMETHOD(anna::TraceMethod tm("MyCommunicator", "eventBreakConnection", ANNA_FILE_LOCATION)); terminate(); anna::comm::Communicator::eventBreakConnection(server); } void MyCommunicator::terminate() -throw() { +{ if(hasRequestedStop() == true) return; diff --git a/example/diameter/rxSimpleTest/MyCommunicator.hpp b/example/diameter/rxSimpleTest/MyCommunicator.hpp index 0d2efe5..270b83a 100755 --- a/example/diameter/rxSimpleTest/MyCommunicator.hpp +++ b/example/diameter/rxSimpleTest/MyCommunicator.hpp @@ -20,14 +20,14 @@ public: MyCommunicator(const anna::comm::Communicator::WorkMode::_v acceptMode = anna::comm::Communicator::WorkMode::Single) : anna::comm::Communicator(acceptMode) {;} - void prepareAnswer(anna::diameter::codec::Message *answer, const anna::DataBlock &request) const throw(); - void terminate() throw(); + void prepareAnswer(anna::diameter::codec::Message *answer, const anna::DataBlock &request) const ; + void terminate() ; private: using anna::comm::Communicator::eventBreakConnection; - void eventReceiveMessage(anna::comm::ClientSocket&, const anna::comm::Message&) throw(anna::RuntimeException); - void eventBreakConnection(Server* server) throw(); + void eventReceiveMessage(anna::comm::ClientSocket&, const anna::comm::Message&) noexcept(false); + void eventBreakConnection(Server* server) ; }; #endif diff --git a/example/diameter/rxSimpleTest/MyDiameterEngine.hpp b/example/diameter/rxSimpleTest/MyDiameterEngine.hpp index 93f26e4..2eb85aa 100755 --- a/example/diameter/rxSimpleTest/MyDiameterEngine.hpp +++ b/example/diameter/rxSimpleTest/MyDiameterEngine.hpp @@ -34,24 +34,24 @@ public: MyDiameterEngine(const char *className, const anna::diameter::stack::Dictionary *baseProtocolDictionary) : Engine(className, baseProtocolDictionary) {;} // Default implementation is enough -// void readDPA(anna::DataBlock &dpa, const anna::DataBlock & dpr) throw() {;} // DPA is not replied -// void readDWA(anna::DataBlock &dwa, const anna::DataBlock & dwr) throw() {;} // DWA is not replied +// void readDPA(anna::DataBlock &dpa, const anna::DataBlock & dpr) {;} // DPA is not replied +// void readDWA(anna::DataBlock &dwa, const anna::DataBlock & dwr) {;} // DWA is not replied private: anna::Recycler a_entitiesRecycler; - anna::diameter::comm::Entity* allocateEntity() throw() { return a_entitiesRecycler.create(); } + anna::diameter::comm::Entity* allocateEntity() { return a_entitiesRecycler.create(); } - void releaseEntity(anna::diameter::comm::Entity* entity) throw() { + void releaseEntity(anna::diameter::comm::Entity* entity) { MyDiameterEntity* aux = static_cast (entity); a_entitiesRecycler.release(aux); } anna::Recycler a_localServersRecycler; - anna::diameter::comm::LocalServer* allocateLocalServer() throw() { return a_localServersRecycler.create(); } + anna::diameter::comm::LocalServer* allocateLocalServer() { return a_localServersRecycler.create(); } - void releaseLocalServer(anna::diameter::comm::LocalServer* localServer) throw() { + void releaseLocalServer(anna::diameter::comm::LocalServer* localServer) { MyLocalServer* aux = static_cast (localServer); a_localServersRecycler.release(aux); } diff --git a/example/diameter/rxSimpleTest/MyDiameterEntity.cpp b/example/diameter/rxSimpleTest/MyDiameterEntity.cpp index a1b8001..69ccab2 100755 --- a/example/diameter/rxSimpleTest/MyDiameterEntity.cpp +++ b/example/diameter/rxSimpleTest/MyDiameterEntity.cpp @@ -24,7 +24,7 @@ #include -void MyDiameterEntity::eventRequestRetransmission(const anna::diameter::comm::ClientSession* clientSession, anna::diameter::comm::Message *request) throw() { +void MyDiameterEntity::eventRequestRetransmission(const anna::diameter::comm::ClientSession* clientSession, anna::diameter::comm::Message *request) { LOGMETHOD(anna::TraceMethod tm("rxSimpleTest::MyDiameterEntity", "eventRequestRetransmission", ANNA_FILE_LOCATION)); @@ -50,7 +50,7 @@ void MyDiameterEntity::eventRequestRetransmission(const anna::diameter::comm::Cl void MyDiameterEntity::eventRequest(anna::diameter::comm::ClientSession *clientSession, const anna::DataBlock &message) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("rxSimpleTest::MyDiameterEntity", "eventRequest", ANNA_FILE_LOCATION)); // Performance stats: RxSimpleTest& my_app = static_cast (anna::app::functions::getApp()); @@ -71,7 +71,7 @@ throw(anna::RuntimeException) { } void MyDiameterEntity::eventResponse(const anna::diameter::comm::Response &response) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("rxSimpleTest::MyDiameterEntity", "eventResponse", ANNA_FILE_LOCATION)); RxSimpleTest& my_app = static_cast (anna::app::functions::getApp()); anna::diameter::comm::OriginHost *my_node = my_app.getOriginHost(getEngine()->getOriginHostName()); @@ -180,7 +180,7 @@ throw(anna::RuntimeException) { } void MyDiameterEntity::eventUnknownResponse(anna::diameter::comm::ClientSession *clientSession, const anna::DataBlock &message) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("rxSimpleTest::MyDiameterEntity", "eventUnknownResponse", ANNA_FILE_LOCATION)); // Performance stats: RxSimpleTest& my_app = static_cast (anna::app::functions::getApp()); @@ -200,7 +200,7 @@ throw(anna::RuntimeException) { } void MyDiameterEntity::eventDPA(anna::diameter::comm::ClientSession *clientSession, const anna::DataBlock &message) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("rxSimpleTest::MyDiameterEntity", "eventDPA", ANNA_FILE_LOCATION)); // Performance stats: RxSimpleTest& my_app = static_cast (anna::app::functions::getApp()); diff --git a/example/diameter/rxSimpleTest/MyDiameterEntity.hpp b/example/diameter/rxSimpleTest/MyDiameterEntity.hpp index f328d3c..d42016d 100755 --- a/example/diameter/rxSimpleTest/MyDiameterEntity.hpp +++ b/example/diameter/rxSimpleTest/MyDiameterEntity.hpp @@ -22,11 +22,11 @@ namespace anna { class MyDiameterEntity : public anna::diameter::comm::Entity { - void eventRequestRetransmission(const anna::diameter::comm::ClientSession *, anna::diameter::comm::Message*) throw(); - void eventResponse(const anna::diameter::comm::Response&) throw(anna::RuntimeException); - void eventRequest(anna::diameter::comm::ClientSession *, const anna::DataBlock&) throw(anna::RuntimeException); - void eventUnknownResponse(anna::diameter::comm::ClientSession *, const anna::DataBlock&) throw(anna::RuntimeException); - void eventDPA(anna::diameter::comm::ClientSession *, const anna::DataBlock&) throw(anna::RuntimeException); + void eventRequestRetransmission(const anna::diameter::comm::ClientSession *, anna::diameter::comm::Message*) ; + void eventResponse(const anna::diameter::comm::Response&) noexcept(false); + void eventRequest(anna::diameter::comm::ClientSession *, const anna::DataBlock&) noexcept(false); + void eventUnknownResponse(anna::diameter::comm::ClientSession *, const anna::DataBlock&) noexcept(false); + void eventDPA(anna::diameter::comm::ClientSession *, const anna::DataBlock&) noexcept(false); public: diff --git a/example/diameter/rxSimpleTest/MyLocalServer.cpp b/example/diameter/rxSimpleTest/MyLocalServer.cpp index 38a538a..1327dd1 100755 --- a/example/diameter/rxSimpleTest/MyLocalServer.cpp +++ b/example/diameter/rxSimpleTest/MyLocalServer.cpp @@ -24,7 +24,7 @@ void MyLocalServer::eventRequest(anna::diameter::comm::ServerSession *serverSession, const anna::DataBlock &message) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("rxSimpleTest::MyLocalServer", "eventRequest", ANNA_FILE_LOCATION)); // Performance stats: RxSimpleTest& my_app = static_cast (anna::app::functions::getApp()); @@ -63,7 +63,7 @@ throw(anna::RuntimeException) { } void MyLocalServer::eventResponse(const anna::diameter::comm::Response &response) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("rxSimpleTest::MyLocalServer", "eventResponse", ANNA_FILE_LOCATION)); RxSimpleTest& my_app = static_cast (anna::app::functions::getApp()); anna::diameter::comm::OriginHost * my_node = my_app.getOriginHost(getEngine()->getOriginHostName()); @@ -111,7 +111,7 @@ throw(anna::RuntimeException) { } void MyLocalServer::eventUnknownResponse(anna::diameter::comm::ServerSession *serverSession, const anna::DataBlock &message) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("rxSimpleTest::MyLocalServer", "eventUnknownResponse", ANNA_FILE_LOCATION)); // Performance stats: RxSimpleTest& my_app = static_cast (anna::app::functions::getApp()); @@ -131,7 +131,7 @@ throw(anna::RuntimeException) { } void MyLocalServer::eventDPA(anna::diameter::comm::ServerSession *serverSession, const anna::DataBlock &message) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("rxSimpleTest::MyLocalServer", "eventDPA", ANNA_FILE_LOCATION)); // Performance stats: RxSimpleTest& my_app = static_cast (anna::app::functions::getApp()); diff --git a/example/diameter/rxSimpleTest/MyLocalServer.hpp b/example/diameter/rxSimpleTest/MyLocalServer.hpp index c1cfd57..4f25615 100755 --- a/example/diameter/rxSimpleTest/MyLocalServer.hpp +++ b/example/diameter/rxSimpleTest/MyLocalServer.hpp @@ -23,10 +23,10 @@ namespace anna { class MyLocalServer : public anna::diameter::comm::LocalServer { - void eventResponse(const anna::diameter::comm::Response&) throw(anna::RuntimeException); - void eventRequest(anna::diameter::comm::ServerSession *, const anna::DataBlock&) throw(anna::RuntimeException); - void eventUnknownResponse(anna::diameter::comm::ServerSession *, const anna::DataBlock&) throw(anna::RuntimeException); - void eventDPA(anna::diameter::comm::ServerSession *, const anna::DataBlock&) throw(anna::RuntimeException); + void eventResponse(const anna::diameter::comm::Response&) noexcept(false); + void eventRequest(anna::diameter::comm::ServerSession *, const anna::DataBlock&) noexcept(false); + void eventUnknownResponse(anna::diameter::comm::ServerSession *, const anna::DataBlock&) noexcept(false); + void eventDPA(anna::diameter::comm::ServerSession *, const anna::DataBlock&) noexcept(false); public: virtual ~MyLocalServer() {;} diff --git a/example/diameter/rxSimpleTest/rxSimpleTest.cpp b/example/diameter/rxSimpleTest/rxSimpleTest.cpp index 95a3580..12fde94 100755 --- a/example/diameter/rxSimpleTest/rxSimpleTest.cpp +++ b/example/diameter/rxSimpleTest/rxSimpleTest.cpp @@ -41,7 +41,7 @@ RxSimpleTest::RxSimpleTest() : anna::comm::Application("rxSimpleTest", "RxSimple a_workingNode = NULL; } -void RxSimpleTest::startService() throw(anna::RuntimeException) { +void RxSimpleTest::startService() noexcept(false) { // Stacks anna::diameter::stack::Engine &stackEngine = anna::diameter::stack::Engine::instantiate(); @@ -147,7 +147,7 @@ void RxSimpleTest::startService() throw(anna::RuntimeException) { ohm.registerOriginHost(originHostName, a_workingNode); } -anna::diameter::comm::OriginHost *RxSimpleTest::getOriginHost(const std::string &name) const throw(anna::RuntimeException) { +anna::diameter::comm::OriginHost *RxSimpleTest::getOriginHost(const std::string &name) const noexcept(false) { anna::diameter::comm::OriginHostManager &ohm = anna::diameter::comm::OriginHostManager::instantiate(); anna::diameter::comm::OriginHost *result = ohm.getOriginHost(name); @@ -157,14 +157,14 @@ anna::diameter::comm::OriginHost *RxSimpleTest::getOriginHost(const std::string return result; } -MyDiameterEntity *RxSimpleTest::getEntity() const throw(anna::RuntimeException) { +MyDiameterEntity *RxSimpleTest::getEntity() const noexcept(false) { MyDiameterEntity *result = (MyDiameterEntity *)(a_workingNode->getEntity()); if (!result) throw anna::RuntimeException("No entity created", ANNA_FILE_LOCATION); return result; } -MyLocalServer *RxSimpleTest::getServer() const throw(anna::RuntimeException) { +MyLocalServer *RxSimpleTest::getServer() const noexcept(false) { MyLocalServer *result = (MyLocalServer *)(a_workingNode->getDiameterServer()); if (!result) throw anna::RuntimeException("No local server created", ANNA_FILE_LOCATION); @@ -172,7 +172,7 @@ MyLocalServer *RxSimpleTest::getServer() const throw(anna::RuntimeException) { } void RxSimpleTest::initialize() -throw(anna::RuntimeException) { +noexcept(false) { anna::comm::Application::initialize(); CommandLine& cl(anna::CommandLine::instantiate()); anna::comm::Communicator::WorkMode::_v workMode(anna::comm::Communicator::WorkMode::Single); @@ -183,7 +183,7 @@ throw(anna::RuntimeException) { } void RxSimpleTest::run() -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("RxSimpleTest", "run", ANNA_FILE_LOCATION)); anna::diameter::stack::Engine::instantiate(); @@ -216,7 +216,7 @@ throw(anna::RuntimeException) { } anna::xml::Node* RxSimpleTest::asXML(anna::xml::Node* parent) const -throw() { +{ anna::xml::Node* result = parent->createChild("rxSimpleTest"); anna::comm::Application::asXML(result); // Timming: diff --git a/example/diameter/rxSimpleTest/rxSimpleTest.hpp b/example/diameter/rxSimpleTest/rxSimpleTest.hpp index 7e90033..f068ef1 100755 --- a/example/diameter/rxSimpleTest/rxSimpleTest.hpp +++ b/example/diameter/rxSimpleTest/rxSimpleTest.hpp @@ -55,20 +55,20 @@ class RxSimpleTest : public anna::comm::Application { std::string a_initialWorkingDirectory; - void initialize() throw(anna::RuntimeException); // HTTP - void run() throw(anna::RuntimeException); + void initialize() noexcept(false); // HTTP + void run() noexcept(false); public: RxSimpleTest(); - MyDiameterEntity *getEntity() const throw(anna::RuntimeException); - MyLocalServer *getServer() const throw(anna::RuntimeException); - MyDiameterEngine *getEngine() const throw(anna::RuntimeException); - MyCommunicator *getCommunicator() throw() { return a_communicator; } - void startService() throw(anna::RuntimeException); - anna::diameter::comm::OriginHost *getOriginHost(const std::string &name) const throw(anna::RuntimeException); + MyDiameterEntity *getEntity() const noexcept(false); + MyLocalServer *getServer() const noexcept(false); + MyDiameterEngine *getEngine() const noexcept(false); + MyCommunicator *getCommunicator() { return a_communicator; } + void startService() noexcept(false); + anna::diameter::comm::OriginHost *getOriginHost(const std::string &name) const noexcept(false); - anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); + anna::xml::Node* asXML(anna::xml::Node* parent) const ; }; #endif diff --git a/example/http/client/main.cpp b/example/http/client/main.cpp index 085a692..c2ea241 100644 --- a/example/http/client/main.cpp +++ b/example/http/client/main.cpp @@ -47,9 +47,9 @@ public: a_httpRequest.setURI ("HTTPKClient"); } - void setMessageBySecond (const int messageBySecond) throw () { a_messageBySecond = messageBySecond; } + void setMessageBySecond (const int messageBySecond) { a_messageBySecond = messageBySecond; } - int getTxMessageCounter () const throw () { return a_txMessageCounter; } + int getTxMessageCounter () const { return a_txMessageCounter; } private: int a_messageBySecond; @@ -59,7 +59,7 @@ private: http::Request a_httpRequest; test::Request a_testRequest; - bool tick () throw (RuntimeException); + bool tick () noexcept(false); }; class MyHandler : public http::Handler { @@ -70,17 +70,17 @@ private: http::Response a_httpResponse; test::Response a_testResponse; - void evRequest (ClientSocket&, const http::Request&) throw (RuntimeException) {;} - void evResponse (ClientSocket&, const http::Response&) throw (RuntimeException); + void evRequest (ClientSocket&, const http::Request&) noexcept(false) {;} + void evResponse (ClientSocket&, const http::Response&) noexcept(false); - static bool isOk (const test::Response& response) throw (); + static bool isOk (const test::Response& response) ; }; class MyCommunicator : public Communicator { public: MyCommunicator () : Communicator (), a_avgResponseTime (0), a_rxMessageCounter (0) {;} - void count (const int delay) throw (RuntimeException); + void count (const int delay) noexcept(false); private: using Communicator::eventBreakConnection; @@ -89,14 +89,14 @@ private: int a_rxMessageCounter; MyHandler a_httpHandler; - void eventReceiveMessage (ClientSocket&, const Message&) throw (RuntimeException); + void eventReceiveMessage (ClientSocket&, const Message&) noexcept(false); - void eventBreakConnection (const ClientSocket&) throw (); + void eventBreakConnection (const ClientSocket&) ; - void eventBreakConnection (Server* server) throw () { + void eventBreakConnection (Server* server) { comm::Communicator::eventBreakConnection (server); } - void eventBreakConnection (const Service* service) throw () { + void eventBreakConnection (const Service* service) { comm::Communicator::eventBreakConnection (service); } }; @@ -105,8 +105,8 @@ class HeavyClient : public anna::comm::Application { public: HeavyClient (); - Server* getServer () const throw () { return a_server; } - const Sender* getSender () const throw () { return &a_sender; } + Server* getServer () const { return a_server; } + const Sender* getSender () const { return &a_sender; } private: MyCommunicator a_communicator; @@ -114,8 +114,8 @@ private: Sender a_sender; Server* a_server; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); }; using namespace std; @@ -160,7 +160,7 @@ HeavyClient::HeavyClient () : } void HeavyClient::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -174,7 +174,7 @@ void HeavyClient::initialize () } void HeavyClient::run () - throw (RuntimeException) + noexcept(false) { a_timeController.activate (a_sender); @@ -182,7 +182,7 @@ void HeavyClient::run () } void MyCommunicator::eventReceiveMessage (ClientSocket& clientSocket, const Message& message) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("MyCommunicator", "eventReceiveMessage", ANNA_FILE_LOCATION)); @@ -193,7 +193,7 @@ void MyCommunicator::eventReceiveMessage (ClientSocket& clientSocket, const Mess } void MyCommunicator::count (const int delay) - throw (RuntimeException) + noexcept(false) { Guard guard (this, "MyCommunicator::eventReceiveMessage"); @@ -202,7 +202,7 @@ void MyCommunicator::count (const int delay) } void MyCommunicator::eventBreakConnection (const ClientSocket& clientSocket) - throw () + { if (a_rxMessageCounter == 0) return; @@ -223,7 +223,7 @@ void MyCommunicator::eventBreakConnection (const ClientSocket& clientSocket) } bool Sender::tick () - throw (RuntimeException) + noexcept(false) { Server* server = static_cast (anna::app::functions::getApp ()).getServer (); Communicator* communicator = anna::app::functions::component (ANNA_FILE_LOCATION); @@ -256,7 +256,7 @@ bool Sender::tick () } void MyHandler::evResponse (ClientSocket& clientSocket, const http::Response& response) - throw (RuntimeException) + noexcept(false) { if (response.getStatusCode () == 200) { a_testResponse.decode (response.getBody ()); @@ -291,7 +291,7 @@ void MyHandler::evResponse (ClientSocket& clientSocket, const http::Response& re } bool MyHandler::isOk (const test::Response& response) - throw () + { if (response.op != '+' && response.op != '-' && response.op != '*' && response.op != '/') return false; diff --git a/example/http/echo/main.cpp b/example/http/echo/main.cpp index 06f6ee5..0ceea9f 100644 --- a/example/http/echo/main.cpp +++ b/example/http/echo/main.cpp @@ -30,27 +30,27 @@ public: a_httpResponse.createHeader (http::Header::Type::Server)->setValue (anna_use_sccs_tag (http)); } - void setNotSend (const bool notSend) throw () { a_notSend = notSend; } + void setNotSend (const bool notSend) { a_notSend = notSend; } private: http::Response a_httpResponse; bool a_notSend; - void evRequest (ClientSocket&, const http::Request& request) throw (RuntimeException); - void evResponse (ClientSocket&, const http::Response&) throw (RuntimeException) {;} + void evRequest (ClientSocket&, const http::Request& request) noexcept(false); + void evResponse (ClientSocket&, const http::Response&) noexcept(false) {;} }; class MyCommunicator : public comm::Communicator { public: MyCommunicator () {;} - void setNotSend (const bool notSend) throw () { a_httpHandler.setNotSend (notSend); } + void setNotSend (const bool notSend) { a_httpHandler.setNotSend (notSend); } private: MyHandler a_httpHandler; void eventReceiveMessage (comm::ClientSocket &, const Message& message) - throw (RuntimeException); + noexcept(false); }; class HTTPArithmeticServer : public comm::Application { @@ -61,8 +61,8 @@ private: MyCommunicator a_communicator; comm::ServerSocket* a_serverSocket; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); }; using namespace std; @@ -105,7 +105,7 @@ HTTPArithmeticServer::HTTPArithmeticServer () : } void HTTPArithmeticServer::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -118,14 +118,14 @@ void HTTPArithmeticServer::initialize () } void HTTPArithmeticServer::run () - throw (RuntimeException) + noexcept(false) { a_communicator.attach (a_serverSocket); a_communicator.accept (); } void MyCommunicator::eventReceiveMessage (ClientSocket& clientSocket, const Message& message) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("MyCommunicator", "eventReceiveMessage", ANNA_FILE_LOCATION)); @@ -148,7 +148,7 @@ void MyCommunicator::eventReceiveMessage (ClientSocket& clientSocket, const Mess } void MyHandler::evRequest (ClientSocket& clientSocket, const http::Request& request) - throw (RuntimeException) + noexcept(false) { const DataBlock& body = request.getBody (); diff --git a/example/http/kClient/main.cpp b/example/http/kClient/main.cpp index 470eebc..082edce 100644 --- a/example/http/kClient/main.cpp +++ b/example/http/kClient/main.cpp @@ -38,8 +38,8 @@ private: http::Response a_httpResponse; test::Response a_testResponse; - void evRequest (ClientSocket&, const http::Request&) throw (RuntimeException) {;} - void evResponse (ClientSocket&, const http::Response&) throw (RuntimeException); + void evRequest (ClientSocket&, const http::Request&) noexcept(false) {;} + void evResponse (ClientSocket&, const http::Response&) noexcept(false); }; class MyCommunicator : public Communicator { @@ -55,24 +55,24 @@ private: http::Request a_httpRequest; test::Request a_testRequest; - void eventReceiveMessage (ClientSocket &, const Message&) throw (RuntimeException); - void eventUser (const char* id, const void* context) throw (); + void eventReceiveMessage (ClientSocket &, const Message&) noexcept(false); + void eventUser (const char* id, const void* context) ; }; class HTTPKClient : public anna::comm::Application { public: HTTPKClient (); - Server* getServer () const throw () { return a_server; } - const test::Menu& getMenu () const throw () { return a_menu; } + Server* getServer () const { return a_server; } + const test::Menu& getMenu () const { return a_menu; } private: MyCommunicator a_communicator; test::Menu a_menu; Server* a_server; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); }; using namespace std; @@ -112,7 +112,7 @@ HTTPKClient::HTTPKClient () : } void HTTPKClient::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -126,14 +126,14 @@ void HTTPKClient::initialize () } void HTTPKClient::run () - throw (RuntimeException) + noexcept(false) { a_menu.paint (); a_communicator.accept (); } void MyCommunicator::eventReceiveMessage (ClientSocket& clientSocket, const Message& message) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("MyCommunicator", "eventReceiveMessage", ANNA_FILE_LOCATION)); @@ -148,7 +148,7 @@ void MyCommunicator::eventReceiveMessage (ClientSocket& clientSocket, const Mess // notifica al comunicador mediante un evento de usuario. //----------------------------------------------------------------------------------------- void MyCommunicator::eventUser (const char* id, const void* context) - throw () + { LOGMETHOD (TraceMethod tm ("MyCommunicator", "eventUser", ANNA_FILE_LOCATION)); @@ -173,7 +173,7 @@ void MyCommunicator::eventUser (const char* id, const void* context) } void MyHandler::evResponse (ClientSocket& clientSocket, const http::Response& response) - throw (RuntimeException) + noexcept(false) { if (response.getStatusCode () == 200) { a_testResponse.decode (response.getBody ()); diff --git a/example/http/rServer/main.cpp b/example/http/rServer/main.cpp index 8bfea3c..99c6f4a 100644 --- a/example/http/rServer/main.cpp +++ b/example/http/rServer/main.cpp @@ -48,16 +48,16 @@ class MyHandler : public http::Handler { public: MyHandler () : http::Handler ("http_rserver::MyHandler") {;} - static const char* className () throw () { return "http_rserver::ReceiverFactory"; } + static const char* className () { return "http_rserver::ReceiverFactory"; } private: MyCommunicator* a_communicator; test::Request a_testRequest; test::Response a_testResponse; - void initialize () throw (RuntimeException); - void evRequest (ClientSocket&, const http::Request& request) throw (RuntimeException); - void evResponse (ClientSocket&, const http::Response&) throw (RuntimeException) {;} + void initialize () noexcept(false); + void evRequest (ClientSocket&, const http::Request& request) noexcept(false); + void evResponse (ClientSocket&, const http::Response&) noexcept(false) {;} }; class HTTPArithmeticServer : public comm::Application { @@ -69,9 +69,9 @@ private: ReceiverFactoryImpl a_receiverFactory; comm::ServerSocket* a_serverSocket; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); - xml::Node* asXML (xml::Node* app) const throw (); + void initialize () noexcept(false); + void run () noexcept(false); + xml::Node* asXML (xml::Node* app) const ; }; using namespace std; @@ -119,7 +119,7 @@ HTTPArithmeticServer::HTTPArithmeticServer () : } void HTTPArithmeticServer::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -136,7 +136,7 @@ void HTTPArithmeticServer::initialize () } void HTTPArithmeticServer::run () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -158,7 +158,7 @@ void HTTPArithmeticServer::run () } xml::Node* HTTPArithmeticServer::asXML (xml::Node* app) const - throw () + { xml::Node* node = app::Application::asXML (app); @@ -169,14 +169,14 @@ xml::Node* HTTPArithmeticServer::asXML (xml::Node* app) const } void MyHandler::initialize () - throw (RuntimeException) + noexcept(false) { a_communicator = app::functions::component (ANNA_FILE_LOCATION); allocateResponse ()->createHeader (http::Header::Type::Date); } void MyHandler::evRequest (ClientSocket& clientSocket, const http::Request& request) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("MyReceiver", "apply", ANNA_FILE_LOCATION)); diff --git a/example/http/server/main.cpp b/example/http/server/main.cpp index 494342d..c2849a0 100644 --- a/example/http/server/main.cpp +++ b/example/http/server/main.cpp @@ -47,8 +47,8 @@ private: test::Request a_testRequest; test::Response a_testResponse; - void evRequest (ClientSocket&, const http::Request& request) throw (RuntimeException); - void evResponse (ClientSocket&, const http::Response&) throw (RuntimeException) {;} + void evRequest (ClientSocket&, const http::Request& request) noexcept(false); + void evResponse (ClientSocket&, const http::Response&) noexcept(false) {;} }; class MyCommunicator : public test::Communicator { @@ -60,7 +60,7 @@ public: private: ThreadData a_contexts; - void eventReceiveMessage (comm::ClientSocket&, const Message&) throw (RuntimeException); + void eventReceiveMessage (comm::ClientSocket&, const Message&) noexcept(false); }; class HTTPArithmeticServer : public comm::Application { @@ -71,9 +71,9 @@ private: MyCommunicator a_communicator; comm::ServerSocket* a_serverSocket; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); - xml::Node* asXML (xml::Node* app) const throw (); + void initialize () noexcept(false); + void run () noexcept(false); + xml::Node* asXML (xml::Node* app) const ; }; using namespace std; @@ -120,7 +120,7 @@ HTTPArithmeticServer::HTTPArithmeticServer () : } void HTTPArithmeticServer::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -131,7 +131,7 @@ void HTTPArithmeticServer::initialize () } void HTTPArithmeticServer::run () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -153,7 +153,7 @@ void HTTPArithmeticServer::run () } xml::Node* HTTPArithmeticServer::asXML (xml::Node* app) const - throw () + { xml::Node* node = app::Application::asXML (app); @@ -164,7 +164,7 @@ xml::Node* HTTPArithmeticServer::asXML (xml::Node* app) const } void MyCommunicator::eventReceiveMessage (ClientSocket& clientSocket, const Message& message) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("MyCommunicator", "eventReceiveMessage", ANNA_FILE_LOCATION)); @@ -182,7 +182,7 @@ void MyCommunicator::eventReceiveMessage (ClientSocket& clientSocket, const Mess } void MyHandler::evRequest (ClientSocket& clientSocket, const http::Request& request) - throw (RuntimeException) + noexcept(false) { const DataBlock& body = request.getBody (); diff --git a/example/http/wims20Client/main.cpp b/example/http/wims20Client/main.cpp index 0d5b49b..36522ef 100644 --- a/example/http/wims20Client/main.cpp +++ b/example/http/wims20Client/main.cpp @@ -35,8 +35,8 @@ public: private: http::Response a_httpResponse; - void evRequest (ClientSocket&, const http::Request&) throw (RuntimeException) {;} - void evResponse (ClientSocket&, const http::Response&) throw (RuntimeException); + void evRequest (ClientSocket&, const http::Request&) noexcept(false) {;} + void evResponse (ClientSocket&, const http::Response&) noexcept(false); }; class MyCommunicator : public Communicator { @@ -51,22 +51,22 @@ private: MyHandler a_httpHandler; http::Request a_httpRequest; - void eventReceiveMessage (ClientSocket &, const Message&) throw (RuntimeException); - void eventStartup () throw (RuntimeException); + void eventReceiveMessage (ClientSocket &, const Message&) noexcept(false); + void eventStartup () noexcept(false); }; class IHTTPClient : public anna::comm::Application { public: IHTTPClient (); - Server* getServer () const throw () { return a_server; } + Server* getServer () const { return a_server; } private: MyCommunicator a_communicator; Server* a_server; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); }; using namespace std; @@ -112,7 +112,7 @@ IHTTPClient::IHTTPClient () : } void IHTTPClient::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -127,13 +127,13 @@ void IHTTPClient::initialize () } void IHTTPClient::run () - throw (RuntimeException) + noexcept(false) { a_communicator.accept (); } void MyCommunicator::eventStartup () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -168,7 +168,7 @@ void MyCommunicator::eventStartup () } void MyCommunicator::eventReceiveMessage (ClientSocket& clientSocket, const Message& message) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("MyCommunicator", "eventReceiveMessage", ANNA_FILE_LOCATION)); @@ -179,7 +179,7 @@ void MyCommunicator::eventReceiveMessage (ClientSocket& clientSocket, const Mess } void MyHandler::evResponse (ClientSocket& clientSocket, const http::Response& response) - throw (RuntimeException) + noexcept(false) { cout << "HTTP StatusCode: " << response.getStatusCode () << endl; cout << "HTTP Text: " << response.getReasonPhrase () << endl; diff --git a/example/http/wims20RServer/main.cpp b/example/http/wims20RServer/main.cpp index f56c20f..36f728d 100644 --- a/example/http/wims20RServer/main.cpp +++ b/example/http/wims20RServer/main.cpp @@ -44,15 +44,15 @@ class MyHandler : public http::Handler { public: MyHandler () : http::Handler ("wims20_rserver::MyHandler"), a_request (NULL) {;} - static const char* className () throw () { return "wims20_rserver::ReceiverFactory"; } + static const char* className () { return "wims20_rserver::ReceiverFactory"; } private: MyCommunicator* a_communicator; http::wims20::ServerSide* a_request; - void initialize () throw (RuntimeException); - void evRequest (ClientSocket&, const http::Request& request) throw (RuntimeException); - void evResponse (ClientSocket&, const http::Response&) throw (RuntimeException) {;} + void initialize () noexcept(false); + void evRequest (ClientSocket&, const http::Request& request) noexcept(false); + void evResponse (ClientSocket&, const http::Response&) noexcept(false) {;} }; class HTTPArithmeticServer : public comm::Application { @@ -64,8 +64,8 @@ private: ReceiverFactoryImpl a_receiverFactory; comm::ServerSocket* a_serverSocket; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); }; using namespace std; @@ -109,7 +109,7 @@ HTTPArithmeticServer::HTTPArithmeticServer () : } void HTTPArithmeticServer::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -123,7 +123,7 @@ void HTTPArithmeticServer::initialize () } void HTTPArithmeticServer::run () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -136,7 +136,7 @@ void HTTPArithmeticServer::run () } void MyHandler::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -162,7 +162,7 @@ void MyHandler::initialize () // Observar que la correspondería con las parte other_possible_levels // de la especificación WIMS 2.0 void MyHandler::evRequest (ClientSocket& clientSocket, const http::Request& request) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("MyReceiver", "apply", ANNA_FILE_LOCATION)); diff --git a/example/http/wims20XClient/main.cpp b/example/http/wims20XClient/main.cpp index 9784f31..1169e8a 100644 --- a/example/http/wims20XClient/main.cpp +++ b/example/http/wims20XClient/main.cpp @@ -53,10 +53,10 @@ public: a_httpRequest.setMethod (http::Method::Type::Get); } - void setMessageBySecond (const int messageBySecond) throw () { a_messageByTick = messageBySecond / (OneSecond / Period); } - void setRequest (http::wims20::ClientSide* request) throw () { a_request = request; } + void setMessageBySecond (const int messageBySecond) { a_messageByTick = messageBySecond / (OneSecond / Period); } + void setRequest (http::wims20::ClientSide* request) { a_request = request; } - int getTxMessageCounter () const throw () { return a_txMessageCounter; } + int getTxMessageCounter () const { return a_txMessageCounter; } private: int a_messageByTick; @@ -67,7 +67,7 @@ private: http::wims20::ClientSide* a_request; /* Se invoca 4 veces por segundo */ - bool tick () throw (RuntimeException); + bool tick () noexcept(false); }; class MyHandler : public http::Handler { @@ -77,20 +77,20 @@ public: private: xml::DocumentMemory a_xmlResponse; - void evRequest (ClientSocket&, const http::Request&) throw (RuntimeException) {;} - void evResponse (ClientSocket&, const http::Response&) throw (RuntimeException); + void evRequest (ClientSocket&, const http::Request&) noexcept(false) {;} + void evResponse (ClientSocket&, const http::Response&) noexcept(false); -// static bool isOk (const test::Response& response) throw (); +// static bool isOk (const test::Response& response) ; }; class MyCommunicator : public comm::Communicator { public: MyCommunicator () : comm::Communicator (), a_avgResponseTime (0), a_rxMessageCounter (0) {;} - void count (const Millisecond delay) throw (RuntimeException); + void count (const Millisecond delay) noexcept(false); // Sustituye la redefinición de los siguientes métodos - void eventBreakConnection (const comm::ClientSocket&) throw (); + void eventBreakConnection (const comm::ClientSocket&) ; using comm::Communicator::eventBreakConnection; private: @@ -98,15 +98,15 @@ private: int a_rxMessageCounter; MyHandler a_httpHandler; - void eventReceiveMessage (ClientSocket&, const Message&) throw (RuntimeException); + void eventReceiveMessage (ClientSocket&, const Message&) noexcept(false); }; class HeavyWIMS20Client : public anna::comm::Application { public: HeavyWIMS20Client (); - Server* getServer () const throw () { return a_server; } - const Sender* getSender () const throw () { return &a_sender; } + Server* getServer () const { return a_server; } + const Sender* getSender () const { return &a_sender; } private: MyCommunicator a_communicator; @@ -115,8 +115,8 @@ private: Server* a_server; http::wims20::ClientSide* a_request; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); }; using namespace std; @@ -167,7 +167,7 @@ HeavyWIMS20Client::HeavyWIMS20Client () : } void HeavyWIMS20Client::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -196,7 +196,7 @@ void HeavyWIMS20Client::initialize () } void HeavyWIMS20Client::run () - throw (RuntimeException) + noexcept(false) { a_timeController.activate (a_sender); @@ -204,7 +204,7 @@ void HeavyWIMS20Client::run () } void MyCommunicator::eventReceiveMessage (ClientSocket& clientSocket, const Message& message) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("MyCommunicator", "eventReceiveMessage", ANNA_FILE_LOCATION)); @@ -215,7 +215,7 @@ void MyCommunicator::eventReceiveMessage (ClientSocket& clientSocket, const Mess } void MyCommunicator::count (const Millisecond delay) - throw (RuntimeException) + noexcept(false) { Guard guard (this, "MyCommunicator::count"); @@ -224,7 +224,7 @@ void MyCommunicator::count (const Millisecond delay) } void MyCommunicator::eventBreakConnection (const ClientSocket& clientSocket) - throw () + { if (a_rxMessageCounter == 0) { LOGWARNING ( @@ -251,7 +251,7 @@ void MyCommunicator::eventBreakConnection (const ClientSocket& clientSocket) } bool Sender::tick () - throw (RuntimeException) + noexcept(false) { Server* server = static_cast (anna::app::functions::getApp ()).getServer (); Communicator* communicator = anna::app::functions::component (ANNA_FILE_LOCATION); @@ -284,7 +284,7 @@ bool Sender::tick () } void MyHandler::evResponse (ClientSocket& clientSocket, const http::Response& response) - throw (RuntimeException) + noexcept(false) { TraceMethod tm ("MyHandler", "evResponse", ANNA_FILE_LOCATION); diff --git a/example/http/wims20XRServer/main.cpp b/example/http/wims20XRServer/main.cpp index 667b7fb..511d560 100644 --- a/example/http/wims20XRServer/main.cpp +++ b/example/http/wims20XRServer/main.cpp @@ -50,7 +50,7 @@ public: delete a_request; } - static const char* className () throw () { return "http_rserver::ReceiverFactory"; } + static const char* className () { return "http_rserver::ReceiverFactory"; } private: struct Attribute { enum _v { ValueOne, ValueTwo, Operator, Result, Time, Max }; }; @@ -62,9 +62,9 @@ private: std::string a_serviceID; std::string a_guid; - void initialize () throw (RuntimeException); - void evRequest (ClientSocket&, const http::Request& request) throw (RuntimeException); - void evResponse (ClientSocket&, const http::Response&) throw (RuntimeException) {;} + void initialize () noexcept(false); + void evRequest (ClientSocket&, const http::Request& request) noexcept(false); + void evResponse (ClientSocket&, const http::Response&) noexcept(false) {;} }; class WIMS20ArithmeticServer : public comm::Application { @@ -76,9 +76,9 @@ private: ReceiverFactoryImpl a_receiverFactory; comm::ServerSocket* a_serverSocket; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); - xml::Node* asXML (xml::Node* app) const throw (); + void initialize () noexcept(false); + void run () noexcept(false); + xml::Node* asXML (xml::Node* app) const ; }; using namespace std; @@ -129,7 +129,7 @@ WIMS20ArithmeticServer::WIMS20ArithmeticServer () : } void WIMS20ArithmeticServer::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -146,7 +146,7 @@ void WIMS20ArithmeticServer::initialize () } void WIMS20ArithmeticServer::run () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -168,7 +168,7 @@ void WIMS20ArithmeticServer::run () } xml::Node* WIMS20ArithmeticServer::asXML (xml::Node* app) const - throw () + { xml::Node* node = app::Application::asXML (app); @@ -179,7 +179,7 @@ xml::Node* WIMS20ArithmeticServer::asXML (xml::Node* app) const } void MyHandler::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -209,7 +209,7 @@ void MyHandler::initialize () * URI: http://www.localhost.es/math/user@tid.es?Operator=*&ValueOne=20&ValueTwo=2&Time=10000 */ void MyHandler::evRequest (ClientSocket& clientSocket, const http::Request& request) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("MyReceiver", "apply", ANNA_FILE_LOCATION)); diff --git a/example/http/xmlClient/main.cpp b/example/http/xmlClient/main.cpp index d845b6f..ba2ad66 100644 --- a/example/http/xmlClient/main.cpp +++ b/example/http/xmlClient/main.cpp @@ -44,9 +44,9 @@ class Sender : public anna::timex::Clock { public: Sender (); - void setMessageBySecond (const int messageBySecond) throw () { a_messageByTick = messageBySecond / (OneSecond / Period); } + void setMessageBySecond (const int messageBySecond) { a_messageByTick = messageBySecond / (OneSecond / Period); } - int getTxMessageCounter () const throw () { return a_txMessageCounter; } + int getTxMessageCounter () const { return a_txMessageCounter; } private: struct Attribute { enum _v { ValueOne, ValueTwo, Operator, Time, Max }; }; @@ -60,7 +60,7 @@ private: xml::Attribute* a_xmlAttributes [Attribute::Max]; /* Se invoca 4 veces por segundo */ - bool tick () throw (RuntimeException); + bool tick () noexcept(false); }; class MyHandler : public http::Handler { @@ -71,17 +71,17 @@ private: xml::DocumentMemory a_xmlRequest; xml::Parser a_xmlParser; - void evRequest (ClientSocket&, const http::Request&) throw (RuntimeException) {;} - void evResponse (ClientSocket&, const http::Response&) throw (RuntimeException); + void evRequest (ClientSocket&, const http::Request&) noexcept(false) {;} + void evResponse (ClientSocket&, const http::Response&) noexcept(false); -// static bool isOk (const test::Response& response) throw (); +// static bool isOk (const test::Response& response) ; }; class MyCommunicator : public Communicator { public: MyCommunicator () : Communicator (), a_avgResponseTime (0), a_rxMessageCounter (0) {;} - void count (const int delay) throw (RuntimeException); + void count (const int delay) noexcept(false); private: int a_avgResponseTime; @@ -89,17 +89,17 @@ private: MyHandler a_httpHandler; - void eventReceiveMessage (ClientSocket&, const Message&) throw (RuntimeException); + void eventReceiveMessage (ClientSocket&, const Message&) noexcept(false); - void eventBreakConnection (const ClientSocket&) throw (); + void eventBreakConnection (const ClientSocket&) ; // Sustituye la redefinición de los siguientes métodos using comm::Communicator::eventBreakConnection; /* - void eventBreakConnection (Server* server) throw () { + void eventBreakConnection (Server* server) { comm::Communicator::eventBreakConnection (server); } - void eventBreakConnection (const Service* service) throw () { + void eventBreakConnection (const Service* service) { comm::Communicator::eventBreakConnection (service); } */ @@ -109,8 +109,8 @@ class HeavyWIMS20Client : public anna::comm::Application { public: HeavyWIMS20Client (); - Server* getServer () const throw () { return a_server; } - const Sender* getSender () const throw () { return &a_sender; } + Server* getServer () const { return a_server; } + const Sender* getSender () const { return &a_sender; } private: MyCommunicator a_communicator; @@ -118,8 +118,8 @@ private: Sender a_sender; Server* a_server; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); }; using namespace std; @@ -164,7 +164,7 @@ HeavyWIMS20Client::HeavyWIMS20Client () : } void HeavyWIMS20Client::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -178,7 +178,7 @@ void HeavyWIMS20Client::initialize () } void HeavyWIMS20Client::run () - throw (RuntimeException) + noexcept(false) { a_timeController.activate (a_sender); @@ -186,7 +186,7 @@ void HeavyWIMS20Client::run () } void MyCommunicator::eventReceiveMessage (ClientSocket& clientSocket, const Message& message) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("MyCommunicator", "eventReceiveMessage", ANNA_FILE_LOCATION)); @@ -197,7 +197,7 @@ void MyCommunicator::eventReceiveMessage (ClientSocket& clientSocket, const Mess } void MyCommunicator::count (const int delay) - throw (RuntimeException) + noexcept(false) { Guard guard (this, "MyCommunicator::count"); @@ -206,7 +206,7 @@ void MyCommunicator::count (const int delay) } void MyCommunicator::eventBreakConnection (const ClientSocket& clientSocket) - throw () + { if (a_rxMessageCounter == 0) return; @@ -247,7 +247,7 @@ Sender::Sender () : Clock ("Sender", Period), } bool Sender::tick () - throw (RuntimeException) + noexcept(false) { Server* server = static_cast (anna::app::functions::getApp ()).getServer (); Communicator* communicator = anna::app::functions::component (ANNA_FILE_LOCATION); @@ -280,7 +280,7 @@ bool Sender::tick () } void MyHandler::evResponse (ClientSocket& clientSocket, const http::Response& response) - throw (RuntimeException) + noexcept(false) { if (response.getStatusCode () != 200) return; diff --git a/example/http/xmlRServer/main.cpp b/example/http/xmlRServer/main.cpp index f9f4307..5790ce6 100644 --- a/example/http/xmlRServer/main.cpp +++ b/example/http/xmlRServer/main.cpp @@ -47,7 +47,7 @@ public: ~MyHandler () { } - static const char* className () throw () { return "http_rserver::ReceiverFactory"; } + static const char* className () { return "http_rserver::ReceiverFactory"; } private: struct Attribute { enum _v { ValueOne, ValueTwo, Operator, Result, Time, Max }; }; @@ -57,9 +57,9 @@ private: xml::Node* a_xmlResponse; xml::Attribute* a_xmlAttributes [Attribute::Max]; - void initialize () throw (RuntimeException); - void evRequest (ClientSocket&, const http::Request& request) throw (RuntimeException); - void evResponse (ClientSocket&, const http::Response&) throw (RuntimeException) {;} + void initialize () noexcept(false); + void evRequest (ClientSocket&, const http::Request& request) noexcept(false); + void evResponse (ClientSocket&, const http::Response&) noexcept(false) {;} }; class WIMS20ArithmeticServer : public comm::Application { @@ -71,9 +71,9 @@ private: ReceiverFactoryImpl a_receiverFactory; comm::ServerSocket* a_serverSocket; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); - xml::Node* asXML (xml::Node* app) const throw (); + void initialize () noexcept(false); + void run () noexcept(false); + xml::Node* asXML (xml::Node* app) const ; }; using namespace std; @@ -121,7 +121,7 @@ WIMS20ArithmeticServer::WIMS20ArithmeticServer () : } void WIMS20ArithmeticServer::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -138,7 +138,7 @@ void WIMS20ArithmeticServer::initialize () } void WIMS20ArithmeticServer::run () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -160,7 +160,7 @@ void WIMS20ArithmeticServer::run () } xml::Node* WIMS20ArithmeticServer::asXML (xml::Node* app) const - throw () + { xml::Node* node = app::Application::asXML (app); @@ -171,7 +171,7 @@ xml::Node* WIMS20ArithmeticServer::asXML (xml::Node* app) const } void MyHandler::initialize () - throw (RuntimeException) + noexcept(false) { a_communicator = app::functions::component (ANNA_FILE_LOCATION); @@ -191,7 +191,7 @@ void MyHandler::initialize () * Recibe una peticion */ void MyHandler::evRequest (ClientSocket& clientSocket, const http::Request& httpRequest) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("MyReceiver", "apply", ANNA_FILE_LOCATION)); diff --git a/example/http/xmlSender/main.cpp b/example/http/xmlSender/main.cpp index abcd844..2c924ac 100644 --- a/example/http/xmlSender/main.cpp +++ b/example/http/xmlSender/main.cpp @@ -38,8 +38,8 @@ public: private: http::Response a_httpResponse; - void evRequest (ClientSocket&, const http::Request&) throw (RuntimeException) {;} - void evResponse (ClientSocket&, const http::Response&) throw (RuntimeException); + void evRequest (ClientSocket&, const http::Request&) noexcept(false) {;} + void evResponse (ClientSocket&, const http::Response&) noexcept(false); }; class MyCommunicator : public Communicator { @@ -56,23 +56,23 @@ private: MyHandler a_httpHandler; http::Request a_httpRequest; - void eventReceiveMessage (ClientSocket &, const Message&) throw (RuntimeException); - void eventBreakConnection (Server* server) throw (); - void eventStartup () throw (RuntimeException); + void eventReceiveMessage (ClientSocket &, const Message&) noexcept(false); + void eventBreakConnection (Server* server) ; + void eventStartup () noexcept(false); }; class IHTTPClient : public anna::comm::Application { public: IHTTPClient (); - Server* getServer () const throw () { return a_server; } + Server* getServer () const { return a_server; } private: MyCommunicator a_communicator; Server* a_server; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); }; using namespace std; @@ -120,7 +120,7 @@ IHTTPClient::IHTTPClient () : } void IHTTPClient::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -137,13 +137,13 @@ void IHTTPClient::initialize () } void IHTTPClient::run () - throw (RuntimeException) + noexcept(false) { a_communicator.accept (); } void MyCommunicator::eventStartup () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -213,7 +213,7 @@ void MyCommunicator::eventStartup () } void MyCommunicator::eventReceiveMessage (ClientSocket& clientSocket, const Message& message) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("MyCommunicator", "eventReceiveMessage", ANNA_FILE_LOCATION)); @@ -224,14 +224,14 @@ void MyCommunicator::eventReceiveMessage (ClientSocket& clientSocket, const Mess } void MyCommunicator::eventBreakConnection (Server* server) - throw () + { cout << "Perdida conexion con " << server->asString () << endl; requestStop (); } void MyHandler::evResponse (ClientSocket& clientSocket, const http::Response& response) - throw (RuntimeException) + noexcept(false) { const DataBlock& body = response.getBody (); diff --git a/example/io/reader/reader.cpp b/example/io/reader/reader.cpp index 9e6c466..f42f2fc 100644 --- a/example/io/reader/reader.cpp +++ b/example/io/reader/reader.cpp @@ -17,10 +17,10 @@ class Test : public anna::app::Application { public: Test (); - void initialize () throw (anna::RuntimeException); + void initialize () noexcept(false); private: - void run () throw (anna::RuntimeException); + void run () noexcept(false); }; using namespace std; @@ -57,12 +57,12 @@ Test::Test () : } void Test::initialize () - throw (RuntimeException) + noexcept(false) { } void Test::run () - throw (RuntimeException) + noexcept(false) { CommandLine& commandLine (CommandLine::instantiate ()); diff --git a/example/ldap/tSearch/main.cpp b/example/ldap/tSearch/main.cpp index 6799176..00ed541 100644 --- a/example/ldap/tSearch/main.cpp +++ b/example/ldap/tSearch/main.cpp @@ -24,7 +24,7 @@ #include class MySession : public ldap::Session { - void eventResponse (const ldap::Response&) throw (RuntimeException); + void eventResponse (const ldap::Response&) noexcept(false); }; class MyEngine : public ldap::Engine { @@ -34,9 +34,9 @@ public: private: Recycler a_sessions; - ldap::Session* allocateSession (const int category) throw () { return a_sessions.create (); } + ldap::Session* allocateSession (const int category) { return a_sessions.create (); } - void releaseSession (ldap::Session* session) throw () { + void releaseSession (ldap::Session* session) { MySession* aux = static_cast (session); a_sessions.release (aux); } @@ -57,26 +57,26 @@ public: MyCommunicator () : comm::Communicator () { ;} private: - void eventReceiveMessage (comm::ClientSocket &, const comm::Message&) throw (RuntimeException) {;} + void eventReceiveMessage (comm::ClientSocket &, const comm::Message&) noexcept(false) {;} }; class Buddy : public Clock { public: Buddy () : Clock ("buddy", (Millisecond)2000) {;} - void setLDAPEngine (ldap::Engine& ldapEngine) throw () { a_ldapEngine = &ldapEngine; } + void setLDAPEngine (ldap::Engine& ldapEngine) { a_ldapEngine = &ldapEngine; } private: ldap::Engine* a_ldapEngine; ldap::Search a_ldapSearch; - bool tick () throw (RuntimeException); + bool tick () noexcept(false); }; class Stopper : public Timer { public: Stopper () : Timer ("stopper", (Millisecond)0) {;} - void expire (Engine*) throw (RuntimeException); + void expire (Engine*) noexcept(false); }; class LDAPClient : public anna::comm::Application { @@ -90,7 +90,7 @@ private: Buddy a_buddy; Stopper a_stopper; - void run () throw (RuntimeException); + void run () noexcept(false); }; using namespace std; @@ -141,7 +141,7 @@ LDAPClient::LDAPClient () : // (1) Para evitar la ejecucion de la aplicacion en caso de indicar un valor no valido. //----------------------------------------------------------------------------------------- void LDAPClient::run () - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("LDAPClient", "run", ANNA_FILE_LOCATION)); @@ -168,7 +168,7 @@ void LDAPClient::run () } void MySession::eventResponse (const ldap::Response& response) - throw (RuntimeException) + noexcept(false) { cout << "LDAP Response: " << response.asString () << endl; cout << " Name: " << response.getName () << endl; @@ -194,7 +194,7 @@ void MySession::eventResponse (const ldap::Response& response) } bool Buddy::tick () - throw (RuntimeException) + noexcept(false) { CommandLine& cl = CommandLine::instantiate (); @@ -222,7 +222,7 @@ bool Buddy::tick () } void Stopper::expire (Engine*) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("Stopper", "expire", ANNA_FILE_LOCATION)); diff --git a/example/timex/ArithmeticHTTPServer/Acceptor.cpp b/example/timex/ArithmeticHTTPServer/Acceptor.cpp index 5f7ad8c..47a79d7 100644 --- a/example/timex/ArithmeticHTTPServer/Acceptor.cpp +++ b/example/timex/ArithmeticHTTPServer/Acceptor.cpp @@ -27,12 +27,12 @@ using namespace anna; using namespace test; void http4comm::Acceptor::initialize () - throw (RuntimeException) + noexcept(false) { } void http4comm::Acceptor::evRequest (comm::ClientSocket& clientSocket, const http::Request& request) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("http4comm::Acceptor", "evRequest", ANNA_FILE_LOCATION)); diff --git a/example/timex/ArithmeticHTTPServer/Acceptor.hpp b/example/timex/ArithmeticHTTPServer/Acceptor.hpp index 7a59009..99438ab 100644 --- a/example/timex/ArithmeticHTTPServer/Acceptor.hpp +++ b/example/timex/ArithmeticHTTPServer/Acceptor.hpp @@ -31,15 +31,15 @@ class Acceptor : public http::Handler { public: Acceptor () : http::Handler ("http4comm::Acceptor") {;} - static const char* className () throw () { return "http4comm::Acceptor"; } + static const char* className () { return "http4comm::Acceptor"; } private: Request a_testRequest; Response a_testResponse; - void initialize () throw (RuntimeException); - void evRequest (comm::ClientSocket&, const http::Request& request) throw (RuntimeException); - void evResponse (comm::ClientSocket&, const http::Response&) throw (RuntimeException) {;} + void initialize () noexcept(false); + void evRequest (comm::ClientSocket&, const http::Request& request) noexcept(false); + void evResponse (comm::ClientSocket&, const http::Response&) noexcept(false) {;} }; } diff --git a/example/timex/ArithmeticHTTPServer/Application.cpp b/example/timex/ArithmeticHTTPServer/Application.cpp index 288bde8..d784262 100644 --- a/example/timex/ArithmeticHTTPServer/Application.cpp +++ b/example/timex/ArithmeticHTTPServer/Application.cpp @@ -45,7 +45,7 @@ http4comm::Application::Application () : } void http4comm::Application::initialize () - throw (RuntimeException) + noexcept(false) { using namespace anna::comm; @@ -95,7 +95,7 @@ void http4comm::Application::initialize () } void http4comm::Application::run () - throw (RuntimeException) + noexcept(false) { a_communicator->accept (); } diff --git a/example/timex/ArithmeticHTTPServer/Application.hpp b/example/timex/ArithmeticHTTPServer/Application.hpp index 457f924..3c3ca09 100644 --- a/example/timex/ArithmeticHTTPServer/Application.hpp +++ b/example/timex/ArithmeticHTTPServer/Application.hpp @@ -37,8 +37,8 @@ class Application : public comm::Application { public: Application (); - comm::IndexedDelivery* getService () throw () { return a_service; } - http4comm::Context* getContext () throw () { return a_context; } + comm::IndexedDelivery* getService () { return a_service; } + http4comm::Context* getContext () { return a_context; } private: comm::Communicator* a_communicator; @@ -50,8 +50,8 @@ private: comm::ServerSocket* a_serverSocket; comm::IndexedDelivery* a_service; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); }; } diff --git a/example/timex/ArithmeticHTTPServer/Context.cpp b/example/timex/ArithmeticHTTPServer/Context.cpp index ac15f45..7a3e618 100644 --- a/example/timex/ArithmeticHTTPServer/Context.cpp +++ b/example/timex/ArithmeticHTTPServer/Context.cpp @@ -25,7 +25,7 @@ http4comm::Context::Context (anna::timex::Engine& timeController, const Millisec {;} void http4comm::Context::create (const S64 id, comm::ClientSocket& clientSocket) - throw (RuntimeException) + noexcept(false) { http4comm::Transaction* transaction = static_cast (anna::timex::Context ::open (id, 0)); @@ -45,7 +45,7 @@ void http4comm::Context::create (const S64 id, comm::ClientSocket& clientSocket) * crearía una nueva instancia. */ anna::timex::Transaction* http4comm::Context::createTransaction (const int /*classType*/) - throw () + { // Si nuestra aplicación tratara más de un tipo de transación tendríamos que obtenerla de // distintos Recycler, uno para cada tipo de transacción. @@ -56,7 +56,7 @@ anna::timex::Transaction* http4comm::Context::createTransaction (const int /*cla * Cuando la instancia dela transación no se esté usando se marca como no-usada. */ void http4comm::Context::releaseTransaction (anna::timex::Transaction* tt) - throw () + { // Si nuestra aplicación tratata más de un tipo tendríamos que obtener el tipo // de la transación y liberar la transación en el Recycler adecuado. @@ -69,7 +69,7 @@ void http4comm::Context::releaseTransaction (anna::timex::Transaction* tt) * Interpreta el identificador de la transación como cadena */ string http4comm::Context::identifierAsString (const S64& id) const - throw () + { return functions::asHexString (id); } @@ -78,7 +78,7 @@ string http4comm::Context::identifierAsString (const S64& id) const * Interpreta el contexto de la transación para obtener su Id de aplicación. */ const S64& http4comm::Context::contextAsIdentifier (const void* cc) const - throw () + { return *((S64*) cc); } diff --git a/example/timex/ArithmeticHTTPServer/Context.hpp b/example/timex/ArithmeticHTTPServer/Context.hpp index d10e6a0..2d8c847 100644 --- a/example/timex/ArithmeticHTTPServer/Context.hpp +++ b/example/timex/ArithmeticHTTPServer/Context.hpp @@ -29,17 +29,17 @@ class Context : public anna::timex::Context { public: Context (anna::timex::Engine&, const Millisecond& timeout); - void create (const S64 id, comm::ClientSocket&) throw (RuntimeException); - void destroy (Transaction*) throw (); + void create (const S64 id, comm::ClientSocket&) noexcept(false); + void destroy (Transaction*) ; private: Recycler a_transactions; - anna::timex::Transaction* createTransaction (const int /*classType*/) throw (); - void releaseTransaction (anna::timex::Transaction* tt) throw (); + anna::timex::Transaction* createTransaction (const int /*classType*/) ; + void releaseTransaction (anna::timex::Transaction* tt) ; - std::string identifierAsString (const S64&) const throw (); - const S64& contextAsIdentifier (const void*) const throw (); + std::string identifierAsString (const S64&) const ; + const S64& contextAsIdentifier (const void*) const ; Context (const Context&); }; diff --git a/example/timex/ArithmeticHTTPServer/Reactor.cpp b/example/timex/ArithmeticHTTPServer/Reactor.cpp index 3c28f45..0f8ff36 100644 --- a/example/timex/ArithmeticHTTPServer/Reactor.cpp +++ b/example/timex/ArithmeticHTTPServer/Reactor.cpp @@ -28,7 +28,7 @@ using namespace test; * cliente original que usaba el protocolo HTTP. */ void http4comm::Reactor::apply (comm::ClientSocket&, const comm::Message& message) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("http4comm::Reactor", "apply", ANNA_FILE_LOCATION)); diff --git a/example/timex/ArithmeticHTTPServer/Reactor.hpp b/example/timex/ArithmeticHTTPServer/Reactor.hpp index 949db90..c792761 100644 --- a/example/timex/ArithmeticHTTPServer/Reactor.hpp +++ b/example/timex/ArithmeticHTTPServer/Reactor.hpp @@ -27,14 +27,14 @@ public: Reactor () : comm::Receiver ("http4comm::Reactor") {;} virtual ~Reactor() {;} - static const char* className () throw () { return "http4comm::Reactor"; } + static const char* className () { return "http4comm::Reactor"; } private: Request a_request; Response a_response; http::Response a_httpResponse; - void apply (comm::ClientSocket&, const comm::Message&) throw (RuntimeException); + void apply (comm::ClientSocket&, const comm::Message&) noexcept(false); }; } diff --git a/example/timex/ArithmeticHTTPServer/Transaction.cpp b/example/timex/ArithmeticHTTPServer/Transaction.cpp index 423d1f5..8aad389 100644 --- a/example/timex/ArithmeticHTTPServer/Transaction.cpp +++ b/example/timex/ArithmeticHTTPServer/Transaction.cpp @@ -30,7 +30,7 @@ http4comm::Transaction::Transaction () : * de la transación se contesta al cliente con un error indicando la situación. */ void http4comm::Transaction::expire (anna::timex::Engine*) - throw (RuntimeException) + noexcept(false) { comm::Communicator* communicator = app::functions::component (ANNA_FILE_LOCATION); diff --git a/example/timex/ArithmeticHTTPServer/Transaction.hpp b/example/timex/ArithmeticHTTPServer/Transaction.hpp index ea067ab..6521d11 100644 --- a/example/timex/ArithmeticHTTPServer/Transaction.hpp +++ b/example/timex/ArithmeticHTTPServer/Transaction.hpp @@ -30,7 +30,7 @@ class Transaction : public anna::timex::Transaction { public: Transaction (); - comm::ClientSocket* getClientSocket () throw () { return a_clientSocket; } + comm::ClientSocket* getClientSocket () { return a_clientSocket; } void setClientSocket (comm::ClientSocket* clientSocket) { a_clientSocket = clientSocket; } @@ -38,7 +38,7 @@ private: comm::ClientSocket* a_clientSocket; http::Response* a_httpResponse; - void expire (anna::timex::Engine*) throw (RuntimeException); + void expire (anna::timex::Engine*) noexcept(false); }; } diff --git a/example/xml/xmlBasic/main.cpp b/example/xml/xmlBasic/main.cpp index efac62c..2d39efc 100644 --- a/example/xml/xmlBasic/main.cpp +++ b/example/xml/xmlBasic/main.cpp @@ -20,7 +20,7 @@ public: Test (); private: - void run () throw (anna::RuntimeException); + void run () noexcept(false); }; using namespace std; @@ -59,7 +59,7 @@ Test::Test () : } void Test::run () - throw (RuntimeException) + noexcept(false) { CommandLine& commandLine (CommandLine::instantiate ()); diff --git a/example/xml/xmlBinary/main.cpp b/example/xml/xmlBinary/main.cpp index 967f8da..fe50561 100644 --- a/example/xml/xmlBinary/main.cpp +++ b/example/xml/xmlBinary/main.cpp @@ -20,7 +20,7 @@ public: Test (); private: - void run () throw (anna::RuntimeException); + void run () noexcept(false); }; using namespace std; @@ -57,7 +57,7 @@ Test::Test () : } void Test::run () - throw (RuntimeException) + noexcept(false) { CommandLine& commandLine (CommandLine::instantiate ()); diff --git a/example/xml/xpath/main.cpp b/example/xml/xpath/main.cpp index f355883..3e903a6 100644 --- a/example/xml/xpath/main.cpp +++ b/example/xml/xpath/main.cpp @@ -20,7 +20,7 @@ public: Test (); private: - void run () throw (anna::RuntimeException); + void run () noexcept(false); }; using namespace std; @@ -59,7 +59,7 @@ Test::Test () : } void Test::run () - throw (RuntimeException) + noexcept(false) { CommandLine& commandLine (CommandLine::instantiate ()); diff --git a/include/anna/app/Application.hpp b/include/anna/app/Application.hpp index e4754cf..8e868a6 100644 --- a/include/anna/app/Application.hpp +++ b/include/anna/app/Application.hpp @@ -61,31 +61,31 @@ public: Short name given in constructor. \return Short name given in constructor. */ - const char* getShortName() const throw() { return a_shortName; } + const char* getShortName() const { return a_shortName; } /** Version given in constructor. \return Version given in constructor. */ - const std::string& getVersion() const throw() { return a_version; } + const std::string& getVersion() const { return a_version; } /** Devuelve el titulo indicado en el contructor de esta aplicacion. \return el titulo indicado en el contructor de esta aplicacion. */ - const std::string& getTitle() const throw() { return a_title; } + const std::string& getTitle() const { return a_title; } /** Devuelve el pid asignado por el sistema operativo a la aplicacion que estamos ejecutando. @return El pid asignado por el sistema operativo a la aplicacion que estamos ejecutando. */ - pid_t getPid() const throw() { return a_pid; } + pid_t getPid() const { return a_pid; } /** Activa la salida por pantalla del mensaje referente a la licencia GPL 3.0. \warning Para que tenga efecto debe ser invocado antes de ejecutar el metodo Application::start. */ - void activateGeneralPublicLicense() throw() { a_enableGPL = true; } + void activateGeneralPublicLicense() { a_enableGPL = true; } /** * Crea un nuevo proceso a partir de este usando el metodo \em fork. @@ -99,50 +99,50 @@ public: * Para saber en cual de los procesos * \return La instancia de la nueva aplicacion. */ - Application& clone() throw(RuntimeException); + Application& clone() noexcept(false); /** Devuelve la instancia del componente que corresponde con el nombre recibido. \return La instancia del componente que corresponde con el nombre recibido. Puede ser NULL si no hay ningun componente asociado a la �ta aplicacion que corresponda con el nombre. */ - Component* find(const char* className) throw(); + Component* find(const char* className) ; /** Inicializa los elementos propios de nuestra aplicacio, invoca al metodo #initialize e invoca al metodo #run. */ - void start() throw(RuntimeException); + void start() noexcept(false); /** Devuelve un iterador al primer componente definido en la aplicacion. \return un iterador al primer componente definido en la aplicacion. */ - const_iterator begin() const throw() { return a_components.begin(); } + const_iterator begin() const { return a_components.begin(); } /** Devuelve un iterador al primer componente definido en la aplicacion. \return un iterador al primer componente definido en la aplicacion. */ - iterator begin() throw() { return a_components.begin(); } + iterator begin() { return a_components.begin(); } /** Devuelve un iterador al ultimo componente definido en la aplicacion. \return un iterador al ultimo componente definido en la aplicacion. */ - const_iterator end() const throw() { return a_components.end(); } + const_iterator end() const { return a_components.end(); } /** Devuelve un iterador al ultimo componente definido en la aplicacion. \return un iterador al ultimo componente definido en la aplicacion. */ - iterator end() throw() { return a_components.end(); } + iterator end() { return a_components.end(); } /** Vuelva un documento XML con el contexto de la aplicacion. \param file Ruta completa del fichero en el que grabar el contexto de la aplicacion. */ - void writeContext(const std::string& file) throw(RuntimeException); + void writeContext(const std::string& file) noexcept(false); /** metodo que puede ser reescrito en las clases heredadas de Application y que nos @@ -151,14 +151,14 @@ public: \warning En el momento de invocar a esta funcin los componentes (\see Component) pueden no estar disponibles. */ - virtual void initialize() throw(RuntimeException) {;} + virtual void initialize() noexcept(false) {;} /** Devuelve si esta aplicacion tiene soporto para comunicaciones entre procesos. \return \em true si la aplicacion tiene soporta para comunicacion entre proceso o \em false en otro caso. */ - virtual bool supportCommunication() const throw() { return false; } + virtual bool supportCommunication() const { return false; } /** * Este m�todo se invocar� cuando alguna capa superior a �sta detecte un problema tan grave @@ -169,28 +169,28 @@ public: * no muy estable por lo que se deber�an minizar las operaciones a realizar para evitar * bloquear la aplicaci�n. */ - virtual void eventAbnormalTermination(const char* className) throw() { ; } + virtual void eventAbnormalTermination(const char* className) { ; } /** Devuelve una cadena con la informacion referente a esta instancia. \param parent Nodo XML del que dependende la informacion. @return Una cadena con la informacion referente a esta instancia. */ - virtual xml::Node* asXML(xml::Node* parent) const throw(); + virtual xml::Node* asXML(xml::Node* parent) const ; /** Devuelve el objeto sobre el que esta posicionado el iterator recibido como parametro. \param ii Iterator que deberia estar comprendido entre #begin y #end. \return El objeto sobre el que esta posicionado el iterator recibido como parametro. */ - static const Component* component(const_iterator& ii) throw() { return *ii; } + static const Component* component(const_iterator& ii) { return *ii; } /** Devuelve el objeto sobre el que esta posicionado el iterator recibido como parametro. \param ii Iterator que deberia estar comprendido entre #begin y #end. \return El objeto sobre el que esta posicionado el iterator recibido como parametro. */ - static Component* component(iterator& ii) throw() { return *ii; } + static Component* component(iterator& ii) { return *ii; } protected: static Application* st_application; @@ -198,80 +198,80 @@ protected: /** metodo que debemos implementar para ejecutar nuestra aplicacion. */ - virtual void run() throw(RuntimeException) = 0; + virtual void run() noexcept(false) = 0; /** Handler for SIGUSR1. Application context written by default. */ - virtual void signalUSR1() throw(RuntimeException); + virtual void signalUSR1() noexcept(false); /** Handler for SIGUSR2. Nothing done by default. */ - virtual void signalUSR2() throw(RuntimeException); + virtual void signalUSR2() noexcept(false); /** Metodo manejador que podemos re-escribir para tratar la recepcion de la senhal SIGTERM. */ - virtual void signalTerminate() throw(RuntimeException) {;} + virtual void signalTerminate() noexcept(false) {;} /** * Metodo que debemos implementar en la clase heredada para tratar el proceso de clonado de * esta aplicacion desde el punto de vista del proceso original. * \warning Si se detecta algun error terminara abortara la ejecucion del proceso hijo. */ - virtual void do_cloneParent() throw(RuntimeException) {;} + virtual void do_cloneParent() noexcept(false) {;} /** * Metodo que debemos implementar en la clase heredada para tratar el proceso de clonado de * esta aplicacion desde el punto de vista del proceso hijo. * \warning Si se detecta algun error terminara abortara la ejecucion de este proceso. */ - virtual void do_cloneChild() throw(RuntimeException) {;} + virtual void do_cloneChild() noexcept(false) {;} /** Devuelve un iterador al primer proceso hijo creado por la aplicacion (ver #clone), \return un iterador al primer proceso hijo definido en la aplicacion. */ - pid_iterator pid_begin() throw() { return a_pids.begin(); } + pid_iterator pid_begin() { return a_pids.begin(); } /** Devuelve un iterador al final de lista lista de procesos hijos creados por la aplicacion (ver #clone). \return un iterador al primer proceso hijo definido en la aplicacion. */ - pid_iterator pid_end() throw() { return a_pids.end(); } + pid_iterator pid_end() { return a_pids.end(); } /** * Devuelve el numero de procesos hijos. * \return el numero de procesos hijos. */ - int pid_size() const throw() { return a_pids.size(); } + int pid_size() const { return a_pids.size(); } /** Devuelve un iterador al primer proceso hijo creado por la aplicacion (ver #clone), \return un iterador al primer proceso hijo definido en la aplicacion. */ - const_pid_iterator pid_begin() const throw() { return a_pids.begin(); } + const_pid_iterator pid_begin() const { return a_pids.begin(); } /** Devuelve un iterador al final de lista lista de procesos hijos creados por la aplicacion (ver #clone). \return un iterador al primer proceso hijo definido en la aplicacion. */ - const_pid_iterator pid_end() const throw() { return a_pids.end(); } + const_pid_iterator pid_end() const { return a_pids.end(); } /** Devuelve el PID sobre el que esta posicionado el iterator recibido como parametro. \param ii Iterator que deberia estar comprendido entre #pid_begin y #pid_end. \return El objeto sobre el que esta posicionado el iterator recibido como parametro. */ - static pid_t pid(pid_iterator& ii) throw() { return *ii; } + static pid_t pid(pid_iterator& ii) { return *ii; } /** Devuelve el PID sobre el que esta posicionado el iterator recibido como parametro. \param ii Iterator que deberia estar comprendido entre #pid_begin y #pid_end. \return El objeto sobre el que esta posicionado el iterator recibido como parametro. */ - static pid_t pid(const_pid_iterator& ii) throw() { return *ii; } + static pid_t pid(const_pid_iterator& ii) { return *ii; } private: const std::string a_title; @@ -283,17 +283,17 @@ private: bool a_enableGPL; pid_container a_pids; - void attach(Component*) throw(RuntimeException); - void detach(Component*) throw(RuntimeException); + void attach(Component*) noexcept(false); + void detach(Component*) noexcept(false); - void startComponents() throw(RuntimeException); - void stopComponents() throw(RuntimeException); - void sendSignalToChilds(const int signal) throw(); + void startComponents() noexcept(false); + void stopComponents() noexcept(false); + void sendSignalToChilds(const int signal) ; - void signalUSR(int) throw(RuntimeException); - static void handlerSignalUSR(int) throw(); - static void handlerSignalTerminate(int) throw(); - static void handlerChildTerminate(int sig) throw(); + void signalUSR(int) noexcept(false); + static void handlerSignalUSR(int) ; + static void handlerSignalTerminate(int) ; + static void handlerChildTerminate(int sig) ; friend class Component; // Para poder acceder a los metodo attach y detach friend struct functions; diff --git a/include/anna/app/Component.hpp b/include/anna/app/Component.hpp index 33198d8..7258012 100644 --- a/include/anna/app/Component.hpp +++ b/include/anna/app/Component.hpp @@ -53,20 +53,20 @@ public: cuando instanciemos un componentes despues de comenzar la ejecucion de nuestra aplicacion y cuando el nuevo componente este completamente listo para su inicializacion. */ - void attach() throw(RuntimeException); + void attach() noexcept(false); /** Devuelve una cadena con la informacion mas relevante de esta instancia. \return Una cadena con la informacion mas relevante de esta instancia. */ - virtual std::string asString() const throw(); + virtual std::string asString() const ; /** Devuelve un documento XML con la informacion mas relevante de esta instancia. \param parent Nodo XML del que colgar la informacion referente a esta instancia. \return Un documento XML con la informacion mas relevante de esta instancia. */ - virtual xml::Node* asXML(xml::Node* parent) const throw(); + virtual xml::Node* asXML(xml::Node* parent) const ; protected: /** @@ -85,20 +85,20 @@ protected: Devuelve el estado de este componente. \return el estado de este componente. */ - State::_v getState() const throw() { return a_state; } + State::_v getState() const { return a_state; } /** Indica que el nombre de un componente que debe ser initializa antes que este. \param componentName Nombre de componente requerido por esta instancia. \warning Solo tendra efecto antes de inicializar el componente. */ - void addPredecessor(const char* componentName) throw(); + void addPredecessor(const char* componentName) ; /** metodo que debemos implementar si la clase heredada necesita algn tipo de inicializacin. Este metodo se invocara automaticamente desde anna::Application::start. */ - void initialize() throw(RuntimeException); + void initialize() noexcept(false); /** metodo que debemos implementar en la clase heredada para implementar el proceso de parada de @@ -107,7 +107,7 @@ protected: Este metodo debe implementar un metodo de parada controlada. Se invocara automaticamente desde el nucleo */ - void stop() throw() { a_state = State::Stopped; do_stop(); } + void stop() { a_state = State::Stopped; do_stop(); } /** metodo que debemos implementar en la clase heredada para implementar el proceso de parada de @@ -115,7 +115,7 @@ protected: Este metodo implementa un metodo de parada no controlada. */ - virtual void kill() throw() { stop(); } + virtual void kill() { stop(); } private: typedef std::vector ::iterator iterator; @@ -124,15 +124,15 @@ private: std::vector a_predecessors; Component(const Component& other); - iterator begin() throw() { return a_predecessors.begin(); } - iterator end() throw() { return a_predecessors.end(); } - const std::string& data(iterator& ii) throw() { return *ii; } + iterator begin() { return a_predecessors.begin(); } + iterator end() { return a_predecessors.end(); } + const std::string& data(iterator& ii) { return *ii; } /** metodo que debemos implementar si la clase heredada necesita algn tipo de inicializacin. Este metodo se invocara automaticamente desde anna::Application::start. */ - virtual void do_initialize() throw(RuntimeException) = 0; + virtual void do_initialize() noexcept(false) = 0; /** Metodo que debemos implementar en la clase heredada para tratar el proceso de parada de @@ -140,26 +140,26 @@ private: Este metodo debe implementar un metodo de parada controlada. Se invocara automaticamente desde el nucleo */ - virtual void do_stop() throw() = 0; + virtual void do_stop() = 0; /** * Metodo que debemos implementar en la clase heredada para tratar el proceso de clonado de * esta clase desde el punto de vista del proceso original. * \warning Si se detecta algun error terminara abortara la ejecucion del proceso hijo. */ - virtual void do_cloneParent() throw(RuntimeException) { ; } + virtual void do_cloneParent() noexcept(false) { ; } /** * Metodo que debemos implementar en la clase heredada para tratar el proceso de clonado de * esta clase desde el punto de vista del proceso hijo. * \warning Si se detecta algun error terminara abortara la ejecucion de este proceso. */ - virtual void do_cloneChild() throw(RuntimeException) { ; } + virtual void do_cloneChild() noexcept(false) { ; } - friend void Application::startComponents() throw(RuntimeException); - friend void Application::stopComponents() throw(RuntimeException); - friend void Application::attach(Component*) throw(RuntimeException); - friend Application& Application::clone() throw(RuntimeException); + friend void Application::startComponents() noexcept(false); + friend void Application::stopComponents() noexcept(false); + friend void Application::attach(Component*) noexcept(false); + friend Application& Application::clone() noexcept(false); }; } diff --git a/include/anna/app/functions.hpp b/include/anna/app/functions.hpp index c078917..695c35a 100644 --- a/include/anna/app/functions.hpp +++ b/include/anna/app/functions.hpp @@ -26,7 +26,7 @@ struct functions : public anna::functions { /** Devuelve la referencia de la instancia de nuestra aplicacion */ - static Application& getApp() throw(RuntimeException); + static Application& getApp() noexcept(false); /** @@ -41,7 +41,7 @@ struct functions : public anna::functions { \see Component */ template static T* componentByName(const char *className, const char* fromFile, const int fromLine) - throw(anna::RuntimeException) { + noexcept(false) { T* result = static_cast (functions::getApp().find(className)); if(result == NULL) { @@ -64,12 +64,12 @@ struct functions : public anna::functions { \return Application component instance for the class provided at the pattern \warning T class must implement a method in the form: \code - static const char* getClassName () throw (); + static const char* getClassName () ; \endcode \see Component */ template static T* component(const char* fromFile, const int fromLine) - throw(RuntimeException) { + noexcept(false) { return functions::componentByName (T::getClassName(), fromFile, fromLine); } diff --git a/include/anna/app/internal/sccs.hpp b/include/anna/app/internal/sccs.hpp index 0575e34..a002c5c 100644 --- a/include/anna/app/internal/sccs.hpp +++ b/include/anna/app/internal/sccs.hpp @@ -15,7 +15,7 @@ namespace app { class sccs { public: - static void activate() throw(); + static void activate() ; }; } diff --git a/include/anna/comm/AccessPoint.hpp b/include/anna/comm/AccessPoint.hpp index 158b5e5..45d0088 100644 --- a/include/anna/comm/AccessPoint.hpp +++ b/include/anna/comm/AccessPoint.hpp @@ -42,24 +42,24 @@ public: ~AccessPoint() { delete a_path; } - const INetAddress& getINetAddress() const throw() { return a_inetAddress; } - const std::string& getPath() const throw() { return *a_path; } + const INetAddress& getINetAddress() const { return a_inetAddress; } + const std::string& getPath() const { return *a_path; } - void clear() throw() { a_inetAddress.clear(); delete a_path; a_path = NULL; } - bool isNull() const throw() { return a_path == NULL && a_inetAddress.isNull(); } + void clear() { a_inetAddress.clear(); delete a_path; a_path = NULL; } + bool isNull() const { return a_path == NULL && a_inetAddress.isNull(); } - bool operator == (const AccessPoint&) const throw(); - AccessPoint& operator = (const INetAddress&) throw(); - AccessPoint& operator = (const std::string& path) throw(); - AccessPoint& operator = (const AccessPoint&) throw(); + bool operator == (const AccessPoint&) const ; + AccessPoint& operator = (const INetAddress&) ; + AccessPoint& operator = (const std::string& path) ; + AccessPoint& operator = (const AccessPoint&) ; - void asString(std::string& msg) const throw(); + void asString(std::string& msg) const ; - void asXML(const char* name, xml::Node* parent) const throw(RuntimeException); + void asXML(const char* name, xml::Node* parent) const noexcept(false); - std::string serialize() const throw(); + std::string serialize() const ; - void translate(const Socket&, sockaddr*&, int& len) throw(RuntimeException); + void translate(const Socket&, sockaddr*&, int& len) noexcept(false); private: const Socket* a_owner; diff --git a/include/anna/comm/Application.hpp b/include/anna/comm/Application.hpp index d845f6c..7defe90 100644 --- a/include/anna/comm/Application.hpp +++ b/include/anna/comm/Application.hpp @@ -49,7 +49,7 @@ public: \return La instancia de la factoria de protocolos a usar por defecto en esta aplicacion. */ - virtual TransportFactory& getDefaultTransportFactory() throw(); + virtual TransportFactory& getDefaultTransportFactory() ; protected: /** @@ -67,14 +67,14 @@ protected: /** Metodo manejador que podemos re-escribir para tratar la recepcion de la senhal SIGTERM. */ - virtual void signalTerminate() throw(RuntimeException); + virtual void signalTerminate() noexcept(false); private: Application(const Application&); - bool supportCommunication() const throw() { return true; } + bool supportCommunication() const { return true; } friend class Communicator; - friend anna::comm::Application& comm::functions::getApp() throw(RuntimeException); + friend anna::comm::Application& comm::functions::getApp() noexcept(false); }; } diff --git a/include/anna/comm/Buffer.hpp b/include/anna/comm/Buffer.hpp index c6513d6..a3c29ff 100644 --- a/include/anna/comm/Buffer.hpp +++ b/include/anna/comm/Buffer.hpp @@ -31,7 +31,7 @@ public: \param buffer Direccion de memoria asociada a esta instancia. \param size Numero de bytes asociados a esta instancia. */ - void setup(const char* buffer, const int size) throw() { + void setup(const char* buffer, const int size) { setBuffer(buffer); setSize(size); } @@ -40,7 +40,7 @@ public: Establece la longitud de la memoria asociada a esta instancia. \param size Numero de bytes asociados a esta instancia. */ - void resize(const int size) throw() { setSize(size); } + void resize(const int size) { setSize(size); } }; } diff --git a/include/anna/comm/ByRangeDelivery.hpp b/include/anna/comm/ByRangeDelivery.hpp index de9727f..0895029 100644 --- a/include/anna/comm/ByRangeDelivery.hpp +++ b/include/anna/comm/ByRangeDelivery.hpp @@ -57,7 +57,7 @@ protected: delivery = new TDelivery(name.c_str(), false); } - std::string asString() const throw() { + std::string asString() const { std::string result("comm::ByRangeDelivery { Bottom: "); result += TSerializer::asString(bottom); result += " | Top: "; @@ -67,7 +67,7 @@ protected: return result += " }"; } - xml::Node* asXML(xml::Node* parent) const throw() { + xml::Node* asXML(xml::Node* parent) const { xml::Node* result = parent->createChild("comm.Range"); result->createAttribute("Bottom", TSerializer::asString(bottom)); result->createAttribute("Top", TSerializer::asString(top)); @@ -112,7 +112,7 @@ public: \return La instancia del servicio de reparto asociado a este rango. */ range_iterator createRange(const TKey& bottom, const TKey& top) - throw(RuntimeException) { + noexcept(false) { Range* result; if(bottom > top) { @@ -150,7 +150,7 @@ public: \param ii Iterador de rango al que asociar el servicio. Debe ser resultado de invocar a #createRange. \param server Instancia del comm::Server a incorporar dentro del rango. */ - void attach(range_iterator& ii, Server* server) throw(RuntimeException) { + void attach(range_iterator& ii, Server* server) noexcept(false) { range(ii)->delivery->attach(server); comm::Service::attach(server); } @@ -160,7 +160,7 @@ public: \param key Clave usada para calcular el reparto. \warning Este metodo debe invocarse siempre antes de usar este servicio de reparto. */ - void prepare(const TKey& key) throw(RuntimeException) { + void prepare(const TKey& key) noexcept(false) { Range* w = find(key); if(w == NULL && Logger::isActive(Logger::Warning)) { @@ -182,7 +182,7 @@ public: } std::string asString() const - throw() { + { std::string result = className(); result += " { "; result += comm::Delivery::asString(); @@ -197,7 +197,7 @@ public: } xml::Node* asXML(xml::Node* parent) const - throw() { + { xml::Node* result = parent->createChild("anna.comm.ByRangeDelivery"); xml::Node* node = comm::Service::asXML(result); @@ -213,20 +213,20 @@ public: a los que pertenece la clase. \return Una cadena con el nombre de este selector. */ - static const char* className() throw() { return "anna::comm::ByRangeDelivery"; } + static const char* className() { return "anna::comm::ByRangeDelivery"; } protected: - range_iterator range_begin() throw() { return a_ranges.begin(); } - range_iterator range_end() throw() { return a_ranges.end(); } + range_iterator range_begin() { return a_ranges.begin(); } + range_iterator range_end() { return a_ranges.end(); } - const_range_iterator range_begin() const throw() { return a_ranges.begin(); } - const_range_iterator range_end() const throw() { return a_ranges.end(); } + const_range_iterator range_begin() const { return a_ranges.begin(); } + const_range_iterator range_end() const { return a_ranges.end(); } - static Range* range(range_iterator& ii) throw() { return *ii; } - static const Range* range(const_range_iterator& ii) throw() { return *ii; } + static Range* range(range_iterator& ii) { return *ii; } + static const Range* range(const_range_iterator& ii) { return *ii; } virtual void do_initialize() - throw(RuntimeException) { + noexcept(false) { for(range_iterator ii = range_begin(), maxii = range_end(); ii != maxii; ii ++) range(ii)->delivery->initialize(); } @@ -235,7 +235,7 @@ private: range_container a_ranges; Range* a_currentRange; - Range* find(const TKey& key) throw() { + Range* find(const TKey& key) { Range* result(NULL); Range* w; @@ -252,7 +252,7 @@ private: } comm::Resource* do_apply() - throw(RuntimeException) { + noexcept(false) { if(a_currentRange == NULL) { std::string msg(asString()); msg += " | Wrong call to anna::comm::ByRangeDelivery::prepare"; @@ -264,7 +264,7 @@ private: // Considera que el servicio esta NO-disponible cuando TODOS los servicios fallan bool do_fault(const comm::Resource* resource) - throw() { + { int n, nfault; n = nfault = 0; @@ -280,7 +280,7 @@ private: // Considera que el servicio esta recuperado cuando alguno de los servicios esta disponible bool do_recover(const comm::Resource* resource) - throw() { + { bool result(false); for(range_iterator ii = range_begin(), maxii = range_end(); ii != maxii; ii ++) { diff --git a/include/anna/comm/ClientSocket.hpp b/include/anna/comm/ClientSocket.hpp index 2b661f8..a7850f7 100644 --- a/include/anna/comm/ClientSocket.hpp +++ b/include/anna/comm/ClientSocket.hpp @@ -126,32 +126,32 @@ public: Devuelve la direccion remota del socket. \return La direccion remota del socket. */ - const AccessPoint& getRemoteAccessPoint() const throw() { return a_remoteAccessPoint; } + const AccessPoint& getRemoteAccessPoint() const { return a_remoteAccessPoint; } /** Devuelve el estado de conexion de este socket. \return \em true si el socket mantiene la conexion realizada mediante el metodo #connect o \em false en otro caso. */ - bool isConnected() const throw() { return (a_status & Status::Connected) != 0; } + bool isConnected() const { return (a_status & Status::Connected) != 0; } /** Devuelve el estado del contenido del socket. \return \em true si el socket mantiene el sincronismo o \em false en otro caso. */ - bool isSynchronized() const throw() { return (a_status & Status::Corrupt) == 0; } + bool isSynchronized() const { return (a_status & Status::Corrupt) == 0; } /** Devuelve el estado del contenido del socket. \return \em true si el socket NO mantiene el sincronismo o \em false en otro caso. */ - bool isCorrupt() const throw() { return (a_status & Status::Corrupt); } + bool isCorrupt() const { return (a_status & Status::Corrupt); } /** * Devuelve el estado de cierre del socket. * \return \em true si el socket está a la espera de ser cerrado o \em false en otro caso. */ - bool isClosedPending() const throw() { return (a_status & Status::ClosePending) != 0; } + bool isClosedPending() const { return (a_status & Status::ClosePending) != 0; } /** Devuelve la instancia de anna::comm::Server asociado a una conexion remota iniciada por @@ -161,7 +161,7 @@ public: \warning Puede ser NULL en caso de que este ClientSocket corresponda a una conexion local establecida por un proceso remoto contra un ServerSocket de nuestra aplicacion. */ - Server* getServer() throw(RuntimeException); + Server* getServer() noexcept(false); /** Devuelve el numero maximo de milisegundos esperados para obtener conexion al invocar @@ -169,7 +169,7 @@ public: \return el numero maximo de milisegundos esperados para obtener conexion al invocar al metodo #connect. */ - const Millisecond &getMaxConnectionDelay() const throw() { return a_msMaxConnectionDelay; } + const Millisecond &getMaxConnectionDelay() const { return a_msMaxConnectionDelay; } /** Devuelve el numero maximo de milisegundos que queda bloqueado el proceso/thread a la espera @@ -177,7 +177,7 @@ public: \return Devuelve el numero maximo de milisegundos que queda bloqueado el proceso/thread a la espera de escribir en un socket cuyo buffer de salida esta lleno. */ - const Millisecond &getMaxWriteDelay() const throw() { return a_msMaxWriteDelay; } + const Millisecond &getMaxWriteDelay() const { return a_msMaxWriteDelay; } /** Obtiene toda la informacion referente a este socket a partir de la conexion realizada atraves del \em fd @@ -185,7 +185,7 @@ public: \param fd File descriptor correspondiente a una conexion local. \warning Exclusivamente uso interno. */ - virtual void setfd(const int fd) throw(RuntimeException); + virtual void setfd(const int fd) noexcept(false); /** Establece el numero maximo de milisegundos esperados para obtener la conexion al @@ -195,7 +195,7 @@ public: \see anna::comm::Server::setMaxConnectionDelay. */ void setMaxConnectionDelay(const Millisecond &msMaxConnectionDelay) - throw() { + { a_msMaxConnectionDelay = msMaxConnectionDelay; } @@ -205,24 +205,24 @@ public: \param msMaxWriteDelay Numero de milisegundos esperados en caso de que el buffer del socket se llene. */ - void setMaxWriteDelay(const Millisecond &msMaxWriteDelay) throw() { a_msMaxWriteDelay = msMaxWriteDelay; } + void setMaxWriteDelay(const Millisecond &msMaxWriteDelay) { a_msMaxWriteDelay = msMaxWriteDelay; } /** * Devuelve \em true si el indicador que ignora los mensajes entrantes está activo, o \em false en otro caso. * \return \em true si el indicador que ignora los mensajes entrantes está activo, o \em false en otro caso. */ - bool getIgnoreIncomingMessages() const throw() { return a_ignoreIncomingMessages; } + bool getIgnoreIncomingMessages() const { return a_ignoreIncomingMessages; } /** * Establece el indicador que provoca ignorar los mensajes entrantes. * \param ignoreIncomingMessages \em true si el indicador que ignora los mensajes entrantes está activo, o \em false en otro caso. */ - void setIgnoreIncomingMessages(const bool ignoreIncomingMessages) throw() { a_ignoreIncomingMessages = ignoreIncomingMessages; } + void setIgnoreIncomingMessages(const bool ignoreIncomingMessages) { a_ignoreIncomingMessages = ignoreIncomingMessages; } /** Intenta la conexion remota con la direccion indicada en el constructor. */ - virtual void connect() throw(RuntimeException); + virtual void connect() noexcept(false); /** Envia el mensaje recibido como parametro. Al bloque de datos correspondiente a la @@ -231,7 +231,7 @@ public: \param message Mensaje que vamos codificar para enviar a la capa de transporte. */ - void send(Message& message) throw(RuntimeException); + void send(Message& message) noexcept(false); /** Envia el mensaje recibido como parametro. Al bloque de datos correspondiente a la @@ -240,7 +240,7 @@ public: \param message Mensaje que vamos codificar para enviar a la capa de transporte. */ - void send(Message* message) throw(RuntimeException); + void send(Message* message) noexcept(false); /** Espera la llegada de mensajes por este ClientSocket durante un numero de milisegundos @@ -250,7 +250,7 @@ public: \code void f (anna::ClientSocket* clientSocket) - throw (anna::RuntimeException) + noexcept(false) { anna::Guard (clientSocket); @@ -281,18 +281,18 @@ public: \li La invocacion al metodo #receive y al #fetch deben estar protegidas por la misma seccion critica. */ - Notify::_v wait(const Millisecond &timeout, const bool receive = true) throw(RuntimeException); + Notify::_v wait(const Millisecond &timeout, const bool receive = true) noexcept(false); /** Elimina el contenido del buffer de recepcion. */ - void forgot() throw(); + void forgot() ; /** Obtiene la capa de transporte asociada a este ClientSocket. \return la capa de transporte asociada a este ClientSocket. */ - Transport* getTransport() throw(RuntimeException) { + Transport* getTransport() noexcept(false) { return (a_transport != NULL) ? a_transport : reserveTransport(); } @@ -301,7 +301,7 @@ public: \return el receptor asociado a este ClientSocket.Puede ser NULL \warning Exclusivamente uso interno. */ - Receiver* getReceiver() throw(RuntimeException) { + Receiver* getReceiver() noexcept(false) { return (a_receiver != NULL) ? a_receiver : ((a_receiverFactory == NULL) ? NULL : reserveReceiver()); } @@ -311,45 +311,45 @@ public: * intermedia, invoca directamente al metodo anna::comm::Receiver::initialize. * \param receive La instancia del receptor externo que tratar los mensajes de este socket. */ - void setReceiver(Receiver* receive) throw(RuntimeException); + void setReceiver(Receiver* receive) noexcept(false); /** Activa la solicitud de cierre del socket, que se llevara a cabo cuando el nucleo considere que se puede realizar de forma segura, desde el punto de vista de la informacion bloqueada por secciones criticas en los distintos componentes, que hacen uso del socket. */ - void requestClose() throw(); + void requestClose() ; /** Devuelve el estado de la solicitud de cierre del socket. \return el estado de la solicitud de cierre del socket. */ - bool hasRequestedClose() const throw() { return (a_status & Status::ClosePending) != 0; } + bool hasRequestedClose() const { return (a_status & Status::ClosePending) != 0; } /** Devuelve una cadena con la informacin referente a este socket. \return Una cadena con la informacin referente a este socket. */ - virtual std::string asString() const throw(); + virtual std::string asString() const ; /** Devuelve un nodo XML con la informacin referente a este objeto. \param parent Nodo XML a partir del cual introducir la informacin. \return Un nodo XML con la informacin referente a este objeto. */ - virtual xml::Node* asXML(xml::Node* parent) const throw(RuntimeException); + virtual xml::Node* asXML(xml::Node* parent) const noexcept(false); /** Devuelve el nombre logico de esta clase. \return el nombre logico de esta clase. */ - static const char* className() throw() { return "anna::comm::ClientSocket"; } + static const char* className() { return "anna::comm::ClientSocket"; } protected: struct Status { enum _v { None = 0, Connected = 1, Corrupt = 2, ClosePending = 4, Working = 8 }; - static std::string asString(const int status) throw(); + static std::string asString(const int status) ; }; Transport* a_transport; @@ -359,19 +359,19 @@ protected: Devuelve el numero de bytes contenido en el buffer intermedio de recepcion. \return El numero de bytes contenido en el buffer intermedio de recepcion. */ - int getBufferSize() const throw() { return a_data.getSize() - a_offset; } + int getBufferSize() const { return a_data.getSize() - a_offset; } /** Devuelve el numero maximo de bytes que puede tener en el buffer intermedio de recepcion. \return el numero maximo de bytes que puede tener en el buffer intermedio de recepcion. */ - int getReceiveBufferSize() const throw() { return a_rcvBufferSize; } + int getReceiveBufferSize() const { return a_rcvBufferSize; } /** Obtiene los parametros de funcionamiento del Socket. \warning Exclusivamente uso interno. */ - void getSocketOptions() throw(RuntimeException); + void getSocketOptions() noexcept(false); /** Recupera el ultimo mensaje recibido. @@ -385,7 +385,7 @@ protected: \code void f (anna::ClientSocket* clientSocket) - throw (anna::RuntimeException) + noexcept(false) { anna::Guard (clientSocket); @@ -402,7 +402,7 @@ protected: \endcode */ - Notify::_v receive() throw(RuntimeException); + Notify::_v receive() noexcept(false); /** Recupera el ultimo bloque de datos recuperado mediante el metodo #receive o #wait. @@ -415,16 +415,16 @@ protected: \warning Exclusivamente uso interno. Debe invocarse con una seccion critica activa sobre el ClientSocket. */ - const DataBlock* fetch() throw(RuntimeException); + const DataBlock* fetch() noexcept(false); - void activate(const Status::_v v) throw() { a_status |= v; } - void deactivate(const Status::_v v) throw() { a_status &= ~v; } - void deactivate(const int v) throw() { a_status &= ~v; } + void activate(const Status::_v v) { a_status |= v; } + void deactivate(const Status::_v v) { a_status &= ~v; } + void deactivate(const int v) { a_status &= ~v; } - virtual int do_connect(const sockaddr*, const int len) throw(RuntimeException); - virtual void do_write(const DataBlock&) throw(RuntimeException); - virtual int do_read(const char* data, const int size) throw(RuntimeException); - virtual void do_close() throw(); + virtual int do_connect(const sockaddr*, const int len) noexcept(false); + virtual void do_write(const DataBlock&) noexcept(false); + virtual int do_read(const char* data, const int size) noexcept(false); + virtual void do_close() ; private: struct PendingBytes { @@ -459,12 +459,12 @@ private: mutable PendingBytes a_pendingBytes; bool a_ignoreIncomingMessages; - void initialize() throw(); - void calculeExpectedSize(const DataBlock&) throw(); - Transport* reserveTransport() throw(RuntimeException); - Transport* unsafe_reserveTransport() throw(RuntimeException); - Receiver* reserveReceiver() throw(RuntimeException); - int getTotalPendingBytes() const throw(); + void initialize() ; + void calculeExpectedSize(const DataBlock&) ; + Transport* reserveTransport() noexcept(false); + Transport* unsafe_reserveTransport() noexcept(false); + Receiver* reserveReceiver() noexcept(false); + int getTotalPendingBytes() const ; friend class Communicator; // unsafe_reserveTransport diff --git a/include/anna/comm/Codec.hpp b/include/anna/comm/Codec.hpp index 490662a..be95c73 100644 --- a/include/anna/comm/Codec.hpp +++ b/include/anna/comm/Codec.hpp @@ -103,7 +103,7 @@ public: al mensaje y viceversa. @return Un puntero que hace referencia al nuevo dato interno que ha sido creado. */ - const Variable* attach(const char* name, std::string& value) throw(RuntimeException) { return CompatCodec::attach(name, size(), value); } + const Variable* attach(const char* name, std::string& value) noexcept(false) { return CompatCodec::attach(name, size(), value); } /** Asocia el valor recibido como parametro al dato interno identificado por `id'. Esta clase @@ -116,7 +116,7 @@ public: al mensaje y viceversa. @return Un puntero que hace referencia al nuevo dato interno que ha sido creado. */ - const Variable* attach(const char* name, const char*& value) throw(RuntimeException) { return CompatCodec::attach(name, size(), value); } + const Variable* attach(const char* name, const char*& value) noexcept(false) { return CompatCodec::attach(name, size(), value); } /** Asocia el valor recibido como parametro al dato interno identificado por `id'. Esta clase @@ -129,7 +129,7 @@ public: al mensaje y viceversa. @return Un puntero que hace referencia al nuevo dato interno que ha sido creado. */ - const Variable* attach(const char* name, int& value) throw(RuntimeException) { return CompatCodec::attach(name, size(), value); } + const Variable* attach(const char* name, int& value) noexcept(false) { return CompatCodec::attach(name, size(), value); } /** Asocia el valor recibido como parametro al dato interno identificado por `id'. Esta clase @@ -142,7 +142,7 @@ public: al mensaje y viceversa. @return Un puntero que hace referencia al nuevo dato interno que ha sido creado. */ - const Variable* attach(const char* name, S64& value) throw(RuntimeException) { return CompatCodec::attach(name, size(), value); } + const Variable* attach(const char* name, S64& value) noexcept(false) { return CompatCodec::attach(name, size(), value); } /** Asocia el valor recibido como parametro al dato interno identificado por `id'. Esta clase @@ -155,7 +155,7 @@ public: al mensaje y viceversa. @return Un puntero que hace referencia al nuevo dato interno que ha sido creado. */ - const Variable* attach(const char* name, bool& value) throw(RuntimeException) { return CompatCodec::attach(name, size(), value); } + const Variable* attach(const char* name, bool& value) noexcept(false) { return CompatCodec::attach(name, size(), value); } /** Asocia el valor recibido como parametro al dato interno identificado por `id'. Esta clase @@ -168,7 +168,7 @@ public: al mensaje y viceversa. Debe tener activado el sistema de copia profunda. @return Un puntero que hace referencia al nuevo dato interno que ha sido creado. */ - const Variable* attach(const char* name, DataBlock& value) throw(RuntimeException) { return CompatCodec::attach(name, size(), value); } + const Variable* attach(const char* name, DataBlock& value) noexcept(false) { return CompatCodec::attach(name, size(), value); } /** Asocia el valor recibido como parametro al dato interno identificado por `id'. Esta clase @@ -181,7 +181,7 @@ public: al mensaje y viceversa. Debe tener activado el sistema de copia profunda. @return Un puntero que hace referencia al nuevo dato interno que ha sido creado. */ - const Variable* attach(const char* name, float& value) throw(RuntimeException) { return CompatCodec::attach(name, size(), value); } + const Variable* attach(const char* name, float& value) noexcept(false) { return CompatCodec::attach(name, size(), value); } /** Asocia el valor recibido como parametro al dato interno identificado por `id'. Esta clase @@ -194,7 +194,7 @@ public: al mensaje y viceversa. Debe tener activado el sistema de copia profunda. @return Un puntero que hace referencia al nuevo dato interno que ha sido creado. */ - const Variable* attach(const char* name, double& value) throw(RuntimeException) { return CompatCodec::attach(name, size(), value); } + const Variable* attach(const char* name, double& value) noexcept(false) { return CompatCodec::attach(name, size(), value); } /** Asocia el valor recibido como parametro al dato interno identificado por `id'. Esta clase @@ -207,7 +207,7 @@ public: al mensaje y viceversa. Debe tener activado el sistema de copia profunda. @return Un puntero que hace referencia al nuevo dato interno que ha sido creado. */ - const Variable* attach(const char* name, Second& value) throw(RuntimeException); + const Variable* attach(const char* name, Second& value) noexcept(false); /** Asocia el valor recibido como parametro al dato interno identificado por `id'. Esta clase @@ -220,7 +220,7 @@ public: al mensaje y viceversa. Debe tener activado el sistema de copia profunda. @return Un puntero que hace referencia al nuevo dato interno que ha sido creado. */ - const Variable* attach(const char* name, Millisecond& value) throw(RuntimeException); + const Variable* attach(const char* name, Millisecond& value) noexcept(false); /** Asocia el valor recibido como parametro al dato interno identificado por `id'. Esta clase @@ -233,7 +233,7 @@ public: al mensaje y viceversa. Debe tener activado el sistema de copia profunda. @return Un puntero que hace referencia al nuevo dato interno que ha sido creado. */ - const Variable* attach(const char* name, Microsecond& value) throw(RuntimeException); + const Variable* attach(const char* name, Microsecond& value) noexcept(false); }; } diff --git a/include/anna/comm/Communicator.hpp b/include/anna/comm/Communicator.hpp index 58c83e7..17a8161 100644 --- a/include/anna/comm/Communicator.hpp +++ b/include/anna/comm/Communicator.hpp @@ -78,7 +78,7 @@ class Poll; */ class Communicator : public app::Component { struct SortByFileDescriptor { - static int value(const Handler*) throw(); + static int value(const Handler*) ; }; /** @@ -198,13 +198,13 @@ public: @return El numero de segundos esperado para intentar recuperar las conexiones de los servidores con los que se han detectado errores de conexion. */ - const Millisecond &getRecoveryTime() const throw() { return a_recoveryTime; } + const Millisecond &getRecoveryTime() const { return a_recoveryTime; } /** Devuelve el estado de este proceso con respecto al sistema de comunicaciones. \return El estado de este proceso con respecto al sistema de comunicaciones. */ - const Status& getStatus() const throw() { return a_status; } + const Status& getStatus() const { return a_status; } /** Devuelve el numero de milisegundos maximo que puede estar un manejador de conexion local @@ -212,12 +212,12 @@ public: \return el numero de milisegundos maximo que puede estar un manejador de conexion local sin recibir mensajes antes de ser cerrado por el nucleo. */ - const Millisecond &getTimeout() const throw() { return a_timeout; } + const Millisecond &getTimeout() const { return a_timeout; } /** * Devuelve el modo de tratamiento de conexiones establecido en el constructor. */ - WorkMode::_v getWorkMode() const throw() { return a_workMode; } + WorkMode::_v getWorkMode() const { return a_workMode; } /** Devuelve \em true si este comunicador esta atendiendo peticiones como servidor o \em false en otro @@ -225,18 +225,18 @@ public: @return \em true si este comunicador esta atendiendo peticiones como servidor o \em false en otro caso. */ - bool isServing() const throw() { return a_isServing; } + bool isServing() const { return a_isServing; } /** Devuelve el estado del indicador de peticion de parada. \return el estado del indicador de peticion de parada. */ - bool hasRequestedStop() const throw() { return a_requestedStop; } + bool hasRequestedStop() const { return a_requestedStop; } /** * Informa al comunicador de que hay algún socket que ha solicitado el cierre de la conexión. */ - void notifyPendingClose() throw() { a_pendingClose = true; } + void notifyPendingClose() { a_pendingClose = true; } /** Establece el numero de milisegundos esperado para intentar recuperar las conexiones de los servidores @@ -247,7 +247,7 @@ public: \warning el valor indicado deberá estar entre #MinRecoveryTime y #MaxRecoveryTime */ - void setRecoveryTime(const Millisecond &recoveryTime) throw(RuntimeException); + void setRecoveryTime(const Millisecond &recoveryTime) noexcept(false); /** Establece el numero de milisegundos empleados en intentar conectar con los servidores caídos cada @@ -258,12 +258,12 @@ public: \warning el valor indicado deberá estar entre #MinTryingConnectionTime y #MaxTryingConnectionTime */ - void setTryingConnectionTime(const Millisecond &tryingConnectionTime) throw(RuntimeException); + void setTryingConnectionTime(const Millisecond &tryingConnectionTime) noexcept(false); /** * Devuelve el numero de milisegundos empleados en intentar conectar con los servidores caídos. */ - const Millisecond &getTryingConnectionTime() const throw() { return a_tryingConnectionTime; } + const Millisecond &getTryingConnectionTime() const { return a_tryingConnectionTime; } /** * Establece el tamaño del bloque de memoria usado para procesar los mensajes entrantes. Todos @@ -276,20 +276,20 @@ public: * cuando se cambia este valor también se invocará a CongestionController::setMaxPendingBytes para * establecer este mismo valor. */ - static void setReceivingChunkSize(const int receivingChunkSize) throw(RuntimeException); + static void setReceivingChunkSize(const int receivingChunkSize) noexcept(false); /** * Obtiene el tamaño máximo del bloque de memoria a procesar de forma ininterrumpida. * \return el tamaño máximo del bloque de memoria a procesar de forma ininterrumpida. */ - static int getReceivingChunkSize() throw() { return st_ReceivingChunkSize; } + static int getReceivingChunkSize() { return st_ReceivingChunkSize; } /** Establece el numero de milisegundos maximo que puede estar un manejador de conexion local sin recibir mensajes antes de ser cerrado por el nucleo. \param timeout Numero de milisegundos maximo sin recibir mensajes. */ - void setTimeout(const Millisecond & timeout) throw() { a_timeout = timeout; } + void setTimeout(const Millisecond & timeout) { a_timeout = timeout; } /** * Establece el nivel de congestión global a partir del cual un servidor no aceptará nuevas conexiones. Su valor @@ -299,13 +299,13 @@ public: * * \warning Debe estar entre [comm::CongestionController::MaxLevel - 2, comm::CongestionController::MaxLevel]. */ - void setLevelOfDenialService(const int levelOfDenialService) throw(RuntimeException); + void setLevelOfDenialService(const int levelOfDenialService) noexcept(false); /** * Devuelve el nivel de congestión a partir del cual un servidor no aceptará nuevas conexiones. * \return el nivel de congestión a partir del cual un servidor no aceptará nuevas conexiones. */ - int getLevelOfDenialService() const throw() { return a_levelOfDenialService; } + int getLevelOfDenialService() const { return a_levelOfDenialService; } /** Registra un servidor de socket a la lista de peticiones por las que atiende peticiones este @@ -315,7 +315,7 @@ public: \param serverSocket Servidor de socket por el que vamos a atender el establecimiento de conexiones una vez que invoquemos al Metodo #accept. */ - void attach(ServerSocket* serverSocket) throw(RuntimeException); + void attach(ServerSocket* serverSocket) noexcept(false); /** Registra una conexion Local entre alguno de los ServerSocket definidos en nuestra aplicacion @@ -329,7 +329,7 @@ public: \warning Exclusivamente uso interno */ - void attach(LocalConnection* localConnection) throw(RuntimeException); + void attach(LocalConnection* localConnection) noexcept(false); /** Establece la conexion entre el comunicador y un ClientSocket recibido como parametro. @@ -337,7 +337,7 @@ public: \param clientSocket Instancia del socket que vamos a controlar. */ - void attach(ClientSocket* clientSocket) throw(RuntimeException); + void attach(ClientSocket* clientSocket) noexcept(false); /** Establece la conexion entre el comunicador y un DatagramSocket recibido como parametro. @@ -345,14 +345,14 @@ public: \param datagramSocket Instancia del socket que vamos a controlar. */ - void attach(DatagramSocket* datagramSocket) throw(RuntimeException); + void attach(DatagramSocket* datagramSocket) noexcept(false); /** Conecta un conector externo a este comunicador. \param handler Controlador de comunicaciones externas. \warning Debe de haber sido creado como de tipo Handler::Type::Custom. */ - void attach(Handler* handler) throw(RuntimeException); + void attach(Handler* handler) noexcept(false); /** Conecta un servicio de reparto de comunicaciones con este comunicador. El estado de @@ -361,7 +361,7 @@ public: \param service Instancia del servicio. \warning Todos los servicios registrados como criticos deberian estar asociados al comunicador. */ - void attach(Service* service) throw(RuntimeException); + void attach(Service* service) noexcept(false); /** Desconecta el ServerSocket que fue previamente conectado con #attach @@ -369,7 +369,7 @@ public: \warning Este metodo es invocado automaticamente desde el nucleo de anna.comm y no deberia ser usado por el programador final. */ - void detach(ServerSocket* serverSocket) throw(); + void detach(ServerSocket* serverSocket) ; /** Desconecta el ClientSocket que fue previamente conectado con #attach @@ -377,7 +377,7 @@ public: \warning Este metodo es invocado automaticamente desde el nucleo de ANNA.comm y no deberia ser usado por el programador final. */ - void detach(ClientSocket* clientSocket) throw(); + void detach(ClientSocket* clientSocket) ; /** Desconecta el conector externo de este comunicador. Supone que todas las operaciones @@ -388,14 +388,14 @@ public: \warning Exclusivamente uso interno */ - void detach(Handler* handler) throw(); + void detach(Handler* handler) ; /** Devuelve el manejador asociado al ClientSocket recibido como parametro. \param clientSocket Socket cliente del que queremos obtener en handler. \return El manejador asociado al socket recibido como parametro. Puede ser NULL. */ - const Handler* getHandler(const ClientSocket& clientSocket) throw(RuntimeException); + const Handler* getHandler(const ClientSocket& clientSocket) noexcept(false); /** El thread que invoca a este Metodo entra en un proceso continuo de comprobacin/recepcin @@ -404,12 +404,12 @@ public: traves de los Metodos manejadores de eventos de esta misma clase. El thread saldra de este bucle tras la invocacion del Metodo #requestStop. */ - void accept() throw(RuntimeException); + void accept() noexcept(false); /** Solicita la parada de este comunicador. */ - void requestStop() throw(); + void requestStop() ; /** Devuelve \em true si el ClientSocket recibido como parametro sigue siendo valido o \em false @@ -420,49 +420,49 @@ public: \return \em true si el ClientSocket recibido como parametro sigue siendo valido o \em false en caso de que haya dejado de ser valido debido al cierre del extremo remoto, por ejemplo. */ - bool isUsable(const ClientSocket* clientSocket) throw(); + bool isUsable(const ClientSocket* clientSocket) ; /** Devuelve el numero handlers activos. \return el numero handlers activos. */ - int handler_size() const throw() { return a_handlers.size(); } + int handler_size() const { return a_handlers.size(); } /** Devuelve un iterador que apunta el primer controlador. \return un iterador que apunta el primer controlador. */ - handler_iterator handler_begin() throw() { return a_handlers.begin(); } + handler_iterator handler_begin() { return a_handlers.begin(); } /** Devuelve un iterador que apunta al final de la lista de controladores. \return un iterador que apunta al final de la lista de controladores. */ - handler_iterator handler_end() throw() { return a_handlers.end(); } + handler_iterator handler_end() { return a_handlers.end(); } /** Devuelve un iterador que apunta el primer controlador. \return un iterador que apunta el primer controlador. */ - const_handler_iterator handler_begin() const throw() { return a_handlers.begin(); } + const_handler_iterator handler_begin() const { return a_handlers.begin(); } /** Devuelve un iterador que apunta al final de la lista de controladores. \return un iterador que apunta al final de la lista de controladores. */ - const_handler_iterator handler_end() const throw() { return a_handlers.end(); } + const_handler_iterator handler_end() const { return a_handlers.end(); } /** Devuelve un iterador que apunta el primer servicio. \return un iterador que apunta el primer service. */ - const_service_iterator service_begin() const throw() { return a_services.begin(); } + const_service_iterator service_begin() const { return a_services.begin(); } /** Devuelve un iterador que apunta al final de la lista de servicios. \return un iterador que apunta al final de la lista de servicios. */ - const_service_iterator service_end() const throw() { return a_services.end(); } + const_service_iterator service_end() const { return a_services.end(); } /** Metodo manejador de evento que permite ajustar el funcionamiento de nuestro comunicador ante @@ -480,7 +480,7 @@ public: \warning Este Metodo no debera generar ningn tipo de excepcin. */ - virtual void eventUser(const char* id, const void* context) throw() {;} + virtual void eventUser(const char* id, const void* context) {;} /** Metodo manejador de evento que permite ajustar el funcionamiento de nuestro comunicador cuando @@ -495,7 +495,7 @@ public: \li El nucleo de ANNA.comm necesita conocer este evento por lo que cualquier implementacin debera invocar al Metodo eventBreakAddress de su clase base. */ - virtual void eventBreakAddress(const in_addr_t& address) throw(); + virtual void eventBreakAddress(const in_addr_t& address) ; /** Metodo manejador de evento que permite ajustar el funcionamiento de nuestro comunicador cuando @@ -510,7 +510,7 @@ public: \li El nucleo de ANNA.comm necesita conocer este evento por lo que cualquier implementacin debera invocar al Metodo eventRecoverAddress de su clase base. */ - virtual void eventRecoverAddress(const in_addr_t& address) throw(); + virtual void eventRecoverAddress(const in_addr_t& address) ; /** Metodo manejador de evento que permite ajustar el funcionamiento de nuestro comunicador cuando @@ -527,7 +527,7 @@ public: \warning Desde ANNA.comm 1.11.18 se mide el nivel de carga del proceso y si se evalúa como congestionado no permitirá aceptar la nueva conexión. */ - virtual bool eventAcceptConnection(const ClientSocket& clientSocket) throw(RuntimeException); + virtual bool eventAcceptConnection(const ClientSocket& clientSocket) noexcept(false); /** Metodo manejador de evento que permite ajustar el funcionamiento de nuestro comunicador cuando @@ -544,7 +544,7 @@ public: \see Host::createServer */ - virtual void eventCreateConnection(const Server* server) throw(); + virtual void eventCreateConnection(const Server* server) ; /** Metodo manejador de evento que permite ajustar el funcionamiento de nuestro comunicador cuando @@ -561,7 +561,7 @@ public: \see Host::createServer */ - virtual void eventCreateConnection(const Service* service) throw(); + virtual void eventCreateConnection(const Service* service) ; /** Establece las acciones a realizar cuando la clase Communicator detecta la llegada de un @@ -582,14 +582,14 @@ public: en entorno MT. */ virtual void eventReceiveMessage(ClientSocket& clientSocket, const Message& message) - throw(RuntimeException) { ; } + noexcept(false) { ; } /** Establece las acciones a realizar cuando el nucleo de ANNA.comm notifica que ha cerrado un anna::comm::ClientSocket debido a un consumo excesivo de memoria. \param clientSocket Socket cliente que va a ser cerrado por el nucleo de ANNA.comm. */ - virtual void eventOverQuota(const ClientSocket& clientSocket) throw() {;} + virtual void eventOverQuota(const ClientSocket& clientSocket) {;} /** Establece las acciones a realizar cuando el núcleo de ANNA.comm notifica que ha @@ -597,7 +597,7 @@ public: ha sido analizado correctamente. \param clientSocket Socket cliente que va a ser cerrado por el nucleo de ANNA.comm. */ - virtual void eventDiscardConnection(const ClientSocket& clientSocket) throw() {;} + virtual void eventDiscardConnection(const ClientSocket& clientSocket) {;} /** * Método manejador invocado cuando un client socket que tiene activado el indicador de ignorar los @@ -605,41 +605,41 @@ public: * \param clientSocket ClientSocket por el que se recibe el mensaje. * \param burst Bloque de datos que contiene la trama recibida. */ - virtual void eventIgnoreBurst(const ClientSocket& clientSocket, const DataBlock& burst) throw() {;} + virtual void eventIgnoreBurst(const ClientSocket& clientSocket, const DataBlock& burst) {;} /** Devuelve una cadena con la informacion mas relevante de esta instancia. \return Una cadena con la informacion mas relevante de esta instancia. */ - std::string asString() const throw(); + std::string asString() const ; /** Devuelve un documento XML con la informacion mas relevante de esta instancia. \param parent Nodo XML del que colgar la informacion referente a esta instancia. \return Un documento XML con la informacion mas relevante de esta instancia. */ - virtual xml::Node* asXML(xml::Node* parent) const throw(); + virtual xml::Node* asXML(xml::Node* parent) const ; /** Devuelve el controlador apuntado por el iterador recibido. \param ii Iterador con el que estamos recorriendo los controladores. \return el controlador apuntado por el iterador recibido. */ - static Handler* handler(handler_iterator& ii) throw() { return Handlers::data(ii); } + static Handler* handler(handler_iterator& ii) { return Handlers::data(ii); } /** Devuelve el controlador apuntado por el iterador recibido. \param ii Iterador con el que estamos recorriendo los controladores. \return el controlador apuntado por el iterador recibido. */ - static const Handler* handler(const_handler_iterator& ii) throw() { return Handlers::data(ii); } + static const Handler* handler(const_handler_iterator& ii) { return Handlers::data(ii); } /** Devuelve el servicio apuntado por el iterador recibido. \param ii Iterador con el que estamos recorriendo los servicios. \return el servicio apuntado por el iterador recibido. */ - static const Service* service(const_service_iterator& ii) throw() { return *ii; } + static const Service* service(const_service_iterator& ii) { return *ii; } /** Devuelve la cadena por la que podemos buscar el componente. @@ -662,7 +662,7 @@ protected: que despues de este Metodo esta instancia no debera utilizarse. \warning Estado MT: \code [Tx] -> Communicator \endcode */ - virtual void eventBreakConnection(const ClientSocket& clientSocket) throw() {;} + virtual void eventBreakConnection(const ClientSocket& clientSocket) {;} /** Metodo manejador de evento que permite ajustar el funcionamiento de nuestro comunicador cuando @@ -673,7 +673,7 @@ protected: @param clientSocket Socket cliente asociado a esta rotura de conexion. */ - virtual void eventBreakLocalConnection(const ClientSocket& clientSocket) throw() {;} + virtual void eventBreakLocalConnection(const ClientSocket& clientSocket) {;} /** @@ -699,7 +699,7 @@ protected: @param server Proceso servidor con el que hemos perdido la conexion. */ - virtual void eventBreakConnection(const Server* server) throw(); + virtual void eventBreakConnection(const Server* server) ; /** Metodo manejador de evento que permite ajustar el funcionamiento de nuestro comunicador @@ -709,7 +709,7 @@ protected: \param service Servicio que ha dejado de estar disponible. \warning Estado MT: \code [Tx] -> Communicator \endcode */ - virtual void eventBreakConnection(const Service* service) throw(); + virtual void eventBreakConnection(const Service* service) ; /** Establecer la configuracin de este comunicador. El cargador de configuracin se encarga de establecer @@ -718,19 +718,19 @@ protected: \warning Este Metodo debe invocarse desde las clases heredadas. */ - virtual void do_initialize() throw(RuntimeException) {;} + virtual void do_initialize() noexcept(false) {;} /** Solicita la parada de este comunicador. Se reimplementa para mantener el interfaz de la clase Component de la que hereda este Communicator. */ - void do_stop() throw() { requestStop(); } + void do_stop() { requestStop(); } /** Establece el estado de este proceso con respecto al sistema de comunicaciones @param status Estado del sistema de comunicaciones que deseamos establecer. */ - virtual void setStatus(const Status& status) throw(); + virtual void setStatus(const Status& status) ; /** Establece la conexion entre el comunicador y un socket dedicado a la comparticion de una @@ -741,14 +741,14 @@ protected: \internal */ - void attach(BinderSocket* binderSocket) throw(RuntimeException); + void attach(BinderSocket* binderSocket) noexcept(false); /** Desconecta el BinderSocket que fue previamente conectado con attach(BinderSocket*). \param binderSocket Instancia del BinderSocket a desconectar. \warning Exclusivamente uso interno */ - void detach(BinderSocket* binderSocket) throw(); + void detach(BinderSocket* binderSocket) ; /** Metodo manejador de evento que permite ajustar el funcionamiento de nuestro comunicador cuando @@ -761,7 +761,7 @@ protected: En la mayoria de los casos no sera necesario indicar ninguna accion ya que ANNA.comm realiza todas las operaciones necesarias. */ - virtual void eventStartup() throw(RuntimeException) {;} + virtual void eventStartup() noexcept(false) {;} /** Metodo manejador de evento que permite ajustar el funcionamiento de nuestro comunicador cuando @@ -770,7 +770,7 @@ protected: En la mayoria de los casos no sera necesario indicar ninguna accion ya que ANNA.comm realiza todas las operaciones necesarias. */ - virtual void eventShutdown() throw(); + virtual void eventShutdown() ; private: const WorkMode::_v a_workMode; @@ -790,22 +790,22 @@ private: // ST Poll* a_poll; Handlers a_timedouts; - void singlethreadedAccept() throw(RuntimeException); + void singlethreadedAccept() noexcept(false); // MT ThreadManager* a_threadManager; - void multithreadedAccept() throw(RuntimeException); + void multithreadedAccept() noexcept(false); - ConnectionRecover* getConnectionRecover() throw() { return a_connectionRecover; } + ConnectionRecover* getConnectionRecover() { return a_connectionRecover; } - void attach(RemoteConnection* remoteConnection) throw(RuntimeException); + void attach(RemoteConnection* remoteConnection) noexcept(false); - void insert(Handler*) throw(RuntimeException); - Handler* find(const int fd) throw() { return a_handlers.find(fd); } + void insert(Handler*) noexcept(false); + Handler* find(const int fd) { return a_handlers.find(fd); } // Reimplementado de app::Component - void do_cloneParent() throw(RuntimeException); - void do_cloneChild() throw(); + void do_cloneParent() noexcept(false); + void do_cloneChild() ; friend class Handler; diff --git a/include/anna/comm/CompatCodec.hpp b/include/anna/comm/CompatCodec.hpp index f6e45c8..cb16838 100644 --- a/include/anna/comm/CompatCodec.hpp +++ b/include/anna/comm/CompatCodec.hpp @@ -90,7 +90,7 @@ namespace comm { */ class CompatCodec : public Message { struct SortById { - static short int value(const comm::Variable* variable) throw() { + static short int value(const comm::Variable* variable) { return variable->getId(); } }; @@ -104,21 +104,21 @@ class CompatCodec : public Message { VariableContainer(); - void clear() throw(); - void add(comm::Variable* variable) throw(); - comm::Variable* find(const int id) throw(); - const comm::Variable* find(const int id) const throw(); + void clear() ; + void add(comm::Variable* variable) ; + comm::Variable* find(const int id) ; + const comm::Variable* find(const int id) const ; - int size() const throw() { return a_size; } + int size() const { return a_size; } - iterator begin() throw() { return a_variables; } - iterator end() throw() { return a_variables + a_size; } + iterator begin() { return a_variables; } + iterator end() { return a_variables + a_size; } - const_iterator begin() const throw() { return a_variables; } - const_iterator end() const throw() { return a_variables + a_size; } + const_iterator begin() const { return a_variables; } + const_iterator end() const { return a_variables + a_size; } - static comm::Variable* data(iterator ii) throw() { return *ii; } - static const comm::Variable* data(const_iterator ii) throw() { return *ii; } + static comm::Variable* data(iterator ii) { return *ii; } + static const comm::Variable* data(const_iterator ii) { return *ii; } private: comm::Variable** a_variables; @@ -154,7 +154,7 @@ public: Devuelve el identificador del mensaje indicado en el constructor. @return El identificador de este mensaje. */ - Type getType() const throw() { return a_type; } + Type getType() const { return a_type; } // Metodos /** @@ -169,7 +169,7 @@ public: al mensaje y viceversa. @return Un puntero que hace referencia al nuevo dato interno que ha sido creado. */ - const Variable* attach(const char* name, const short int id, std::string& value) throw(RuntimeException); + const Variable* attach(const char* name, const short int id, std::string& value) noexcept(false); /** Asocia el valor recibido como parametro al dato interno identificado por `id'. Esta clase @@ -183,7 +183,7 @@ public: al mensaje y viceversa. @return Un puntero que hace referencia al nuevo dato interno que ha sido creado. */ - const Variable* attach(const char* name, const short int id, const char*& value) throw(RuntimeException); + const Variable* attach(const char* name, const short int id, const char*& value) noexcept(false); /** Asocia el valor recibido como parametro al dato interno identificado por `id'. Esta clase @@ -197,7 +197,7 @@ public: al mensaje y viceversa. @return Un puntero que hace referencia al nuevo dato interno que ha sido creado. */ - const Variable* attach(const char* name, const short int id, int& value) throw(RuntimeException); + const Variable* attach(const char* name, const short int id, int& value) noexcept(false); /** Asocia el valor recibido como parametro al dato interno identificado por `id'. Esta clase @@ -211,7 +211,7 @@ public: al mensaje y viceversa. @return Un puntero que hace referencia al nuevo dato interno que ha sido creado. */ - const Variable* attach(const char* name, const short int id, S64& value) throw(RuntimeException); + const Variable* attach(const char* name, const short int id, S64& value) noexcept(false); /** Asocia el valor recibido como parametro al dato interno identificado por `id'. Esta clase @@ -225,7 +225,7 @@ public: al mensaje y viceversa. @return Un puntero que hace referencia al nuevo dato interno que ha sido creado. */ - const Variable* attach(const char* name, const short int id, bool& value) throw(RuntimeException); + const Variable* attach(const char* name, const short int id, bool& value) noexcept(false); /** Asocia el valor recibido como parametro al dato interno identificado por `id'. Esta clase @@ -239,7 +239,7 @@ public: al mensaje y viceversa. Debe tener activado el sistema de copia profunda. @return Un puntero que hace referencia al nuevo dato interno que ha sido creado. */ - const Variable* attach(const char* name, const short int id, DataBlock& value) throw(RuntimeException); + const Variable* attach(const char* name, const short int id, DataBlock& value) noexcept(false); /** Asocia el valor recibido como parametro al dato interno identificado por `id'. Esta clase @@ -253,7 +253,7 @@ public: al mensaje y viceversa. Debe tener activado el sistema de copia profunda. @return Un puntero que hace referencia al nuevo dato interno que ha sido creado. */ - const Variable* attach(const char* name, const short int id, float& value) throw(RuntimeException); + const Variable* attach(const char* name, const short int id, float& value) noexcept(false); /** Asocia el valor recibido como parametro al dato interno identificado por `id'. Esta clase @@ -267,11 +267,11 @@ public: al mensaje y viceversa. Debe tener activado el sistema de copia profunda. @return Un puntero que hace referencia al nuevo dato interno que ha sido creado. */ - const Variable* attach(const char* name, const short int id, double& value) throw(RuntimeException); + const Variable* attach(const char* name, const short int id, double& value) noexcept(false); - const Variable* attach(const char* name, const short int id, Second& value) throw(RuntimeException); - const Variable* attach(const char* name, const short int id, Millisecond& value) throw(RuntimeException); - const Variable* attach(const char* name, const short int id, Microsecond& value) throw(RuntimeException); + const Variable* attach(const char* name, const short int id, Second& value) noexcept(false); + const Variable* attach(const char* name, const short int id, Millisecond& value) noexcept(false); + const Variable* attach(const char* name, const short int id, Microsecond& value) noexcept(false); /** * Asocia el mensaje recibido como un parámetro interno especificado por \em id. @@ -279,7 +279,7 @@ public: * \param id Identificador del dato asignado. * \param value Instancia del mensaje que se codificará/decodificará de forma recursiva. */ - const Variable* attach(const char* name, const short int id, comm::CompatCodec& value) throw(RuntimeException); + const Variable* attach(const char* name, const short int id, comm::CompatCodec& value) noexcept(false); /** Devuelve la referencia al dato interno identificado por el `id' recibido como parametro. @@ -288,7 +288,7 @@ public: @return La referencia de la variable identificada por 'id'. Si no existe se lanzar�una excepcin. */ - const Variable& find(const short int id) const throw(RuntimeException); + const Variable& find(const short int id) const noexcept(false); /** Marca el dato asociado al identificador recibido como nulo, lo cual conlleva que el dato no seria @@ -297,7 +297,7 @@ public: @param id Identificador asignado al dato. @param isNull Indica la nueva marca de la variable. */ - void setNull(const short int id, const bool isNull = true) throw(RuntimeException); + void setNull(const short int id, const bool isNull = true) noexcept(false); /** Marca el dato recibido como nulo, lo cual conlleva que el dato no seria transferido al bloque @@ -306,7 +306,7 @@ public: @param variable Instancia de Varaible obtenida al invocar al método #attach @param isNull Indica la nueva marca de la variable. */ - void setNull(const Variable* variable, const bool isNull = true) throw(); + void setNull(const Variable* variable, const bool isNull = true) ; /** @param id Identificador asignado al dato. @@ -316,37 +316,37 @@ public: Un dato puede tener un value nulo, bien por que se ha invocado a la funcin @ref setNull o bien porque se recibio un mensaje en el que no venia contenido el identificador del dato. */ - bool isNull(const short int id) const throw(RuntimeException); + bool isNull(const short int id) const noexcept(false); /** Devuelve un iterador al comienzo de la lista de variables asociados a este mensaje. \return Un iterador al comienzo de la lista de variables asociados a este mensaje. */ - iterator begin() throw() { return a_variables.begin(); } + iterator begin() { return a_variables.begin(); } /** Devuelve un iterador al comienzo de la lista de variables asociados a este mensaje. \return Un iterador al comienzo de la lista de variables asociados a este mensaje. */ - const_iterator begin() const throw() { return a_variables.begin(); } + const_iterator begin() const { return a_variables.begin(); } /** Devuelve un iterador al comienzo de la lista de variables asociados a este mensaje. \return Un iterador al final de la lista de variables asociados a este mensaje. */ - iterator end() throw() { return a_variables.end(); } + iterator end() { return a_variables.end(); } /** Devuelve un iterador al comienzo de la lista de variables asociados a este mensaje. \return Un iterador al final de la lista de variables asociados a este mensaje. */ - const_iterator end() const throw() { return a_variables.end(); } + const_iterator end() const { return a_variables.end(); } /** Devuelve el número de enginees asociados a.esta instancia. \return el número de enginees asociados a.esta instancia. */ - int size() const throw() { return a_variables.size(); } + int size() const { return a_variables.size(); } /** Devuelve la instancia de la variable sobre el que esta posicionado el iterador recibido @@ -354,7 +354,7 @@ public: \param ii Iterador que debera estar comprendido entre begin y end. \return La instancia de la variable sobre el que esta posicionado el iterador recibido */ - static Variable* variable(iterator ii) throw() { return container::data(ii); } + static Variable* variable(iterator ii) { return container::data(ii); } /** Devuelve la instancia de la variable sobre el que esta posicionado el iterador recibido @@ -362,13 +362,13 @@ public: \param ii Iterador que debera estar comprendido entre begin y end. \return La instancia de la variable sobre el que esta posicionado el iterador recibido */ - static const Variable* variable(const_iterator ii) throw() { return container::data(ii); } + static const Variable* variable(const_iterator ii) { return container::data(ii); } /** Transfiene los datos establecidos en este mensaje interno a un bloque de memoria cuya instancia es devuelta por este metodo. @return Bloque de memoria que contiene la informacion del mensaje. */ - virtual const DataBlock& code() throw(RuntimeException); + virtual const DataBlock& code() noexcept(false); /** Transfiene la informacion contenida en el bloque de memoria recibido hacia las variables asociadas a este mensaje interno. @@ -376,7 +376,7 @@ public: @param dataBlock Bloque de memoria que contiene las variables codificadas. */ - virtual void decode(const DataBlock& dataBlock) throw(RuntimeException); + virtual void decode(const DataBlock& dataBlock) noexcept(false); /** Permite conocer el identificador del mensaje que viene contenido en el bloque de memoria @@ -386,7 +386,7 @@ public: @return El tipo del mensaje contenido en el bloque de memoria. */ - static Type getType(const DataBlock& dataBlock) throw(RuntimeException); + static Type getType(const DataBlock& dataBlock) noexcept(false); protected: bool a_scramble; @@ -401,8 +401,8 @@ private: CompatCodec(const CompatCodec&); CompatCodec& operator = (const CompatCodec&); - void normalDecode(const char* data, const int size, const int maxdata) throw(RuntimeException); - bool optimizedDecode(const char* data, const int size) throw(RuntimeException); + void normalDecode(const char* data, const int size, const int maxdata) noexcept(false); + bool optimizedDecode(const char* data, const int size) noexcept(false); }; } diff --git a/include/anna/comm/CongestionController.hpp b/include/anna/comm/CongestionController.hpp index 8be2a78..8d5e613 100644 --- a/include/anna/comm/CongestionController.hpp +++ b/include/anna/comm/CongestionController.hpp @@ -105,31 +105,31 @@ public: Devuelve el modo que estamos usando para calcular la carga. \return El modo que estamos usando para calcular la carga. */ - Mode::_v getMode() const throw() { return a_mode; } + Mode::_v getMode() const { return a_mode; } /** * Devuelve el número total de mensajes recibididos. * \return el número total de mensajes recibididos. */ - int getMessageCounter() const throw() { return a_messageCounter; } + int getMessageCounter() const { return a_messageCounter; } /** * Devuelve el número de mensajes tratados correctamente. * \return el número de mensajes tratados correctamente. */ - int getSuccessCounter() const throw() { return a_messageCounter - a_discardedCounter; } + int getSuccessCounter() const { return a_messageCounter - a_discardedCounter; } /** Establece el limite de carga que vamos a imponer. \param limit Limite de carga. Debe ser un valor entre 0 y 100. */ - void setLimit(const int limit) throw(); + void setLimit(const int limit) ; /** Establece el modo en que vamos a calcular la carga. \param mode Modo usado para calcular la carga. */ - void setMode(const Mode::_v mode) throw() { + void setMode(const Mode::_v mode) { if((a_mode = mode) == Mode::Auto) { WHEN_MULTITHREAD(a_effectiveMode = Mode::Local); WHEN_SINGLETHREAD(a_effectiveMode = Mode::Global); @@ -141,7 +141,7 @@ public: Devuelve \em true si esta instancia ha recibido datos o \em false en otro caso. \return \em true si esta instancia ha recibido datos o \em false en otro caso. */ - bool isEmpty() const throw() { return a_avgWorkload.isEmpty(); } + bool isEmpty() const { return a_avgWorkload.isEmpty(); } /** * Establece el nº máximo de bytes que deberían tener los socket en la cola de entrada. @@ -151,7 +151,7 @@ public: * [#comm::Communicator::getReadingChunkSize, min (#comm::Communicator::getReadingChunkSize * 4, #MaxPendingBytes)] * \endcode */ - void setMaxPendingBytes(const int maxPendingBytes) throw(RuntimeException); + void setMaxPendingBytes(const int maxPendingBytes) noexcept(false); /** Devuelve el consejo sobre si debemos tratar/o no el ultimo mensaje recibido @@ -161,7 +161,7 @@ public: , Advice::None para indicar que todavia no tiene datos para tomar una decision clara o Advice::Discard para indicar que debemos descartar. */ - Advice::_v getAdvice(const ClientSocket& clientSocket) throw(); + Advice::_v getAdvice(const ClientSocket& clientSocket) ; /** Devuelve el consejo sobre si debemos tratar/o no el ultimo mensaje recibido @@ -171,7 +171,7 @@ public: , Advice::None para indicar que todavia no tiene datos para tomar una decision clara o Advice::Discard para indicar que debemos descartar. */ - Advice::_v getAdvice(const ClientSocket* clientSocket) throw() { + Advice::_v getAdvice(const ClientSocket* clientSocket) { return (clientSocket == NULL) ? Advice::Process : getAdvice(*clientSocket); } @@ -187,7 +187,7 @@ public: * \see #getLoad * \see #getLevel */ - Workload getAccumulatedWorkload() const throw(); + Workload getAccumulatedWorkload() const ; /** * Devuelve información sobre las estadísticas de carga del socket recibido como parámetro. @@ -203,25 +203,25 @@ public: * \see #getLoad * \see #getLevel */ - Workload getCurrentWorkload(const ClientSocket& clientSocket) const throw(); + Workload getCurrentWorkload(const ClientSocket& clientSocket) const ; /** Devuelve un documento XML con la informacion relevante sobre esta clase. \return un documento XML con la informacion relevante sobre esta clase. */ - xml::Node* asXML(xml::Node* parent) const throw(); + xml::Node* asXML(xml::Node* parent) const ; /** * Extrae la carga media que soporta es proceso. La carga es un número en [0, 100]. * \return la carga media que soporta es proceso. La carga es un número en [0, 100]. */ - static int getLoad(const Workload& workload) throw() { return workload.second; } + static int getLoad(const Workload& workload) { return workload.second; } /** * Extrae el nivel de carga en la que está el proceso. El nivel de carga es un número en [0, 4]. * \return el nivel de carga en la que está el proceso. El nivel de carga es un número en [0, 4]. */ - static int getLevel(const Workload& workload) throw() { return workload.first; } + static int getLevel(const Workload& workload) { return workload.first; } private: static const Millisecond DelayTrace; @@ -247,13 +247,13 @@ private: int a_incomingSocketCounter; Millisecond a_tickTime; - void incrementIncomingSocket() throw(RuntimeException); - void decrementIncomingSocket() throw(RuntimeException); + void incrementIncomingSocket() noexcept(false); + void decrementIncomingSocket() noexcept(false); CongestionController(); CongestionController(const CongestionController&); - int calculeWorkload(const ClientSocket&) const throw(); + int calculeWorkload(const ClientSocket&) const ; friend class Singleton ; diff --git a/include/anna/comm/DatagramSocket.hpp b/include/anna/comm/DatagramSocket.hpp index 77721ea..12c995a 100644 --- a/include/anna/comm/DatagramSocket.hpp +++ b/include/anna/comm/DatagramSocket.hpp @@ -45,30 +45,30 @@ public: Devuelve el modo en que fue instanciado este Socket. \return el modo en que fue instanciado este Socket. */ - Mode getMode() const throw() { return a_mode; } + Mode getMode() const { return a_mode; } /** Devuelve \em true si el socket fue instancia como sólo-lectura. \return \em true si el socket fue instancia como sólo-lectura. */ - const bool isReadOnly() const throw() { return a_mode == ReadOnly; } + const bool isReadOnly() const { return a_mode == ReadOnly; } /** Devuelve \em true si el socket fue instancia como sólo-lectura. \return \em true si el socket fue instancia como sólo-lectura. */ - const bool isWriteOnly() const throw() { return a_mode == WriteOnly; } + const bool isWriteOnly() const { return a_mode == WriteOnly; } /** Prepara el socket para enviar a la direccion indicada en el constructor. */ - void connect() throw(RuntimeException); + void connect() noexcept(false); private: const Mode a_mode; - void do_write(const DataBlock&) throw(RuntimeException); - int do_read(const char* data, const int maxSize) throw(RuntimeException); + void do_write(const DataBlock&) noexcept(false); + int do_read(const char* data, const int maxSize) noexcept(false); }; } diff --git a/include/anna/comm/Delivery.hpp b/include/anna/comm/Delivery.hpp index 01d597b..64c010a 100644 --- a/include/anna/comm/Delivery.hpp +++ b/include/anna/comm/Delivery.hpp @@ -49,12 +49,12 @@ public: Devuelve el nombre del reparto. Coincide con el indicado en el constructor. \return el nombre del reparto. Coincide con el indicado en el constructor. */ - const std::string& getName() const throw() { return a_name; } + const std::string& getName() const { return a_name; } /** Inicializa el reparto de recursos. */ - void initialize() throw(RuntimeException); + void initialize() noexcept(false); /** Devuelve el estado anterior que tenia esta instancia. El resultado de #isAvailable @@ -62,7 +62,7 @@ public: actual de los procesos asociados a este servicio, mientras que este metodo devuelve el estado en el que estaban la ultima vez que se hizo una comprobacion. */ - bool wasAvailable() const throw() { return a_isAvailable; } + bool wasAvailable() const { return a_isAvailable; } /* * Obtiene el periodo de comprobacion de recuperacion de los recusos que han sido @@ -70,7 +70,7 @@ public: * * \return El periodo de comprobacion de recuperacion */ - const Millisecond &getRecoveryTime() const throw() { return a_recoveryTime; } + const Millisecond &getRecoveryTime() const { return a_recoveryTime; } /** * Establece el periodo de comprobacion de recuperacion de los recusos que han sido @@ -78,7 +78,7 @@ public: * * \param recoveryTime Periodo de comprobacion de recuperacion. */ - void setRecoveryTime(const Millisecond &recoveryTime) throw() { a_recoveryTime = recoveryTime; } + void setRecoveryTime(const Millisecond &recoveryTime) { a_recoveryTime = recoveryTime; } /** Comprueba la lista de recursos remotos para comprobar si hay alguno que este disponible @@ -86,14 +86,14 @@ public: \return \em true si tiene algun recurso remoto utilizado o \em false en otro caso. */ - virtual bool isAvailable() const throw(); + virtual bool isAvailable() const ; /** Devuelve la instancia del recurso remoto que debemos usar en esta ocasion. @return La instancia del recurso remoto que debemos usar en esta ocasion. \warning Antes de invocar a este método la instancia se debe proteger de accesos concurrentes */ - Resource* apply() throw(RuntimeException); + Resource* apply() noexcept(false); /** Este metodo sirve a nuestra aplicacion para notificar que el recurso ha dejado de @@ -102,7 +102,7 @@ public: \return \em true si ninguno de los recursos asociados a este reparto de carga estan disponibles o \em false en otro caso. \warning Antes de invocar a este método la instancia se debe proteger de accesos concurrentes */ - bool fault(const Resource* resource) throw(); + bool fault(const Resource* resource) ; /** Este metodo sirve a nuestra aplicacion para que el recurso vuelve a estar disponible. @@ -110,71 +110,71 @@ public: \return \em true si alguno de los recursos asociados a este reparto de carga pasa a estar disponible o \em false en otro caso. \warning Antes de invocar a este método la instancia se debe proteger de accesos concurrentes */ - bool recover(const Resource* resource) throw(); + bool recover(const Resource* resource) ; /** Indica si reparto contiene la referencia a un determinado recurso. \return \em true si contiene la referencia al recurso recibido como parametro o \em false en otro caso. */ - bool contains(const Resource* resource) const throw(); + bool contains(const Resource* resource) const ; /** Devuelve un iterador al comienzo de la lista de recursos remotos asociados a este reparto. \return Un iterador al comienzo de la lista de recursos remotos asociados a este reparto. */ - iterator begin() throw() { return a_resources.begin(); } + iterator begin() { return a_resources.begin(); } /** Devuelve un iterador al comienzo de la lista de recursos remotos asociados a este reparto. \return Un iterador al comienzo de la lista de recursos remotos asociados a este reparto. */ - const_iterator begin() const throw() { return a_resources.begin(); } + const_iterator begin() const { return a_resources.begin(); } /** Devuelve un iterador al final de la lista de recursos remotos asociados a este reparto. \return Un iterador al final de la lista de recursos remotos asociados a este reparto. */ - iterator end() throw() { return a_resources.end(); } + iterator end() { return a_resources.end(); } /** Devuelve el numero de recursos asociados a la lista. \return El numero de recursos asociados a la lista. */ - int size() const throw() { return a_resources.size(); } + int size() const { return a_resources.size(); } /** Devuelve un iterador al final de la lista de recursos remotos asociados a este reparto. \return Un iterador al final de la lista de recursos remotos asociados a este reparto. */ - const_iterator end() const throw() { return a_resources.end(); } + const_iterator end() const { return a_resources.end(); } /** Devuelve una cadena con la informacion referente a este objeto. @return Una cadena con la informacion referente a este objeto. */ - virtual std::string asString() const throw(); + virtual std::string asString() const ; /** Devuelve un nodo XML con la informacion referente a este objeto. \param parent Nodo XML a partir del cual introducir la informacion. \return Un nodo XML con la informacion referente a este objeto. */ - virtual xml::Node* asXML(xml::Node* parent) const throw(); + virtual xml::Node* asXML(xml::Node* parent) const ; /** Devuelve el recurso remoto apuntado por el iterador recibido como parametro. \param ii Iterador usado para recorrer los recursos asociados a este reparto. \return El recurso remoto apuntado por el iterador recibido como parametro. */ - static Resource* resource(iterator& ii) throw() { return *ii; } + static Resource* resource(iterator& ii) { return *ii; } /** Devuelve el recurso remoto apuntado por el iterador recibido como parametro. \param ii Iterador usado para recorrer los recursos asociados a este reparto. \return El recurso remoto apuntado por el iterador recibido como parametro. */ - static const Resource* resource(const_iterator& ii) throw() { return *ii; } + static const Resource* resource(const_iterator& ii) { return *ii; } protected: /** @@ -191,18 +191,18 @@ protected: Conecta el recurso remoto recibido como parametro con este reparto. @param resource Instancia del recurso que vamos a registrar en este reparto. */ - void add(Resource* resource) throw(RuntimeException); + void add(Resource* resource) noexcept(false); /** Inicializa el reparto de recursos. */ - virtual void do_initialize() throw(RuntimeException) = 0; + virtual void do_initialize() noexcept(false) = 0; /** Devuelve la instancia del recurso remoto que debemos que debemos usar en esta ocasion. @return La instancia del recurso remoto que debemos usar en esta ocasion. */ - virtual Resource* do_apply() throw(RuntimeException) = 0; + virtual Resource* do_apply() noexcept(false) = 0; /** Este metodo sirve a nuestra aplicacion para indicar que no fue posible usar el @@ -210,21 +210,21 @@ protected: \param resource Recurso remoto que ha ocasionado el error. \return \em true si ninguno de los recursos asociados a este reparto de carga estan disponibles o \em false en otro caso. */ - virtual bool do_fault(const Resource* resource) throw(); + virtual bool do_fault(const Resource* resource) ; /** Este metodo sirve a nuestra aplicacion para indicar que ha recuperado la conexion con el recurso. \param resource Recurso remoto con el que ha recuperado la conexion. */ - virtual bool do_recover(const Resource* resource) throw(); + virtual bool do_recover(const Resource* resource) ; /** Este metodo sirve a nuestra aplicacion para indicar que ha recuperado la conexion con el recurso. \param resource Recurso remoto con el que ha recuperado la conexion. */ - virtual bool do_contains(const Resource* resource) const throw(); + virtual bool do_contains(const Resource* resource) const ; private: std::string a_name; @@ -233,9 +233,9 @@ private: Millisecond a_recoveryTime; Millisecond a_timeStamp; - bool unsafe_recover(const Resource* resource) throw(); + bool unsafe_recover(const Resource* resource) ; - static bool internalErrorDetected(const Resource* resource) throw(); + static bool internalErrorDetected(const Resource* resource) ; }; } diff --git a/include/anna/comm/Device.hpp b/include/anna/comm/Device.hpp index 6c4e502..1a11525 100644 --- a/include/anna/comm/Device.hpp +++ b/include/anna/comm/Device.hpp @@ -45,19 +45,19 @@ public: Devuelve la direccion asociada a este instancia. \return La direccion asociada a este instancia. */ - in_addr_t getAddress() const throw() { return a_address; } + in_addr_t getAddress() const { return a_address; } /** Devuelve el estado asociado al dispositivo. \return el estado asociado al dispositivo. */ - Status::_v getStatus() const throw() { return a_status; } + Status::_v getStatus() const { return a_status; } /** Establece el estado del dispositivo. \param status Nuevo estado del dispositivo. */ - void setStatus(const Status::_v status) throw() { a_status = status; } + void setStatus(const Status::_v status) { a_status = status; } /** Operador de comparacion. @@ -65,7 +65,7 @@ public: @return \em true si la direccion recibida como parametro coincide con esta. \em false en otro caso. */ - bool operator == (const Device& right) const throw() { return a_address == right.a_address; } + bool operator == (const Device& right) const { return a_address == right.a_address; } /** Operador de comparacion. @@ -73,7 +73,7 @@ public: @return \em true si la direccion recibida como parametro coincide con esta. \em false en otro caso. */ - bool operator == (const in_addr_t& right) const throw() { return a_address == right; } + bool operator == (const in_addr_t& right) const { return a_address == right; } /** Operador de comparacion. @@ -81,7 +81,7 @@ public: @return \em true si la direccion recibida como parametro coincide con esta. \em false en otro caso. */ - bool operator == (const char* ip) const throw() { return a_address == inet_addr(ip); } + bool operator == (const char* ip) const { return a_address == inet_addr(ip); } /** Operador de comparacion. @@ -89,60 +89,60 @@ public: @return \em true si la direccion recibida como parametro coincide con esta. \em false en otro caso. */ - bool operator == (const std::string& ip) const throw() { return a_address == inet_addr(ip.c_str()); } + bool operator == (const std::string& ip) const { return a_address == inet_addr(ip.c_str()); } /** Operador distinto. @return \em true si la direccin recibida como par�etro coincide con �ta o \em false en otro caso. */ - bool operator != (const Device& right) const throw() { return a_address != right.a_address; } + bool operator != (const Device& right) const { return a_address != right.a_address; } /** Operador distinto. @return \em true si la direccin recibida como par�etro no coincide con �ta o \em false en otro caso. */ - bool operator != (const in_addr_t right) const throw() { return a_address != right; } + bool operator != (const in_addr_t right) const { return a_address != right; } /** Devuelve una cadena la informacion mas relevante de esta instancia. @return una cadena la informacion mas relevante de esta instancia. */ - std::string asString() const throw(); + std::string asString() const ; /** Devuelve un documento XML con la informacion mas relevante de esta instancia. \param parent Nodo XML del que deben depender los datos a crear. @return Un documento XML con la informacion mas relevante de esta instancia. */ - xml::Node* asXML(xml::Node* parent) const throw(RuntimeException); + xml::Node* asXML(xml::Node* parent) const noexcept(false); /** Incorpora los paremetros de esta instancia como atributos del nodo XML recibido como parametro. \param node Nodo del que dependen los atributos a crear. */ - void asAttribute(xml::Node* node) const throw(RuntimeException); + void asAttribute(xml::Node* node) const noexcept(false); /** Devuelve el nombre de esta clase. Se puede invocar desde \code template ::asString (const T*); \endcode \return Devuelve el nombre de esta clase. */ - static const char* className() throw() { return "anna::comm::Device"; } + static const char* className() { return "anna::comm::Device"; } /** Devuelve la direccion INET recibida como parametro en formato cadena. \param address Direccion INET a convertir. \return la direccion INET recibida como parametro en formato cadena. */ - static std::string asString(const in_addr_t& address) throw(); + static std::string asString(const in_addr_t& address) ; /** Devuelve la dirección IP recibida como cadena en un tipo in_addr_t. \return la dirección IP recibida como cadena en un tipo in_addr_t. */ - static in_addr_t asAddress(const std::string& ip) throw() { return inet_addr(ip.c_str()); } + static in_addr_t asAddress(const std::string& ip) { return inet_addr(ip.c_str()); } protected: /** diff --git a/include/anna/comm/DirectTransport.hpp b/include/anna/comm/DirectTransport.hpp index 8a55d9c..c5690f6 100644 --- a/include/anna/comm/DirectTransport.hpp +++ b/include/anna/comm/DirectTransport.hpp @@ -48,22 +48,22 @@ public: Devuelve el gestor de capas de transporte asociado a esta clase. \return El gestor de capas de transporte asociado a esta clase. */ - static TransportFactory& getFactory() throw() { return st_transportFactory; } + static TransportFactory& getFactory() { return st_transportFactory; } /** Devuelve el literal que indentifica de esta clase. \return el literal que indentifica de esta clase. */ - static const char* className() throw() { return "anna::comm::DirectTransport"; } + static const char* className() { return "anna::comm::DirectTransport"; } private: static TransportFactoryImpl st_transportFactory; DirectTransport(); - int calculeSize(const DataBlock& dataBlock) throw(RuntimeException) { return dataBlock.getSize(); } - const Message* decode(const DataBlock&) throw(RuntimeException); - const DataBlock& code(Message&) throw(RuntimeException); + int calculeSize(const DataBlock& dataBlock) noexcept(false) { return dataBlock.getSize(); } + const Message* decode(const DataBlock&) noexcept(false); + const DataBlock& code(Message&) noexcept(false); friend class anna::Allocator ; }; diff --git a/include/anna/comm/Handler.hpp b/include/anna/comm/Handler.hpp index 7d90d22..cc38ea1 100644 --- a/include/anna/comm/Handler.hpp +++ b/include/anna/comm/Handler.hpp @@ -60,13 +60,13 @@ public: Devuelve el tipo de controlador. \return el tipo de controlador. */ - Type::_v getType() const throw() { return a_type; } + Type::_v getType() const { return a_type; } /** Devuelve el descriptor de fichero asociado a este controlador. \return el descriptor de fichero asociado a este controlador. */ - int getfd() const throw() { return a_fd; } + int getfd() const { return a_fd; } /** Devuelve \em true si el descriptor de fichero asociado a este controlador soporta @@ -74,7 +74,7 @@ public: \return \em true si el descriptor de fichero asociado a este controlador soporta control de congestion o \em false en otro caso. */ - bool supportCongestionControl() const throw() { return (a_support & Support::CongestionControl) != 0; } + bool supportCongestionControl() const { return (a_support & Support::CongestionControl) != 0; } /** Devuelve \em true si este manejador soporta control de temporizacion o \em false en otro @@ -82,45 +82,45 @@ public: \return \em true si este manejador soporta control de temporizacion o \em false en otro caso. */ - bool supportTimeout() const throw() { return a_timeout > 0; } + bool supportTimeout() const { return a_timeout > 0; } /** Operador de comparacion. \param fd Descriptor de fichero con el que comparar. \return \em true si el fd recibido es igual al establecido con #setfd o \em false en caso contrario. */ - bool operator == (const int fd) const throw() { return a_fd == fd; } + bool operator == (const int fd) const { return a_fd == fd; } /** Metodo invocado por el comunicador cuando detectado actividad en el descriptor de fichero asociado a este controlador. */ - virtual void apply() throw(RuntimeException) = 0; + virtual void apply() noexcept(false) = 0; /** Devuelve el ClientSocket asociado a este manejador de conexiones. \return El ClientSocket asociado a este manejador de conexiones. Puede ser NULL. \warning Uso interno. Se necesita para poder cooperar con el anna::comm::CongestionController. */ - virtual ClientSocket* getClientSocket() throw() { return NULL; } + virtual ClientSocket* getClientSocket() { return NULL; } /** Devuelve una cadena con la informacion referente a esta instancia. \return una cadena con la informacion referente a esta instancia. */ - virtual std::string asString() const throw(); + virtual std::string asString() const ; /** Devuelve un documento XML con la informacion referente a esta instancia. \return un documento XML con la informacion referente a esta instancia. */ - virtual xml::Node* asXML(xml::Node* parent) const throw(RuntimeException); + virtual xml::Node* asXML(xml::Node* parent) const noexcept(false); /** Amplia la informacion XML del nodo recibido como parametro. \param node Nodo XML en el que incorporar los atributos. */ - void asAttribute(xml::Node* node) const throw(RuntimeException); + void asAttribute(xml::Node* node) const noexcept(false); protected: /** @@ -165,14 +165,14 @@ protected: \warning La implementacion del metodo initialize debe invocar a este metodo con descriptor de fichero valido. */ - void setfd(const int fd) throw() { setId(anna::functions::asText("Handler", a_fd = fd)); } + void setfd(const int fd) { setId(anna::functions::asText("Handler", a_fd = fd)); } /** Establece el numero de milisegundos maximo que puede estar este manejador sin recibir mensajes antes de ser cerrado por el nucleo. \param timeout Numero de milisegundos maximo sin recibir mensajes. */ - void setTimeout(const Millisecond &timeout) throw() { + void setTimeout(const Millisecond &timeout) { a_timeout = timeout; a_maxTime = functions::hardwareClock() + a_timeout; } @@ -181,7 +181,7 @@ protected: En los manejadores que pueden recibir mas de una peticion en cada llamada a apply este metodo debe ser invocado para saber si debe dejar de procesar mensajes. */ - bool canContinue() const throw() { return hasRequestedStop() == false; } + bool canContinue() const { return hasRequestedStop() == false; } /** Metodo con el que podemos redefinir el comportamiento cuando recibe la notificacion de @@ -189,7 +189,7 @@ protected: \param address Direccion IP que ha dejado de estar disponible. \warning Se invoca automaticamente desde el comunicador. */ - virtual void breakAddress(const in_addr_t& address) throw() {;} + virtual void breakAddress(const in_addr_t& address) {;} /** Metodo con el que podemos redefinir el comportamiento cuando recibe la notificacion de @@ -197,7 +197,7 @@ protected: \param address Direccion IP que ha pasado a estar disponible. \warning Se invoca automaticamente desde el comunicador. */ - virtual void recoverAddress(const in_addr_t& address) throw() {;} + virtual void recoverAddress(const in_addr_t& address) {;} /** * Método que se invoca periódicamente para comprobar si tenemos pendiente el cierre de la conexión @@ -205,7 +205,7 @@ protected: * * \return \em true Si termina la conexión o \em false en otro caso. */ - virtual bool testClose() throw(RuntimeException) { return false;} + virtual bool testClose() noexcept(false) { return false;} /** Metodo con el que podemos redefinir el comportamiento cuando recibe la notificacion de @@ -213,14 +213,14 @@ protected: \warning Se invoca automaticamente desde el comunicador al invocar al metodo \em detach correspondiente. */ - virtual void finalize() throw() {;} + virtual void finalize() {;} /** * Metodo con el que podemos redefinir el comportamiento cuando recibe la notificacion de * que el componente asociado a este controlador ha sido duplicado en un proceso hijo. * \warning Exclusivamente uso interno. */ - virtual void clone() throw(RuntimeException) {;} + virtual void clone() noexcept(false) {;} private: const Type::_v a_type; @@ -231,8 +231,8 @@ private: int a_loop; Handler(const Handler&); - void do_action() throw(RuntimeException); - void beat(const Microsecond& now) throw() { a_maxTime = now + a_timeout; } + void do_action() noexcept(false); + void beat(const Microsecond& now) { a_maxTime = now + a_timeout; } bool isTimeout(const Microsecond& now) { return a_maxTime > 0 && a_maxTime <= now; } friend class Communicator; diff --git a/include/anna/comm/Host.hpp b/include/anna/comm/Host.hpp index f95a36c..b6fbb23 100644 --- a/include/anna/comm/Host.hpp +++ b/include/anna/comm/Host.hpp @@ -53,7 +53,7 @@ class Host : public Mutex { struct SortBy { - static int value(const Server* server) throw(); + static int value(const Server* server) ; }; std::string a_name; @@ -79,7 +79,7 @@ public: @return El nombre logico de esta maquina. */ - const std::string& getName() const throw() { return a_name; } + const std::string& getName() const { return a_name; } /** Crea y registra un nuevo proceso servidor sobre esta maquina (maquina, remotePort) con el nombre indicado. @@ -96,7 +96,7 @@ public: @return La instancia del nuevo proceso servidor */ Server* createServer(const char* name, const int remotePort, const bool autoRecovery, TransportFactory* transportFactory = NULL, const bool ignoreIncomingMessages = false, const bool doConnect = true) - throw(RuntimeException) { + noexcept(false) { return createServer(std::string(name), remotePort, autoRecovery, transportFactory, ignoreIncomingMessages, doConnect); } @@ -115,7 +115,7 @@ public: @return La instancia del nuevo proceso servidor */ Server* createServer(const std::string& name, const int remotePort, const bool autoRecovery, TransportFactory* transportFactory = NULL, const bool ignoreIncomingMessages = false, const bool doConnect = true) - throw(RuntimeException); + noexcept(false); /** Crea y registra un nuevo proceso servidor sobre esta maquina (maquina, remotePort) con el nombre indicado. @@ -124,31 +124,31 @@ public: @return La instancia del nuevo proceso servidor */ - Server* createServer(const ServerAllocator& serverAllocator) throw(RuntimeException); + Server* createServer(const ServerAllocator& serverAllocator) noexcept(false); /** Devuelve un iterador al comienzo de la lista de servidores asociados a esta maquina. \return Un iterador al comienzo de la lista de servidores asociados a esta maquina. */ - server_iterator server_begin() throw() { return a_servers.begin(); } + server_iterator server_begin() { return a_servers.begin(); } /** Devuelve un iterador al comienzo de la lista de servidores asociados a esta maquina. \return Un iterador al comienzo de la lista de servidores asociados a esta maquina. */ - const_server_iterator server_begin() const throw() { return a_servers.begin(); } + const_server_iterator server_begin() const { return a_servers.begin(); } /** Devuelve un iterador al comienzo de la lista de servidores asociados a esta maquina. \return Un iterador al final de la lista de servidores asociados a esta maquina. */ - server_iterator server_end() throw() { return a_servers.end(); } + server_iterator server_end() { return a_servers.end(); } /** Devuelve un iterador al comienzo de la lista de servidores asociados a esta maquina. \return Un iterador al final de la lista de servidores asociados a esta maquina. */ - const_server_iterator server_end() const throw() { return a_servers.end(); } + const_server_iterator server_end() const { return a_servers.end(); } /** Devuelve la instancia del servidor sobre el que esta posicionado el iterador recibido @@ -156,7 +156,7 @@ public: \param ii Iterador que debera estar comprendido entre begin y end. \return La instancia del servidor sobre el que esta posicionado el iterador recibido */ - static Server* server(server_iterator ii) throw() { return server_container::data(ii); } + static Server* server(server_iterator ii) { return server_container::data(ii); } /** Devuelve la instancia del servidor sobre el que esta posicionado el iterador recibido @@ -164,20 +164,20 @@ public: \param ii Iterador que debera estar comprendido entre begin y end. \return La instancia del servidor sobre el que esta posicionado el iterador recibido */ - static const Server* server(const_server_iterator ii) throw() { return server_container::data(ii); } + static const Server* server(const_server_iterator ii) { return server_container::data(ii); } /** Devuelve un iterador al comienzo de la lista de direcciones IPs asociadas a esta maquina. \return Un iterador al comienzo de la lista de direcciones IPs asociadas a esta maquina. */ - const_device_iterator device_begin() const throw() { return a_devices.begin(); } + const_device_iterator device_begin() const { return a_devices.begin(); } /** Devuelve un iterador al final de la lista de direcciones IPs asociadas a esta maquina. \return Un iterador al final de la lista de direcciones IPs asociadas a esta maquina. */ - const_device_iterator device_end() const throw() { return a_devices.end(); } + const_device_iterator device_end() const { return a_devices.end(); } /** Devuelve la instancia de la IP sobre el que esta posicionado el iterador recibido @@ -185,7 +185,7 @@ public: \param ii Iterador que debera estar comprendido entre begin y end. \return La instancia de la sobre el que esta posicionado el iterador recibido */ - static const Device* device(const_device_iterator ii) throw() { return *ii; } + static const Device* device(const_device_iterator ii) { return *ii; } /** * Devuelve la instancia del proceso servidor asociado al puerto recibido como parametro. Si @@ -198,7 +198,7 @@ public: * * @see #createServer */ - const Server* find_server(const int remotePort) const throw(); + const Server* find_server(const int remotePort) const ; /** * Devuelve la instancia del proceso servidor asociado al puerto recibido como parametro. Si @@ -211,12 +211,12 @@ public: * * @see #createServer */ - Server* find_server(const int remotePort) throw(); + Server* find_server(const int remotePort) ; /** Incorpora un dispositivo de red. \param device Dispositivo de red a incorporar. */ - void assign(const Device* device) throw(RuntimeException); + void assign(const Device* device) noexcept(false); /** Devuelve \em true si el dispositivo de red recibido fue asignado a esta maquina o \em @@ -227,7 +227,7 @@ public: \see #assign */ bool contains(const Device* device) const - throw() { + { const_device_iterator end = device_end(); return (std::find(device_begin(), end, device) != end); } @@ -236,14 +236,14 @@ public: Devuelve una cadena con la informacin referente a esta maquina. @return Una cadena con la informacin referente a esta maquina. */ - std::string asString() const throw(); + std::string asString() const ; /** Devuelve un nodo XML con la informacin referente a este objeto. \param parent Nodo XML a partir del cual introducir la informacin. \return Un nodo XML con la informacin referente a este objeto. */ - xml::Node* asXML(xml::Node* parent) const throw(RuntimeException); + xml::Node* asXML(xml::Node* parent) const noexcept(false); protected: @@ -259,7 +259,7 @@ private: device_container a_devices; server_container a_servers; - Server* add(Server*, const int remotePort, const bool doConnect) throw(); + Server* add(Server*, const int remotePort, const bool doConnect) ; friend class Network; }; diff --git a/include/anna/comm/INetAddress.hpp b/include/anna/comm/INetAddress.hpp index 91f6d2e..167bcc0 100644 --- a/include/anna/comm/INetAddress.hpp +++ b/include/anna/comm/INetAddress.hpp @@ -56,68 +56,68 @@ public: \param exceptionWhenNull Exception is launched in case the device returned is NULL. \return Device (address) associated to this instance. */ - const Device* getDevice(const bool exceptionWhenNull = true) const throw(RuntimeException); + const Device* getDevice(const bool exceptionWhenNull = true) const noexcept(false); /** Returns the port associated to this instance. \return Port associated to this instance. */ - int getPort() const throw() { return a_port; } + int getPort() const { return a_port; } /** Sets the address for this instance. \param device Address provided. */ - void setAddress(const Device* device) throw() { a_device = device; } + void setAddress(const Device* device) { a_device = device; } /** Sets the port for this instance. \param port Port provided. */ - void setPort(const int port) throw() { a_port = port; } + void setPort(const int port) { a_port = port; } /** Copy operator. \param right Source address to be copied. */ - INetAddress& operator = (const INetAddress& right) throw() { a_device = right.a_device; a_port = right.a_port; return *this; } + INetAddress& operator = (const INetAddress& right) { a_device = right.a_device; a_port = right.a_port; return *this; } /** Comparison operator. \param right Source address to be compared. @return \em true when address provided is equal to this \em false in other case. */ - bool operator == (const INetAddress& right) const throw() { return a_device == right.a_device && a_port == right.a_port; } + bool operator == (const INetAddress& right) const { return a_device == right.a_device && a_port == right.a_port; } /** Returns the initialized state for this network address. @return \em true when initialized, \em false when not. */ - bool isNull() const throw() { return (a_device == NULL || a_port == -1); } + bool isNull() const { return (a_device == NULL || a_port == -1); } /** Clear the content for this instance. */ - void clear() throw() { a_device = NULL; a_port = -1; } + void clear() { a_device = NULL; a_port = -1; } /** Returns string with relevant information for this instance. @return string with relevant information for this instance. */ - std::string asString() const throw(); + std::string asString() const ; /** Returns string with low-level format relevant information for this instance. @return string with low-level format relevant information for this instance. */ - std::string serialize() const throw(); + std::string serialize() const ; /** Returns XML document with relevant information for this instance. \param parent XML node from which created data will depend on. @return XML document with relevant information for this instance. */ - xml::Node* asXML(xml::Node* parent) const throw(RuntimeException); + xml::Node* asXML(xml::Node* parent) const noexcept(false); private: const Device* a_device; diff --git a/include/anna/comm/IndexedDelivery.hpp b/include/anna/comm/IndexedDelivery.hpp index 965801e..f94bfc5 100644 --- a/include/anna/comm/IndexedDelivery.hpp +++ b/include/anna/comm/IndexedDelivery.hpp @@ -54,11 +54,11 @@ public: \param key Clave usada para calcular el servidor destino. \warning Este metodo debe invocarse siempre antes de enviar un mensaje. */ - void prepare(const int key) throw(RuntimeException); + void prepare(const int key) noexcept(false); - std::string asString() const throw(); + std::string asString() const ; - xml::Node* asXML(xml::Node* parent) const throw(); + xml::Node* asXML(xml::Node* parent) const ; /** Metodo que devuelve el nombre completo de este selector de recursos. @@ -66,7 +66,7 @@ public: a los que pertenece la clase. \return Una cadena con el nombre de este selector. */ - static const char* className() throw() { return "anna::comm::IndexedDelivery"; } + static const char* className() { return "anna::comm::IndexedDelivery"; } private: //------------------------------------------------------------------------------------ @@ -75,8 +75,8 @@ private: const Mode::_v a_mode; iterator a_iikey; - virtual void do_initialize() throw(RuntimeException) {;} - comm::Resource* do_apply() throw(RuntimeException); + virtual void do_initialize() noexcept(false) {;} + comm::Resource* do_apply() noexcept(false); }; } diff --git a/include/anna/comm/LargeBinaryCodec.hpp b/include/anna/comm/LargeBinaryCodec.hpp index 660197d..4bd6e3f 100644 --- a/include/anna/comm/LargeBinaryCodec.hpp +++ b/include/anna/comm/LargeBinaryCodec.hpp @@ -59,61 +59,61 @@ public: /** Elimina el contenido del mensaje asociado a este objeto. */ - void clear() throw(RuntimeException) { a_dataBlock.clear(); } + void clear() noexcept(false) { a_dataBlock.clear(); } /** Amplia el contenido del mensaje con el contenido del bloque de memoria recibido. \param dataBlock Bloque de memoria con el que vamos a ampliar el mensaje. \return La referencia a este objeto. */ - LargeBinaryCodec& operator += (const DataBlock& dataBlock) throw(RuntimeException); + LargeBinaryCodec& operator += (const DataBlock& dataBlock) noexcept(false); /** Transfiene la informacin contenida en el bloque de memoria recibido hacia las variables asociadas a este mensaje interno. \param dataBlock Bloque de memoria que contiene las variables codificadas. Para acceder la lista de bloques que componen el mensaje recibido se deben utilizar los metodo begin y end. */ - virtual void decode(const DataBlock& dataBlock) throw(RuntimeException); + virtual void decode(const DataBlock& dataBlock) noexcept(false); /** Devuelve el iterador que apunta al comienzo de la serializacin. \return El iterador que apunta al comienzo de la serializacin. \warning El valor de este metodo solo sera valido despues de invocar a decode. */ - const_iterator begin() const throw() { return a_blocks.begin(); } + const_iterator begin() const { return a_blocks.begin(); } /** Devuelve el iterador que apunta al final de la serializacin. \return El iterador que apunta al final de la serializacin. \warning El valor de este metodo solo sera valido despues de invocar a decode. */ - const_iterator end() const throw() { return a_blocks.end(); } + const_iterator end() const { return a_blocks.end(); } /** * Devuelve el número de bloques contenidos en el mensaje. * \return el número de bloques contenidos en el mensaje. */ - int size() const throw() { return a_blocks.size(); } + int size() const { return a_blocks.size(); } /** Devuelve el puntero al objeto referenciado por el iterador recibido como parametro. \param ii Iterador. \return el puntero al objeto referenciado por el iterador recibido como parametro. */ - static const DataBlock* data(const_iterator ii) throw() { return *ii; } + static const DataBlock* data(const_iterator ii) { return *ii; } /** Devuelve el puntero al objeto referenciado por el iterador recibido como parametro. \param ii Iterador. \return el puntero al objeto referenciado por el iterador recibido como parametro. */ - static DataBlock* data(iterator ii) throw() { return *ii; } + static DataBlock* data(iterator ii) { return *ii; } private: DataBlock a_dataBlock; std::vector a_blocks; - void reset() throw(); + void reset() ; }; } diff --git a/include/anna/comm/LiteTransport.hpp b/include/anna/comm/LiteTransport.hpp index feb7566..68be0e1 100644 --- a/include/anna/comm/LiteTransport.hpp +++ b/include/anna/comm/LiteTransport.hpp @@ -39,22 +39,22 @@ public: Returns the class name literal. @return class name literal. */ - static const char* className() throw() { return "anna::comm::LiteTransport"; } + static const char* className() { return "anna::comm::LiteTransport"; } /** Returns the transport factory associated to this class @return transport factory associated to this class */ - static TransportFactory& getFactory() throw() { return st_transportFactory; } + static TransportFactory& getFactory() { return st_transportFactory; } private: static TransportFactoryImpl st_transportFactory; LiteTransport(); - int calculeSize(const DataBlock&) throw(RuntimeException); - const Message* decode(const DataBlock&) throw(RuntimeException); - const DataBlock& code(Message&) throw(RuntimeException); + int calculeSize(const DataBlock&) noexcept(false); + const Message* decode(const DataBlock&) noexcept(false); + const DataBlock& code(Message&) noexcept(false); friend class anna::Allocator ; }; diff --git a/include/anna/comm/Message.hpp b/include/anna/comm/Message.hpp index f3ee6f6..e82499f 100644 --- a/include/anna/comm/Message.hpp +++ b/include/anna/comm/Message.hpp @@ -39,7 +39,7 @@ public: Devuelve la referencia al cuerpo de este mensaje. \return la referencia al cuerpo de este mensaje. */ - const DataBlock& getBody() const throw() { return *this; } + const DataBlock& getBody() const { return *this; } /** Establece el cuerpo de este mensaje. @@ -48,7 +48,7 @@ public: \warning Si el contructor activa el sistema de optimizacion de renidmiento el bloque de memoria no se copia, por lo que deberia estar disponible, al menos hasta que invoquemos al metodo Message::code. */ - Message * setBody(const DataBlock& body) throw(RuntimeException) { assign(body); return this; } + Message * setBody(const DataBlock& body) noexcept(false) { assign(body); return this; } /** Establece el cuerpo de este mensaje. @@ -58,7 +58,7 @@ public: \warning El bloque de memoria no se copia, por lo que deberia estar disponible, al menos hasta que invoquemos al metodo Message::code. */ - Message * setBody(const char* buffer, const int size) throw(RuntimeException) { + Message * setBody(const char* buffer, const int size) noexcept(false) { DataBlock aux(buffer, size, false); assign(aux); return this; @@ -69,19 +69,19 @@ public: * nodo XML recibido como parámetro. * \param node Nodo XML que contiene el documento XML. */ - virtual Message * setBody(const xml::Node* node) throw(RuntimeException); + virtual Message * setBody(const xml::Node* node) noexcept(false); /** Elimina el contenido del cuerpo de este mensaje. */ - void clearBody() throw() { clear(); } + void clearBody() { clear(); } /** Codifica este mensaje, por defecto no realiza ninguna operacion y retorna el contenido del cuerpo tal y con este. \return El bloque de datos que contiene el mensaje codificado. */ - virtual const DataBlock& code() throw(RuntimeException) { return *this; } + virtual const DataBlock& code() noexcept(false) { return *this; } protected: struct StatusCodeBuffer { enum _v { None, Reserve, Copy }; }; diff --git a/include/anna/comm/Network.hpp b/include/anna/comm/Network.hpp index ab7d439..08a9527 100644 --- a/include/anna/comm/Network.hpp +++ b/include/anna/comm/Network.hpp @@ -62,19 +62,19 @@ public: @return La instancia del dispositivo que coincide con la direccion IP recibida como parametro. */ - Device* find(const in_addr_t& address) throw(); + Device* find(const in_addr_t& address) ; /** Devuelve un iterador al comienzo de la lista de dispositivos de red. \return un iterador al comienzo de la lista de dispositivos de red. */ - const_device_iterator device_begin() const throw() { return a_devices.begin(); } + const_device_iterator device_begin() const { return a_devices.begin(); } /** Devuelve un iterador al final de la lista de dispositivos de red. \return un iterador al final de la lista de dispositivos de red. */ - const_device_iterator device_end() const throw() { return a_devices.end(); } + const_device_iterator device_end() const { return a_devices.end(); } /** Devuelve un puntero al elemento sobre el que se encuentra el iterador pasado como @@ -83,19 +83,19 @@ public: \return un puntero al elemento sobre el que se encuentra el iterador pasado como parametro. */ - static const Device* device(const_device_iterator ii) throw() { return *ii; } + static const Device* device(const_device_iterator ii) { return *ii; } /** Devuelve un iterador al comienzo de la lista de dispositivos de red. \return un iterador al comienzo de la lista de dispositivos de red. */ - device_iterator device_begin() throw() { return a_devices.begin(); } + device_iterator device_begin() { return a_devices.begin(); } /** Devuelve un iterador al final de la lista de dispositivos de red. \return un iterador al final de la lista de dispositivos de red. */ - device_iterator device_end() throw() { return a_devices.end(); } + device_iterator device_end() { return a_devices.end(); } /** Devuelve un puntero al elemento sobre el que se encuentra el iterador pasado como @@ -104,7 +104,7 @@ public: \return un puntero al elemento sobre el que se encuentra el iterador pasado como parametro. */ - static Device* device(device_iterator ii) throw() { return *ii; } + static Device* device(device_iterator ii) { return *ii; } /** Realiza una busqueda secuencial entre todas las maquinas y devuelve la instancia de la @@ -115,7 +115,7 @@ public: @return La instancia de la maquina asociada al nombre recibido. */ - Host* find_host(const char* name) throw(); + Host* find_host(const char* name) ; /** Realiza una busqueda secuencial entre todas las maquinas y devuelve la instancia de la @@ -126,7 +126,7 @@ public: @return La instancia de la maquina asociada al nombre recibido. */ - Host* find_host(const std::string& name) throw() { return find_host(name.c_str()); } + Host* find_host(const std::string& name) { return find_host(name.c_str()); } /** * Resuelve el nombre de la maquina recibido como parametro y devuelve la instancia @@ -143,7 +143,7 @@ public: * * \see man gethostbyname. */ - Host* resolve(const char* hostname) throw(RuntimeException); + Host* resolve(const char* hostname) noexcept(false); /** * Resuelve el nombre de la maquina recibido como parametro y devuelve la instancia @@ -160,19 +160,19 @@ public: * * \see man gethostbyname. */ - Host* resolve(const std::string& hostname) throw(RuntimeException) { return resolve(hostname.c_str()); } + Host* resolve(const std::string& hostname) noexcept(false) { return resolve(hostname.c_str()); } /** Devuelve un iterador al comienzo de la lista de maquinas no modificables. \return Un iterador al comienzo de la lista de maquinas no modificables. */ - const_host_iterator host_begin() const throw() { return a_hosts.begin(); } + const_host_iterator host_begin() const { return a_hosts.begin(); } /** Devuelve un iterador al final de la lista de maquinas no modificables. \return Un iterador al final de la lista de maquinas no modificables. */ - const_host_iterator host_end() const throw() { return a_hosts.end(); } + const_host_iterator host_end() const { return a_hosts.end(); } /** Devuelve un puntero al elemento sobre el que se encuentra el iterador pasado como @@ -181,19 +181,19 @@ public: \return un puntero al elemento sobre el que se encuentra el iterador pasado como parametro. */ - static const Host* host(const_host_iterator ii) throw() { return *ii; } + static const Host* host(const_host_iterator ii) { return *ii; } /** Devuelve un iterador al comienzo de la lista de maquinas no modificables. \return Un iterador al comienzo de la lista de maquinas no modificables. */ - host_iterator host_begin() throw() { return a_hosts.begin(); } + host_iterator host_begin() { return a_hosts.begin(); } /** Devuelve un iterador al final de la lista de maquinas no modificables. \return Un iterador al final de la lista de maquinas no modificables. */ - host_iterator host_end() throw() { return a_hosts.end(); } + host_iterator host_end() { return a_hosts.end(); } /** Devuelve un puntero al elemento sobre el que se encuentra el iterador pasado como @@ -202,7 +202,7 @@ public: \return un puntero al elemento sobre el que se encuentra el iterador pasado como parametro. */ - static Host* host(host_iterator ii) throw() { return *ii; } + static Host* host(host_iterator ii) { return *ii; } /** Crea la instancia de un anna::comm::Server disponible para conectar con la @@ -220,7 +220,7 @@ public: \warning Con modo de puerto unico, si ya existe un proceso definido sobre esa misma IP:port retorna la misma instancia. */ Server* createServer(const char* ip, const int remotePort, const bool autoRecovery, TransportFactory* transportFactory = NULL, const Port::_v mode = Port::Multiple, const DoConnect::_v doConnect = DoConnect::Yes) - throw(RuntimeException); + noexcept(false); /** Crea la instancia de un anna::comm::Server disponible para conectar con la @@ -239,7 +239,7 @@ public: \warning Con modo de puerto unico, si ya existe un proceso definido sobre esa misma IP:port retorna la misma instancia. */ Server* createServer(const char* ip, const int remotePort, const bool autoRecovery, ReceiverFactory& receiverFactory, TransportFactory* transportFactory = NULL, const Port::_v mode = Port::Multiple, const DoConnect::_v doConnect = DoConnect::Yes) - throw(RuntimeException); + noexcept(false); // /** // Devuelve la instancia del anna::comm::Server asociado a la IP y puerto recibidos. @@ -250,7 +250,7 @@ public: // \return La instancia de comm::Server asociado al IP y puerto recibido. // \warning El anna::comm::Server devuelto puede ser NULL. // */ -// Server* findServer (const char* ip, const int remotePort) throw (RuntimeException); +// Server* findServer (const char* ip, const int remotePort) noexcept(false); /** Crea la instancia de un anna::comm::Server disponible para conectar con la @@ -269,7 +269,7 @@ public: \warning Con modo de puerto unico, si ya existe un proceso definido sobre esa misma IP:port retorna la misma instancia. */ Server* resolveServer(const char* hostname, const int remotePort, const bool autoRecovery, TransportFactory* transportFactory = NULL, const Port::_v mode = Port::Multiple, const DoConnect::_v doConnect = DoConnect::Yes) - throw(RuntimeException); + noexcept(false); /** Crea la instancia de un anna::comm::Server disponible para conectar con la @@ -289,7 +289,7 @@ public: \warning Con modo de puerto unico, si ya existe un proceso definido sobre esa misma IP:port retorna la misma instancia. */ Server* resolveServer(const char* hostname, const int remotePort, const bool autoRecovery, ReceiverFactory& receiverFactory, TransportFactory* transportFactory = NULL, const Port::_v mode = Port::Multiple, const DoConnect::_v doConnect = DoConnect::Yes) - throw(RuntimeException); + noexcept(false); /** @@ -298,7 +298,7 @@ public: * \param port Puerto de la dirección de red. * \return la INetAddress correspondiente a la IP y puerto recibidos como parámetro. */ - INetAddress getINetAddress(const char* ip, const int port) throw(RuntimeException); + INetAddress getINetAddress(const char* ip, const int port) noexcept(false); /** * Obtiene la INetAddress correspondiente a la IP y puerto recibidos como parámetro. @@ -306,7 +306,7 @@ public: * \param port Puerto de la dirección de red. * \return la INetAddress correspondiente a la IP y puerto recibidos como parámetro. */ - INetAddress getINetAddress(const std::string& ip, const int port) throw(RuntimeException); + INetAddress getINetAddress(const std::string& ip, const int port) noexcept(false); /** @@ -314,7 +314,7 @@ public: \param parent Nodo XML del que dependende la informacion. @return Una cadena con la informacin referente a esta instancia. */ - xml::Node* asXML(xml::Node* parent) const throw(); + xml::Node* asXML(xml::Node* parent) const ; private: host_container a_hosts; diff --git a/include/anna/comm/Receiver.hpp b/include/anna/comm/Receiver.hpp index 41c98b0..541523b 100644 --- a/include/anna/comm/Receiver.hpp +++ b/include/anna/comm/Receiver.hpp @@ -36,7 +36,7 @@ public: * Devuelve el nombre lógico de éste receptor. * \return el nombre lógico de éste receptor. */ - const std::string& getName() const throw() { return a_name; } + const std::string& getName() const { return a_name; } /** Metodo manejador de los mensajes recibidos por el socket. En entornos MT cada socket invocara @@ -47,32 +47,32 @@ public: decodificado aplicando las reglas establecidas por la capa de transporte asociado al ClientSocket por el que llega el mensaje. */ - virtual void apply(ClientSocket& clientSocket, const Message& message) throw(RuntimeException) = 0; + virtual void apply(ClientSocket& clientSocket, const Message& message) noexcept(false) = 0; /** * Método manejador de la notificación de que el socket va a ser cerrado. * param clientSocket Socket cliente que va a ser cerrado. */ - virtual void eventBreakConnection(const comm::ClientSocket& clientSocket) throw() {;} + virtual void eventBreakConnection(const comm::ClientSocket& clientSocket) {;} /** * Método manejador de la notificación de que el socket va a ser cerrado. * param clientSocket Socket cliente que va a ser cerrado. */ - virtual void eventBreakLocalConnection(const comm::ClientSocket& clientSocket) throw() {;} + virtual void eventBreakLocalConnection(const comm::ClientSocket& clientSocket) {;} /** * Método manejador de la notificación de que se ha creado una nueva conexion * @param server Proceso servidor con el que hemos establecido la conexion. */ - virtual void eventCreateConnection(const Server* server) throw() {;} + virtual void eventCreateConnection(const Server* server) {;} /** Devuelve una cadena con toda la informacion relevante de este objeto. \return una cadena con toda la informacion relevante de este objeto. */ virtual std::string asString() const - throw() { + { std::string msg("anna::comm::Receiver { Name: "); msg += a_name; return msg += " }"; @@ -83,7 +83,7 @@ public: \param parent Nodo XML a partir del cual introducir la informacion. \return Un nodo XML con la informacion referente a este objeto. */ - virtual xml::Node* asXML(xml::Node* parent) const throw(RuntimeException) { + virtual xml::Node* asXML(xml::Node* parent) const noexcept(false) { xml::Node* node = parent->createChild("comm.Receiver"); node->createAttribute("Name", a_name); return node; @@ -99,7 +99,7 @@ protected: /** Metodo invocado por el ReceiverFactory en el momento de pasar a usar esta instancia. */ - virtual void initialize() throw(RuntimeException) { ; } + virtual void initialize() noexcept(false) { ; } private: std::string a_name; diff --git a/include/anna/comm/ReceiverFactory.hpp b/include/anna/comm/ReceiverFactory.hpp index db883fc..68bf460 100644 --- a/include/anna/comm/ReceiverFactory.hpp +++ b/include/anna/comm/ReceiverFactory.hpp @@ -39,8 +39,8 @@ class Receiver; private: anna::Recycler a_receivers; - Receiver* do_create () throw () { return a_receivers.create (); } - void do_release (Receiver* receiver) throw () { a_receivers.release (static_cast (receiver)); } + Receiver* do_create () { return a_receivers.create (); } + void do_release (Receiver* receiver) { a_receivers.release (static_cast (receiver)); } }; \endcode @@ -56,7 +56,7 @@ public: Returns the logical name for this receiver factory. @return logical name for this receiver factory. */ - const std::string& getName() const throw() { return a_name; } + const std::string& getName() const { return a_name; } /** Creates a receiver instance for this factory. Reuse resources when needed. @@ -64,7 +64,7 @@ public: \return The new receiver instance. \warning All the receivers obtained shall be released by mean #release. */ - Receiver* create() throw(RuntimeException); + Receiver* create() noexcept(false); /** Release the receiver instance provided. @@ -72,14 +72,14 @@ public: \return The receiver instance to be released. \warning The parameter should have been obtained by mean #create. */ - void release(Receiver* receiver) throw(); + void release(Receiver* receiver) ; /** Returns a string with relevant information for this instance. @return string with relevant information for this instance. */ std::string asString() const - throw() { + { std::string msg("anna::comm::ReceiverFactory { Name: "); msg += a_name; return msg += " }"; @@ -90,7 +90,7 @@ public: \param parent XML node from which created data will depend on. @return a XML document with relevant information for this instance. */ - xml::Node* asXML(xml::Node* parent) const throw(); + xml::Node* asXML(xml::Node* parent) const ; protected: /** @@ -106,7 +106,7 @@ protected: \return The new receiver instance. \warning All the receivers obtained shall be released by mean #release. */ - virtual Receiver* do_create() throw() = 0; + virtual Receiver* do_create() = 0; /** Release the receiver provided. This method is called from a critical section activated @@ -114,7 +114,7 @@ protected: \param The receiver instance to be released. */ - virtual void do_release(Receiver* receiver) throw() = 0; + virtual void do_release(Receiver* receiver) = 0; private: const std::string a_name; diff --git a/include/anna/comm/ReceiverFactoryImpl.hpp b/include/anna/comm/ReceiverFactoryImpl.hpp index 4c22bbc..0d29f10 100644 --- a/include/anna/comm/ReceiverFactoryImpl.hpp +++ b/include/anna/comm/ReceiverFactoryImpl.hpp @@ -26,7 +26,7 @@ class Factory; vacio y un metodo que devuelve el nombre de la clase con la firma: \code - static const char* className () throw (); + static const char* className () ; \encode */ template class ReceiverFactoryImpl : public ReceiverFactory { @@ -39,8 +39,8 @@ public: private: Recycler a_receivers; - Receiver* do_create() throw() { return a_receivers.create(); } - void do_release(Receiver* receiver) throw() { a_receivers.release(static_cast (receiver)); } + Receiver* do_create() { return a_receivers.create(); } + void do_release(Receiver* receiver) { a_receivers.release(static_cast (receiver)); } }; } diff --git a/include/anna/comm/Resource.hpp b/include/anna/comm/Resource.hpp index 7bd90fb..7379247 100644 --- a/include/anna/comm/Resource.hpp +++ b/include/anna/comm/Resource.hpp @@ -29,13 +29,13 @@ public: \param parent Nodo XML a partir del cual introducir la informacin. \return Un nodo XML con la informacin referente a este objeto. */ - virtual xml::Node* asXML(xml::Node* parent) const throw(RuntimeException); + virtual xml::Node* asXML(xml::Node* parent) const noexcept(false); /** Amplia la informacion XML del nodo recibido como parametro. \param node Nodo XML en el que incorporar los atributos. */ - virtual void asAttribute(xml::Node* node) const throw(RuntimeException); + virtual void asAttribute(xml::Node* node) const noexcept(false); protected: /** diff --git a/include/anna/comm/RoundRobinDelivery.hpp b/include/anna/comm/RoundRobinDelivery.hpp index c5a7776..f876b88 100644 --- a/include/anna/comm/RoundRobinDelivery.hpp +++ b/include/anna/comm/RoundRobinDelivery.hpp @@ -37,9 +37,9 @@ public: a_iiserver(0) {;} - std::string asString() const throw(); + std::string asString() const ; - xml::Node* asXML(xml::Node* parent) const throw(); + xml::Node* asXML(xml::Node* parent) const ; /** Metodo que devuelve el nombre completo de este selector de recursos. @@ -47,10 +47,10 @@ public: a los que pertenece la clase. \return Una cadena con el nombre de este selector. */ - static const char* className() throw() { return "anna::comm::RoundRobinDelivery"; } + static const char* className() { return "anna::comm::RoundRobinDelivery"; } protected: - void do_initialize() throw(RuntimeException); + void do_initialize() noexcept(false); private: //------------------------------------------------------------------------------------ @@ -58,8 +58,8 @@ private: //------------------------------------------------------------------------------------ iterator a_iiserver; - comm::Resource* do_apply() throw(RuntimeException); - iterator advance() throw(); + comm::Resource* do_apply() noexcept(false); + iterator advance() ; }; } diff --git a/include/anna/comm/Server.hpp b/include/anna/comm/Server.hpp index 7d370b5..5015e91 100644 --- a/include/anna/comm/Server.hpp +++ b/include/anna/comm/Server.hpp @@ -65,33 +65,33 @@ public: Devuelve la instancia del Host indicada en el constructor. \return la instancia del Host indicada en el constructor. */ - const Host* getHost() const throw() { return &a_host; } + const Host* getHost() const { return &a_host; } /** Devuelve la instancia de ClientSocket asociada a este servidor. Puede ser NULL. \return la instancia de ClientSocket asociada a este servidor. */ - const ClientSocket* getClientSocket() const throw() { return a_clientSocket; } + const ClientSocket* getClientSocket() const { return a_clientSocket; } /** Devuelve el puerto remoto donde establece las conexiones este proceso servidor. \return El puerto remoto donde establece las conexiones este proceso servidor. */ - int getRemotePort() const throw() { return a_remotePort; } + int getRemotePort() const { return a_remotePort; } /** Devuelve el estado del indicador de recuperacin automatica. En caso de perder la conexin, por defecto, siempre se intentara reconectar con el servidor. \return El estado del indicador de recuperacin automatica. */ - bool autoRecovery() const throw() { return a_autoRecovery; } + bool autoRecovery() const { return a_autoRecovery; } /** Configura el estado del indicador de recuperacin automatica. En caso de perder la conexin, por defecto, siempre se intentara reconectar con el servidor. \param autoRecovery Indicador de recuperacin automatica. */ - void setAutoRecovery(bool autoRecovery = true) throw(); + void setAutoRecovery(bool autoRecovery = true) ; /** Devuelve el estado activo o inactivo de este proceso servidor. Un proceso servidor estara @@ -101,13 +101,13 @@ public: @return \em true si el proceso servidor esta preparado para enviar peticiones o \em false en otro caso. */ - bool isAvailable() const throw(RuntimeException); + bool isAvailable() const noexcept(false); /** Devuelve la factoria de transporte indicada en el constructor. \return la factoria de transporte indicada en el constructor. */ - TransportFactory* getTransportFactory() throw() { return a_transportFactory; } + TransportFactory* getTransportFactory() { return a_transportFactory; } /** Devuelve el numero maximo de milisegundos esperados para obtener conexion al invocar @@ -115,7 +115,7 @@ public: \return el numero maximo de milisegundos esperados para obtener conexion al invocar al metodo #connect. */ - const Millisecond &getMaxConnectionDelay() const throw() { return a_msMaxConnectionDelay; } + const Millisecond &getMaxConnectionDelay() const { return a_msMaxConnectionDelay; } /** Devuelve el numero maximo de milisegundos que queda bloqueado el proceso/thread a la espera @@ -123,13 +123,13 @@ public: \return Devuelve el numero maximo de milisegundos que queda bloqueado el proceso/thread a la espera de escribir en un socket cuyo buffer de salida esta lleno. */ - const Millisecond &getMaxWriteDelay() const throw() { return a_msMaxWriteDelay; } + const Millisecond &getMaxWriteDelay() const { return a_msMaxWriteDelay; } /** Devuelve la factoria de receptores usada por este servidor. \return la factoria de receptores usada por este servidor. */ - ReceiverFactory* getReceiverFactory() throw() { return a_receiverFactory; } + ReceiverFactory* getReceiverFactory() { return a_receiverFactory; } /** Establece el numero maximo de milisegundos esperados para obtener la conexion al @@ -137,7 +137,7 @@ public: \param msMaxConnectionDelay Numero de milisegundos esperados para obtener conexion. */ void setMaxConnectionDelay(const Millisecond &msMaxConnectionDelay) - throw() { + { a_msMaxConnectionDelay = msMaxConnectionDelay; } @@ -147,26 +147,26 @@ public: \param msMaxWriteDelay Numero de milisegundos esperados en caso de que el buffer del socket se llene. */ - void setMaxWriteDelay(const Millisecond &msMaxWriteDelay) throw() { a_msMaxWriteDelay = msMaxWriteDelay; } + void setMaxWriteDelay(const Millisecond &msMaxWriteDelay) { a_msMaxWriteDelay = msMaxWriteDelay; } /** Establece la factoria de receptores usada por este socket. \param receiverFactory Factoria de receptores desde la que obtener el receptor asociado al comm::ClientSocket usado por este servidor. */ - void setReceiverFactory(ReceiverFactory& receiverFactory) throw(); + void setReceiverFactory(ReceiverFactory& receiverFactory) ; /** * Devuelve \em true si el indicador que ignora los mensajes entrantes está activo, o \em false en otro caso. * \return \em true si el indicador que ignora los mensajes entrantes está activo, o \em false en otro caso. */ - bool getIgnoreIncomingMessages() const throw() { return a_ignoreIncomingMessages; } + bool getIgnoreIncomingMessages() const { return a_ignoreIncomingMessages; } /** * Establece el indicador que provoca ignorar los mensajes entrantes. * \param ignoreIncomingMessages \em true si el indicador que ignora los mensajes entrantes está activo, o \em false en otro caso. */ - void setIgnoreIncomingMessages(const bool ignoreIncomingMessages) throw() { a_ignoreIncomingMessages = ignoreIncomingMessages; } + void setIgnoreIncomingMessages(const bool ignoreIncomingMessages) { a_ignoreIncomingMessages = ignoreIncomingMessages; } /** Asocia este servidor con un servicio de reparto. @@ -174,7 +174,7 @@ public: \warning se invoca automatica desde */ void attach(Service* service) - throw(RuntimeException) { + noexcept(false) { if(std::find(begin(), end(), service) == end()) a_services.push_back(service); } @@ -183,7 +183,7 @@ public: Crea una conexion al servidor mediante algunas de las conexiones que deberian estar disponibles en la maquina asociada a este servidor. */ - void connect() throw(RuntimeException); + void connect() noexcept(false); /** Envia el mensaje recibido como parametro. El bloque de datos recibido se codifica segun las @@ -193,7 +193,7 @@ public: \return La instancia del ClientSocket usada para enviar el mensaje. */ - ClientSocket* send(Message& message) throw(RuntimeException); + ClientSocket* send(Message& message) noexcept(false); /** Envia el mensaje recibido como parametro. El bloque de datos recibido se codifica segun las @@ -203,50 +203,50 @@ public: \return La instancia del ClientSocket usada para enviar el mensaje. */ - ClientSocket* send(Message* message) throw(RuntimeException); + ClientSocket* send(Message* message) noexcept(false); /** Libera el RemoteConnection asociado a esta instancia. Se invoca automaticamente cuando el extremo remoto cierra la conexion. */ - void reset() throw(RuntimeException); + void reset() noexcept(false); /** Devuelve un iterador al comienzo de la lista de RemoteConnections asociados a este proceso servidor. \return Un iterador al comienzo de la lista de RemoteConnections asociados a este proceso servidor. */ - const_iterator begin() const throw() { return a_services.begin(); } + const_iterator begin() const { return a_services.begin(); } /** Devuelve un iterador al final de la lista de RemoteConnections asociados a este proceso servidor. \return Un iterador al final de la lista de RemoteConnections asociados a este proceso servidor. */ - const_iterator end() const throw() { return a_services.end(); } + const_iterator end() const { return a_services.end(); } /** Devuelve un iterador al comienzo de la lista de RemoteConnections asociados a este proceso servidor. \return Un iterador al comienzo de la lista de RemoteConnections asociados a este proceso servidor. */ - iterator begin() throw() { return a_services.begin(); } + iterator begin() { return a_services.begin(); } /** Devuelve un iterador al final de la lista de RemoteConnections asociados a este proceso servidor. \return Un iterador al final de la lista de RemoteConnections asociados a este proceso servidor. */ - iterator end() throw() { return a_services.end(); } + iterator end() { return a_services.end(); } /** Devuelve una cadena con la informacion referente a este proceso servidor. @return Una cadena con la informacion referente a este proceso servidor. */ - std::string asString() const throw(); + std::string asString() const ; /** Devuelve un nodo XML con la informacion referente a este objeto. \param parent Nodo XML a partir del cual introducir la informacion. \return Un nodo XML con la informacion referente a este objeto. */ - xml::Node* asXML(xml::Node* parent) const throw(RuntimeException); + xml::Node* asXML(xml::Node* parent) const noexcept(false); /** Devuelve la instancia del RemoteConnection sobre el que esta posicionado el iterador recibido @@ -254,7 +254,7 @@ public: \param ii Iterador que debera estar comprendido entre begin y end. \return La instancia del RemoteConnection sobre el que esta posicionado el iterador recibido */ - static Service* service(iterator& ii) throw() { return *ii; } + static Service* service(iterator& ii) { return *ii; } /** Devuelve la instancia del RemoteConnection sobre el que esta posicionado el iterador recibido @@ -262,13 +262,13 @@ public: \param ii Iterador que debera estar comprendido entre begin y end. \return La instancia del RemoteConnection sobre el que esta posicionado el iterador recibido */ - static const Service* service(const_iterator& ii) throw() { return *ii; } + static const Service* service(const_iterator& ii) { return *ii; } /** Devuelve el nombre logico de esta clase. \return el nombre logico de esta clase. */ - static const char* className() throw() { return "anna::comm::Server"; } + static const char* className() { return "anna::comm::Server"; } protected: /** @@ -297,7 +297,7 @@ private: bool a_ignoreIncomingMessages; int a_sequence; - virtual ClientSocket* allocateClientSocket(const INetAddress&, TransportFactory*) const throw(); + virtual ClientSocket* allocateClientSocket(const INetAddress&, TransportFactory*) const ; friend class Host; friend class ServerAllocator; diff --git a/include/anna/comm/ServerAllocator.hpp b/include/anna/comm/ServerAllocator.hpp index c836e85..bfb46e6 100644 --- a/include/anna/comm/ServerAllocator.hpp +++ b/include/anna/comm/ServerAllocator.hpp @@ -70,13 +70,13 @@ public: Devuelve el nombre logico del servidor. \return el nombre logico del servidor. */ - const std::string& getName() const throw() { return a_name; } + const std::string& getName() const { return a_name; } /** Devuelve el puerto sobre el que atiende peticiones. \return el puerto sobre el que atiende peticiones. */ - int getRemotePort() const throw() { return a_remotePort; } + int getRemotePort() const { return a_remotePort; } /** Indica si se ha indicado que en caso de caida se debe intentar la recuperacion @@ -84,20 +84,20 @@ public: \return \em true si se ha indicado que en caso de caida se debe intentar la recuperacion automatica de la conexion o \em false en caso contrario. */ - bool autoRecovery() const throw() { return a_autoRecovery; } + bool autoRecovery() const { return a_autoRecovery; } /** * Devuelve \em true si el indicador que ignora los mensajes entrantes está activo, o \em false en otro caso. * \return \em true si el indicador que ignora los mensajes entrantes está activo, o \em false en otro caso. */ - bool getIgnoreIncomingMessages() const throw() { return a_ignoreIncomingMessages; } + bool getIgnoreIncomingMessages() const { return a_ignoreIncomingMessages; } /** Crea una instancia particular de anna::comm::Server usando los parametros establecidos en el constructor. \return una instancia particular de anna::comm::Server. */ - virtual Server* apply() const throw(); + virtual Server* apply() const ; protected: const std::string a_name; diff --git a/include/anna/comm/ServerSocket.hpp b/include/anna/comm/ServerSocket.hpp index 9e50dc8..8369f92 100644 --- a/include/anna/comm/ServerSocket.hpp +++ b/include/anna/comm/ServerSocket.hpp @@ -89,13 +89,13 @@ public: \return el numero de milisegundos esperado al hacer el bind compartido con este sockets antes de considerar que no se puede atender peticiones en esa direccion. */ - const Millisecond &getBindDelay() throw() { return a_msBindDelay; } + const Millisecond &getBindDelay() { return a_msBindDelay; } /** Devuelve el socket asociado a este socket de bind compartido. \return El socket asociado a este socket de bind compartido. Puede ser NULL. */ - BinderSocket* getBinderSocket() throw() { return a_binderSocket; } + BinderSocket* getBinderSocket() { return a_binderSocket; } /** Devuelve el modo de asociacion de este socket. @@ -103,13 +103,13 @@ public: \warning El valor devuelto por este metodo solo sera valido despues de ejecutar correctamente el metodo #bind */ - bool isSharedBind() const throw() { return a_sharedBind; } + bool isSharedBind() const { return a_sharedBind; } /** Establece el tamao de la cola de mensajes. \param backlog Tamao de la cola de mensajes. */ - void setBacklog(const int backlog) throw() { a_backlog = backlog; } + void setBacklog(const int backlog) { a_backlog = backlog; } /** Establece el numero de milisegundos esperado al hacer el bind con este sockets antes @@ -122,13 +122,13 @@ public: \warning Solo tendra efecto en el caso de que el socket tenga activado el modo de 'Bind compartido'. */ - void setBindDelay(const Millisecond &bindDelay) throw() { a_msBindDelay = bindDelay; } + void setBindDelay(const Millisecond &bindDelay) { a_msBindDelay = bindDelay; } /** Metodo que debemos invocar una vez que el ServerSocket esta establecido. \warning Normalmente se invocar�desde Communicator::attach(ServerSocket&,bool) */ - virtual void prepare() throw(RuntimeException); + virtual void prepare() noexcept(false); /** Comprueba la conexion establecida y acepta las peticiones. Esta funcin puede bloquear al thread @@ -142,7 +142,7 @@ public: \warning Exclusivamente uso interno. */ - LocalConnection* accept() throw(RuntimeException); + LocalConnection* accept() noexcept(false); /** Libera los recursos del socket recibido como parametro. @@ -152,32 +152,32 @@ public: \warning Exclusivamente uso interno. */ - void release(LocalConnection* localConnection) throw(RuntimeException); + void release(LocalConnection* localConnection) noexcept(false); /** Devuelve un iterador al primer LocalConnection definido. \return un iterador al primer LocalConnection definido. */ - iterator begin() throw() { return a_localConnections.begin(); } + iterator begin() { return a_localConnections.begin(); } /** Devuelve un iterador al ultimo LocalConnection definido. \return un iterador al ultimo LocalConnection definido. */ - iterator end() throw() { return a_localConnections.end(); } + iterator end() { return a_localConnections.end(); } /** Devuelve una cadena con la informacion referente a este socket. @return Una cadena con la informacion referente a este socket. */ - virtual std::string asString() const throw(); + virtual std::string asString() const ; /** Devuelve un nodo XML con la informacion referente a este objeto. \param parent Nodo XML a partir del cual introducir la informacion. \return Un nodo XML con la informacion referente a este objeto. */ - virtual xml::Node* asXML(xml::Node* parent) const throw(RuntimeException); + virtual xml::Node* asXML(xml::Node* parent) const noexcept(false); /** Metodo manejador de evento que permite ajustar el funcionamiento cuando el nucleo de @@ -191,27 +191,27 @@ public: \return \em true si la conexion es acceptada a \em false en otro caso, en cuyo caso se liberaran automaticamente todos los recursos asociados a la peticion de conexion. */ - virtual bool eventAcceptConnection(const ClientSocket &clientSocket) throw(RuntimeException) { return true; } + virtual bool eventAcceptConnection(const ClientSocket &clientSocket) noexcept(false) { return true; } // /** // Informa sobre la rotura de una conexion que se creo a partir de un ServerSocket // // @param localConnection Socket que se acepto sobre el server socket y que se ha roto. // */ -// virtual void eventBreakLocalConnection (LocalConnection* localConnection) throw (RuntimeException) {;} +// virtual void eventBreakLocalConnection (LocalConnection* localConnection) noexcept(false) {;} /** Devuelve una referencia al contenido apuntado por el iterador. \return una referencia al contenido apuntado por el iterador. */ - static LocalConnection* localConnection(iterator& ii) throw() { return Recycler::data(ii); } + static LocalConnection* localConnection(iterator& ii) { return Recycler::data(ii); } /** Devuelve el nombre logico de esta clase. \return el nombre logico de esta clase. */ - static const char* className() throw() { return "anna::comm::ServerSocket"; } + static const char* className() { return "anna::comm::ServerSocket"; } protected: /** @@ -238,8 +238,8 @@ private: BinderSocket* a_binderSocket; Millisecond a_msBindDelay; - virtual ClientSocket* allocateClientSocket() const throw(); - int do_bind(const struct sockaddr *, const int len) throw(RuntimeException); + virtual ClientSocket* allocateClientSocket() const ; + int do_bind(const struct sockaddr *, const int len) noexcept(false); friend class BinderSocket; }; diff --git a/include/anna/comm/Service.hpp b/include/anna/comm/Service.hpp index 0cd0fc9..11b07b0 100644 --- a/include/anna/comm/Service.hpp +++ b/include/anna/comm/Service.hpp @@ -42,13 +42,13 @@ public: @return La caracteristica de criticidad de este reparto. */ - bool isCritical() const throw() { return a_isCritical; } + bool isCritical() const { return a_isCritical; } /** Conecta el servidor recibido como parámetro con este reparto. \param server Instancia del servidor que vamos a registrar en este reparto. */ - void attach(Server* server) throw(RuntimeException); + void attach(Server* server) noexcept(false); /** Envía el mensaje recibido como parámetro. El bloque de datos recibido se codifica segun las @@ -57,7 +57,7 @@ public: \param message Mensaje que vamos codificar para enviar a la capa de transporte. @return Servidor usado en el envio */ - comm::Server* send(Message& message) throw(RuntimeException); + comm::Server* send(Message& message) noexcept(false); /** Envía el mensaje recibido como parámetro. El bloque de datos recibido se codifica segun las @@ -66,7 +66,7 @@ public: \param message Mensaje que vamos codificar para enviar a la capa de transporte. @return Servidor usado en el envio */ - comm::Server* send(Message* message) throw(RuntimeException); + comm::Server* send(Message* message) noexcept(false); /** Envía el mensaje recibido como parámetro a todos los servidores incluidos en el servicio de reparto de carga @@ -77,7 +77,7 @@ public: @return Numero de servidores a los que ha enviado el mensaje. */ - int broadcast(Message& message) throw(); + int broadcast(Message& message) ; /** Envía el mensaje recibido como parámetro a todos los servidores incluidos en el servicio de reparto de carga @@ -88,34 +88,34 @@ public: @return Numero de servidores a los que ha enviado el mensaje. */ - int broadcast(Message* message) throw(); + int broadcast(Message* message) ; /** Devuelve una cadena con la información referente a esta maquina. @return Una cadena con la información referente a esta maquina. */ - std::string asString() const throw(); + std::string asString() const ; /** Devuelve un nodo XML con la información referente a este objeto. \param parent Nodo XML a partir del cual introducir la información. \return Un nodo XML con la información referente a este objeto. */ - xml::Node* asXML(xml::Node* parent) const throw(); + xml::Node* asXML(xml::Node* parent) const ; /** Devuelve el recurso remoto apuntado por el iterador recibido como parámetro. \param ii Iterador usado para recorrer los recursos asociados a este reparto. \return El recurso remoto apuntado por el iterador recibido como parámetro. */ - static Server* server(iterator& ii) throw(); + static Server* server(iterator& ii) ; /** Devuelve el recurso remoto apuntado por el iterador recibido como parámetro. \param ii Iterador usado para recorrer los recursos asociados a este reparto. \return El recurso remoto apuntado por el iterador recibido como parámetro. */ - static const Server* server(const_iterator& ii) throw(); + static const Server* server(const_iterator& ii) ; private: const bool a_isCritical; diff --git a/include/anna/comm/Socket.hpp b/include/anna/comm/Socket.hpp index a81eb8a..b00ff2a 100644 --- a/include/anna/comm/Socket.hpp +++ b/include/anna/comm/Socket.hpp @@ -70,25 +70,25 @@ public: Devuelve el descriptor de fichero asociado a este socket. @return El descriptor de fichero asociado a este socke. Si el socket no ha sido creado devolver�-1. */ - int getfd() const throw() { return a_fd; } + int getfd() const { return a_fd; } /** Devuelve el tipo de socket. \return El tipo de socket. */ - Type::_v getType() const throw() { return a_type; } + Type::_v getType() const { return a_type; } /** Devuelve el dominio de este socket. \return El dominio de este socket. */ - Domain::_v getDomain() const throw() { return a_domain; } + Domain::_v getDomain() const { return a_domain; } /** Devuelve la categoria asociada a este socket. \return La categoria asociada a este socket. */ - int getCategory() const throw() { return a_category; } + int getCategory() const { return a_category; } /** Informa sobre si el socket es capaz de procesar un determinado protocolo de transporte. @@ -98,20 +98,20 @@ public: \return \em true si soporta el nombre de protocolo recibido como parametro o \em false en otro caso. */ - bool support(const char* transportClassName) const throw(); + bool support(const char* transportClassName) const ; /** Devuelve el estado de la conexion de este socket. @return \em true si el servidor de socket ha sido conectado o \em false en otro caso. */ - bool isBound() const throw() { return a_isBound; } + bool isBound() const { return a_isBound; } /** Devuelve el estado del socket. @return \em true si el socket este abierto o \em false en otro caso. */ - bool isOpened() const throw() { return a_fd != -1; } + bool isOpened() const { return a_fd != -1; } /** * Devuelve \em false si el socket usa un protocolo de comunicaciones seguro o \em false @@ -119,32 +119,32 @@ public: * \return \em false si el socket usa un protocolo de comunicaciones seguro o \em false * en otro caso. */ - virtual bool isSecure() const throw() { return false; } + virtual bool isSecure() const { return false; } /** Devuelve la direccion local del socket. \return La direccion local del socket. */ - const AccessPoint& getLocalAccessPoint() const throw() { return a_localAccessPoint; } + const AccessPoint& getLocalAccessPoint() const { return a_localAccessPoint; } /** Devuelve la factoria de la capa de transporte usada en este socket. \return la factoria de la capa de transporte usada en este socket. */ - TransportFactory* getTransportFactory() const throw() { return a_transportFactory; } + TransportFactory* getTransportFactory() const { return a_transportFactory; } /** Devuelve la factoria de receptores usada en este socket. \return la factoria de receptores usada en este socket. */ - ReceiverFactory* getReceiverFactory() throw() { return a_receiverFactory; } + ReceiverFactory* getReceiverFactory() { return a_receiverFactory; } /** Activa o desactiva el modo de bloqueo. \param blockingMode \em true si queremos activar el bloqueo o \em false en otro caso. @return El modo de bloqueo establecido antes de invocar este masodo. */ - bool setBlockingMode(const bool blockingMode) throw(RuntimeException); + bool setBlockingMode(const bool blockingMode) noexcept(false); /** Activa o desactiva el modo de reuso de la direccion. @@ -153,19 +153,19 @@ public: halla dejado de funcionar. \return El modo de reuso establecido antes de invocar a este metodo. */ - bool setReuseMode(const bool reuseMode) throw(RuntimeException); + bool setReuseMode(const bool reuseMode) noexcept(false); /** Establece la capa de transporte usada en este socket. \warning Exclusivamente uso interno. */ - void setTransportFactory(TransportFactory* transportFactory) throw() { a_transportFactory = transportFactory; } + void setTransportFactory(TransportFactory* transportFactory) { a_transportFactory = transportFactory; } /** Establece la factoria de receptores usada por este socket. \param receiverFactory Factoria de receptores desde la que obtener el receptor asociado a este Socket. */ - void setReceiverFactory(ReceiverFactory& receiverFactory) throw() { a_receiverFactory = &receiverFactory; } + void setReceiverFactory(ReceiverFactory& receiverFactory) { a_receiverFactory = &receiverFactory; } /** Establece la categoria de este socket. @@ -174,30 +174,30 @@ public: a partir de un anna::comm::ServerSocket comparten su misma categoria. \param category Categoria asociada a este socket. */ - void setCategory(const int category) throw() { a_category = category; } + void setCategory(const int category) { a_category = category; } /** Cierra este socket. Si el socket no ha sido creado no tendra ningn efecto. */ - void close() throw(); + void close() ; /** Intenta la asociar este socket con los parametros indicados en el constructor. */ - virtual void bind() throw(RuntimeException); + virtual void bind() noexcept(false); /** Devuelve una cadena con la informacion referente a este socket. @return Una cadena con la informacion referente a este socket. */ - virtual std::string asString() const throw(); + virtual std::string asString() const ; /** Devuelve un nodo XML con la informacion referente a este objeto. \param parent Nodo XML a partir del cual introducir la informacion. \return Un nodo XML con la informacion referente a este objeto. */ - virtual xml::Node* asXML(xml::Node* parent) const throw(RuntimeException); + virtual xml::Node* asXML(xml::Node* parent) const noexcept(false); protected: const Domain::_v a_domain; @@ -244,25 +244,25 @@ protected: /** Abre el socket. */ - void open() throw(RuntimeException); + void open() noexcept(false); /** Cierra este socket. Si el socket no ha sido creado no tendra ningn efecto. */ - virtual void do_close() throw() { ::close(a_fd); } + virtual void do_close() { ::close(a_fd); } /** Asocia este Socket a la direccion recibida como parametro. \warning Exclusivamente uso interno. */ - virtual int do_bind(const struct sockaddr*, const int) throw(RuntimeException); + virtual int do_bind(const struct sockaddr*, const int) noexcept(false); /** Devuelve la cadena correspondiente a la notificacion recibida como parametro. \param v Codigo de notificacion. \return La cadena correspondiente a la notificacion recibida como parametro. */ - static const char* asText(const Notify::_v v) throw(); + static const char* asText(const Notify::_v v) ; private: bool a_reuseMode; diff --git a/include/anna/comm/Status.hpp b/include/anna/comm/Status.hpp index 2f96c7c..3c615d3 100644 --- a/include/anna/comm/Status.hpp +++ b/include/anna/comm/Status.hpp @@ -29,17 +29,17 @@ public: Status() : a_value(Unavailable) {;} Status(const Status& other) : a_value(other.a_value) {;} Status(const _v v) : a_value(v) {;} - Status& operator = (const _v v) throw() { a_value = v; return *this; } - Status& operator = (const Status& other) throw() { a_value = other.a_value; return *this; } + Status& operator = (const _v v) { a_value = v; return *this; } + Status& operator = (const Status& other) { a_value = other.a_value; return *this; } - bool operator != (const Status& other) const throw() { return a_value != other.a_value; } - bool operator != (const Status::_v v) const throw() { return a_value != v ; } - bool operator == (const Status& other) const throw() { return a_value == other.a_value; } - bool operator == (const Status::_v v) const throw() { return a_value == v ; } + bool operator != (const Status& other) const { return a_value != other.a_value; } + bool operator != (const Status::_v v) const { return a_value != v ; } + bool operator == (const Status& other) const { return a_value == other.a_value; } + bool operator == (const Status::_v v) const { return a_value == v ; } - _v value() const throw() { return a_value; } + _v value() const { return a_value; } - std::string asString() const throw(); + std::string asString() const ; private: _v a_value; diff --git a/include/anna/comm/SureTransport.hpp b/include/anna/comm/SureTransport.hpp index 9d6b1ad..2b6de80 100644 --- a/include/anna/comm/SureTransport.hpp +++ b/include/anna/comm/SureTransport.hpp @@ -37,13 +37,13 @@ public: Class name literal \return Class name literal */ - static const char* className() throw() { return "anna::comm::SureTransport"; } + static const char* className() { return "anna::comm::SureTransport"; } /** Returns the transport layer manager associated to this class. \return transport layer manager associated to this class. */ - static TransportFactory& getFactory() throw() { return st_transportFactory; } + static TransportFactory& getFactory() { return st_transportFactory; } protected: static const short int headerSize = (sizeof(short int) + sizeof(int)); @@ -58,9 +58,9 @@ protected: private: DataBlock a_precodec; - int calculeSize(const DataBlock& dataBlock) throw(RuntimeException); - const Message* decode(const DataBlock& message) throw(RuntimeException); - virtual const DataBlock& code(Message&) throw(RuntimeException); + int calculeSize(const DataBlock& dataBlock) noexcept(false); + const Message* decode(const DataBlock& message) noexcept(false); + virtual const DataBlock& code(Message&) noexcept(false); friend class anna::Allocator ; }; diff --git a/include/anna/comm/Transport.hpp b/include/anna/comm/Transport.hpp index 6b6b24c..096bc05 100644 --- a/include/anna/comm/Transport.hpp +++ b/include/anna/comm/Transport.hpp @@ -48,7 +48,7 @@ class Transport { int a_overQuotaSize; Message* a_inputMessage; - static Message* nullInputMessage() throw(RuntimeException); + static Message* nullInputMessage() noexcept(false); public: /** @@ -65,7 +65,7 @@ public: /** Returns true if the transport layer has a timming control system activated. */ - bool enableTimeout() const throw() { return a_enableTimeout; } + bool enableTimeout() const { return a_enableTimeout; } /** Activates the timming control system for the ClientSocket which were created @@ -73,17 +73,17 @@ public: is detected in a time interval. \see Communicator::setTimeout. */ - void activateTimeout() throw() { a_enableTimeout = true; } + void activateTimeout() { a_enableTimeout = true; } /** Deactivates the timming control system for the ClientSocket which were created through this transport layer. */ - void deactivateTimeout() throw() { a_enableTimeout = false; } + void deactivateTimeout() { a_enableTimeout = false; } // Internal use: returns associated input message - Message* getInputMessage() throw(RuntimeException) { + Message* getInputMessage() noexcept(false) { return (a_inputMessage == NULL) ? nullInputMessage() : a_inputMessage; } @@ -91,7 +91,7 @@ public: Returns the number of bytes reserved by this protocol for the intermediate buffer. @return number of bytes reserved by this protocol for the intermediate buffer. */ - int getOverQuotaSize() const throw() { return a_overQuotaSize; } + int getOverQuotaSize() const { return a_overQuotaSize; } /** Establece el numero de bytes que puede mantener este procotolo para cada uno de los @@ -101,7 +101,7 @@ public: \param overQuotaSize Numero de maximo de bytes que podemos mantener en la memoria intermedia. */ - void setOverQuotaSize(const int overQuotaSize) throw() { a_overQuotaSize = (overQuotaSize >= MinOverQuotaSize) ? overQuotaSize : MinOverQuotaSize; } + void setOverQuotaSize(const int overQuotaSize) { a_overQuotaSize = (overQuotaSize >= MinOverQuotaSize) ? overQuotaSize : MinOverQuotaSize; } /** Debe calcular el tamao previsto del mensaje actual. @@ -119,7 +119,7 @@ public: longitud del mensaje recibido y lanza una excepcion en este metodo el ClientSocket activara los sistemas de recuperacion, si es posible. */ - virtual int calculeSize(const DataBlock& dataBlock) throw(RuntimeException) = 0; + virtual int calculeSize(const DataBlock& dataBlock) noexcept(false) = 0; /** Debe establecer el modo en que el protocolo va a verificar que el mensaje obtenido @@ -135,7 +135,7 @@ public: \return Un bloque de memoria que contiene el mensaje recibido codificado segn las reglas del protocolo este protocolo de transporte */ - virtual const Message* decode(const DataBlock& message) throw(RuntimeException) = 0; + virtual const Message* decode(const DataBlock& message) noexcept(false) = 0; /** Debe establecer la forma en el protocolo va a preparar el envio a la capa de transporte. @@ -148,13 +148,13 @@ public: \warning De no indicarse ninguna otra implementacin devolvera el mensaje tal y como sea recibido. */ - virtual const DataBlock& code(Message& message) throw(RuntimeException) = 0; + virtual const DataBlock& code(Message& message) noexcept(false) = 0; /** Metodo que inicializa el estado de esta capa de transporte. Sera invocado automaticamente por el nucleo anna.comm. */ - virtual void clear() throw() { a_forCode.clear(); } + virtual void clear() { a_forCode.clear(); } protected: DataBlock a_forCode; /**< Bloque de memoria usado para guardar el contenido de la codificacion */ @@ -176,7 +176,7 @@ protected: Establece la instancia del mensaje asociada a este transporte. \param inputMessage Instancia del mensaje a asociar. */ - void setInputMessage(Message* inputMessage) throw() { a_inputMessage = inputMessage; } + void setInputMessage(Message* inputMessage) { a_inputMessage = inputMessage; } private: diff --git a/include/anna/comm/TransportFactory.hpp b/include/anna/comm/TransportFactory.hpp index 146c184..ed1655b 100644 --- a/include/anna/comm/TransportFactory.hpp +++ b/include/anna/comm/TransportFactory.hpp @@ -33,7 +33,7 @@ public: Devuelve el nombre logico de esta factoria de capas de transporte. \return el nombre logico de esta factoria de capas de transporte. */ - const std::string& getName() const throw() { return a_name; } + const std::string& getName() const { return a_name; } /** Devuelve la longitud maxima que puede contener el buffer intermedio antes de cerrar el socket @@ -41,7 +41,7 @@ public: ningun valor maximo, por lo que el valor a usar sera el indicado por anna::comm::Transport::DefaultMaxSize. */ - int getOverQuotaSize() const throw() { return a_overQuotaSize; } + int getOverQuotaSize() const { return a_overQuotaSize; } /** Establece la longitud maxima que puede contener el buffer intermedio antes de cerrar el socket @@ -49,20 +49,20 @@ public: \param overQuotaSize longitud maxima que puede contener el buffer intermedio antes de cerrar el socket por considerar que no puede sincronizarlo. */ - void setOverQuotaSize(const int overQuotaSize) throw() { a_overQuotaSize = overQuotaSize; } + void setOverQuotaSize(const int overQuotaSize) { a_overQuotaSize = overQuotaSize; } /** Devuelve una cadena con la informacion relevante sobre esta instancia. \return una cadena con la informacion relevante sobre esta instancia. */ - std::string asString() const throw(); + std::string asString() const ; /** Devuelve un documento XML con la informacion relevante sobre esta instancia. \param parent Nodo XML del que debe depender el documento generado. \return un documento XML con la informacion relevante sobre esta instancia. */ - xml::Node* asXML(xml::Node* parent) const throw(); + xml::Node* asXML(xml::Node* parent) const ; protected: /** @@ -76,14 +76,14 @@ protected: \return La instancia de un nuevo protocolo de transporte. \warning Cada uno de los transportes obtenidos debera ser liberado invocando a #release. */ - virtual Transport* create() throw() = 0; + virtual Transport* create() = 0; /** Libera la instancia del transporte recibida como parametro. \param transport Instancia del protocolo de transporte a liberar. \warning El transporte recibido como parametro debera haberse obtenido mediante #create. */ - virtual void release(Transport* transport) throw() = 0; + virtual void release(Transport* transport) = 0; private: const std::string a_name; diff --git a/include/anna/comm/TransportFactoryImpl.hpp b/include/anna/comm/TransportFactoryImpl.hpp index 45e64d8..6d3edd4 100644 --- a/include/anna/comm/TransportFactoryImpl.hpp +++ b/include/anna/comm/TransportFactoryImpl.hpp @@ -32,7 +32,7 @@ public: private: Recycler a_transports; - Transport* create() throw() { + Transport* create() { Transport* result = static_cast (a_transports.create()); int overQuotaSize; @@ -41,7 +41,7 @@ private: return result; } - void release(Transport* transport) throw() { a_transports.release(static_cast (transport)); } + void release(Transport* transport) { a_transports.release(static_cast (transport)); } }; } diff --git a/include/anna/comm/Variable.hpp b/include/anna/comm/Variable.hpp index a6b7632..2191568 100644 --- a/include/anna/comm/Variable.hpp +++ b/include/anna/comm/Variable.hpp @@ -118,16 +118,16 @@ public: Devuelve el identificador logico de esta variable. \return el identificador logico de esta variable. */ - short int getId() const throw() { return a_id; } + short int getId() const { return a_id; } private: const short int a_id; DataBlock a_precode; - const DataBlock& codec() const throw(RuntimeException) { + const DataBlock& codec() const noexcept(false) { return (a_precode.isEmpty() == false) ? a_precode : precodec(); } - const DataBlock& precodec() const throw(RuntimeException) { + const DataBlock& precodec() const noexcept(false) { char aux [sizeof(short int)]; const_cast (this)->a_precode.append(comm::functions::codeShort(aux, a_id), sizeof(short int)); const_cast (this)->a_precode += (char) getType(); diff --git a/include/anna/comm/comm.hpp b/include/anna/comm/comm.hpp index 58aa863..4101d04 100644 --- a/include/anna/comm/comm.hpp +++ b/include/anna/comm/comm.hpp @@ -45,7 +45,7 @@ antes de dar la respuesta. public: MyCommunicator () {;} - void setDelay (const Millisecond &delay) throw () { a_delay = delay; } + void setDelay (const Millisecond &delay) { a_delay = delay; } private: Request a_request; @@ -53,7 +53,7 @@ antes de dar la respuesta. Millisecond a_delay; void eventReceiveMessage (comm::ClientSocket &, const DataBlock& data) - throw (RuntimeException); + noexcept(false); }; class ArithmeticServer : public comm::Application { @@ -64,8 +64,8 @@ antes de dar la respuesta. MyCommunicator a_communicator; comm::ServerSocket* a_serverSocket; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); }; using namespace std; @@ -110,7 +110,7 @@ antes de dar la respuesta. // Inicializa el servidor de sockets. //----------------------------------------------------------------------------------------- void ArithmeticServer::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -125,7 +125,7 @@ antes de dar la respuesta. // Cuando hay un nuevo mensaje invocar�a Communicator::eventReceiveMessage //----------------------------------------------------------------------------------------- void ArithmeticServer::run () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -145,7 +145,7 @@ antes de dar la respuesta. // transport: Instancia del transporto que ha interpretado el mensaje (getMessage). //----------------------------------------------------------------------------------------- void MyCommunicator::eventReceiveMessage (ClientSocket& clientSocket, const DataBlock& data) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tm ("MyCommunicator", "eventReceiveMessage", ANNA_FILE_LOCATION)); @@ -228,14 +228,14 @@ determinado de peticiones por segundo. public: Sender () : Clock ("Sender", 250), a_messageBySecond (0), a_nquarter (0) {;} - void setMessageBySecond (const int messageBySecond) throw () { a_messageBySecond = messageBySecond; } + void setMessageBySecond (const int messageBySecond) { a_messageBySecond = messageBySecond; } private: int a_messageBySecond; int a_nquarter; test::Request a_request; - void tick () throw (RuntimeException); + void tick () noexcept(false); }; //----------------------------------------------------------------------------------------- @@ -253,14 +253,14 @@ determinado de peticiones por segundo. test::Response a_response; void eventReceiveMessage (ClientSocket &, const DataBlock&) - throw (RuntimeException); + noexcept(false); }; class HeavyClient : public anna::comm::Application { public: HeavyClient (); - Server* getServer () const throw () { return a_server; } + Server* getServer () const { return a_server; } private: MyCommunicator a_communicator; @@ -268,8 +268,8 @@ determinado de peticiones por segundo. Sender a_sender; Server* a_server; - void initialize () throw (RuntimeException); - void run () throw (RuntimeException); + void initialize () noexcept(false); + void run () noexcept(false); }; using namespace std; @@ -319,7 +319,7 @@ determinado de peticiones por segundo. // Configura el men para que trabaje con el comunicador de esta aplicacin. //----------------------------------------------------------------------------------------- void HeavyClient::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -336,7 +336,7 @@ determinado de peticiones por segundo. // atender las peticiones. //----------------------------------------------------------------------------------------- void HeavyClient::run () - throw (RuntimeException) + noexcept(false) { a_timeController.activate (a_sender); @@ -350,7 +350,7 @@ determinado de peticiones por segundo. // transport: Instancia del transporto que ha interpretado el mensaje (getMessage). //----------------------------------------------------------------------------------------- void MyCommunicator::eventReceiveMessage (ClientSocket&, const DataBlock& data) - throw (RuntimeException) + noexcept(false) { a_response.decode (data); @@ -361,7 +361,7 @@ determinado de peticiones por segundo. } void Sender::tick () - throw (RuntimeException) + noexcept(false) { Server* server = static_cast (anna::app::functions::getApp ()).getServer (); Communicator* communicator = anna::app::functions::component (ANNA_FILE_LOCATION); diff --git a/include/anna/comm/functions.hpp b/include/anna/comm/functions.hpp index 9681112..620bd3a 100644 --- a/include/anna/comm/functions.hpp +++ b/include/anna/comm/functions.hpp @@ -29,7 +29,7 @@ struct functions : public anna::app::functions { Returns the host name over which we are executing our process. @return host name over which we are executing our process. */ - static std::string getHostName() throw(RuntimeException); + static std::string getHostName() noexcept(false); /** @@ -42,13 +42,13 @@ struct functions : public anna::app::functions { \see man gethostbyname. */ - static std::string resolveIP(const char* hostname) throw(RuntimeException); + static std::string resolveIP(const char* hostname) noexcept(false); /** Returns our application instance on anna.comm layer. @return Reference to our application instance on anna.comm layer. */ - static comm::Application& getApp() throw(RuntimeException); + static comm::Application& getApp() noexcept(false); }; } diff --git a/include/anna/comm/handler/Allocator.hpp b/include/anna/comm/handler/Allocator.hpp index eb8cf74..69250b8 100644 --- a/include/anna/comm/handler/Allocator.hpp +++ b/include/anna/comm/handler/Allocator.hpp @@ -22,10 +22,10 @@ public: static Communicator* st_communicator; static _Handler* create() - throw() { + { return new _Handler(st_communicator); } - static void destroy(_Handler* t) throw() { delete t; } + static void destroy(_Handler* t) { delete t; } }; } diff --git a/include/anna/comm/handler/BinderSocket.hpp b/include/anna/comm/handler/BinderSocket.hpp index a6d7f1e..73817b8 100644 --- a/include/anna/comm/handler/BinderSocket.hpp +++ b/include/anna/comm/handler/BinderSocket.hpp @@ -26,18 +26,18 @@ public: a_binderSocket(NULL) {;} - void setup(comm::BinderSocket* binderSocket) throw() { a_binderSocket = binderSocket; } + void setup(comm::BinderSocket* binderSocket) { a_binderSocket = binderSocket; } private: comm::BinderSocket* a_binderSocket; - void initialize() throw(RuntimeException); - void apply() throw(RuntimeException); - void breakAddress(const in_addr_t&) throw() {;} - void recoverAddress(const in_addr_t&) throw() {;} - void finalize() throw(); - std::string asString() const throw(); - xml::Node* asXML(xml::Node*) const throw(); + void initialize() noexcept(false); + void apply() noexcept(false); + void breakAddress(const in_addr_t&) {;} + void recoverAddress(const in_addr_t&) {;} + void finalize() ; + std::string asString() const ; + xml::Node* asXML(xml::Node*) const ; }; } diff --git a/include/anna/comm/handler/ClientSocket.hpp b/include/anna/comm/handler/ClientSocket.hpp index 167242b..019144d 100644 --- a/include/anna/comm/handler/ClientSocket.hpp +++ b/include/anna/comm/handler/ClientSocket.hpp @@ -26,18 +26,18 @@ public: a_clientSocket(NULL) {;} - void setup(comm::ClientSocket* clientSocket) throw() { a_clientSocket = clientSocket; } + void setup(comm::ClientSocket* clientSocket) { a_clientSocket = clientSocket; } - comm::ClientSocket* getClientSocket() throw() { return a_clientSocket; } + comm::ClientSocket* getClientSocket() { return a_clientSocket; } private: comm::ClientSocket* a_clientSocket; - void initialize() throw(RuntimeException); - void finalize() throw(); - void clone() throw(RuntimeException); - std::string asString() const throw(); - xml::Node* asXML(xml::Node*) const throw(); + void initialize() noexcept(false); + void finalize() ; + void clone() noexcept(false); + std::string asString() const ; + xml::Node* asXML(xml::Node*) const ; }; } diff --git a/include/anna/comm/handler/DatagramSocket.hpp b/include/anna/comm/handler/DatagramSocket.hpp index 19058b5..1e92b0a 100644 --- a/include/anna/comm/handler/DatagramSocket.hpp +++ b/include/anna/comm/handler/DatagramSocket.hpp @@ -28,19 +28,19 @@ public: a_datagramSocket(NULL) {;} - void setup(comm::DatagramSocket* datagramSocket) throw() { a_datagramSocket = datagramSocket; } + void setup(comm::DatagramSocket* datagramSocket) { a_datagramSocket = datagramSocket; } - comm::ClientSocket* getClientSocket() throw(); + comm::ClientSocket* getClientSocket() ; private: comm::DatagramSocket* a_datagramSocket; - void initialize() throw(RuntimeException); - void apply() throw(RuntimeException); - void finalize() throw(); + void initialize() noexcept(false); + void apply() noexcept(false); + void finalize() ; - std::string asString() const throw(); - xml::Node* asXML(xml::Node*) const throw(); + std::string asString() const ; + xml::Node* asXML(xml::Node*) const ; }; } diff --git a/include/anna/comm/handler/LocalConnection.hpp b/include/anna/comm/handler/LocalConnection.hpp index ef12388..37ae39e 100644 --- a/include/anna/comm/handler/LocalConnection.hpp +++ b/include/anna/comm/handler/LocalConnection.hpp @@ -26,18 +26,18 @@ public: a_localConnection(NULL) {;} - void setup(comm::LocalConnection* localConnection) throw() { a_localConnection = localConnection; } + void setup(comm::LocalConnection* localConnection) { a_localConnection = localConnection; } - comm::ClientSocket* getClientSocket() throw(); + comm::ClientSocket* getClientSocket() ; private: comm::LocalConnection* a_localConnection; - void initialize() throw(RuntimeException); - void finalize() throw(); + void initialize() noexcept(false); + void finalize() ; - std::string asString() const throw(); - xml::Node* asXML(xml::Node*) const throw(); + std::string asString() const ; + xml::Node* asXML(xml::Node*) const ; }; } diff --git a/include/anna/comm/handler/Manager.hpp b/include/anna/comm/handler/Manager.hpp index 01ab397..d9d9de0 100644 --- a/include/anna/comm/handler/Manager.hpp +++ b/include/anna/comm/handler/Manager.hpp @@ -38,16 +38,16 @@ public: typedef handler::Allocator DatagramSocketAllocator; typedef handler::Allocator ClientSocketAllocator; - void initialize(Communicator*) throw(); + void initialize(Communicator*) ; - comm::Handler* createHandler(comm::BinderSocket*) throw(RuntimeException); - comm::Handler* createHandler(comm::ServerSocket*) throw(RuntimeException); - comm::Handler* createHandler(comm::LocalConnection*) throw(RuntimeException); - comm::Handler* createHandler(comm::RemoteConnection*) throw(RuntimeException); - comm::Handler* createHandler(comm::DatagramSocket*) throw(RuntimeException); - comm::Handler* createHandler(comm::ClientSocket*) throw(RuntimeException); + comm::Handler* createHandler(comm::BinderSocket*) noexcept(false); + comm::Handler* createHandler(comm::ServerSocket*) noexcept(false); + comm::Handler* createHandler(comm::LocalConnection*) noexcept(false); + comm::Handler* createHandler(comm::RemoteConnection*) noexcept(false); + comm::Handler* createHandler(comm::DatagramSocket*) noexcept(false); + comm::Handler* createHandler(comm::ClientSocket*) noexcept(false); - void releaseHandler(Handler*) throw(); + void releaseHandler(Handler*) ; private: Recycler a_binderSockets; diff --git a/include/anna/comm/handler/MetaClientSocket.hpp b/include/anna/comm/handler/MetaClientSocket.hpp index 6a988e3..12d8728 100644 --- a/include/anna/comm/handler/MetaClientSocket.hpp +++ b/include/anna/comm/handler/MetaClientSocket.hpp @@ -26,10 +26,10 @@ public: {;} private: - virtual void apply() throw(RuntimeException); - bool testClose() throw(RuntimeException); + virtual void apply() noexcept(false); + bool testClose() noexcept(false); - void breakAddress(const in_addr_t& address) throw(); + void breakAddress(const in_addr_t& address) ; }; } diff --git a/include/anna/comm/handler/RemoteConnection.hpp b/include/anna/comm/handler/RemoteConnection.hpp index 80da4cc..29d7e9d 100644 --- a/include/anna/comm/handler/RemoteConnection.hpp +++ b/include/anna/comm/handler/RemoteConnection.hpp @@ -26,18 +26,18 @@ public: a_remoteConnection(NULL) {;} - void setup(comm::RemoteConnection* remoteConnection) throw() { a_remoteConnection = remoteConnection; } + void setup(comm::RemoteConnection* remoteConnection) { a_remoteConnection = remoteConnection; } - comm::ClientSocket* getClientSocket() throw(); + comm::ClientSocket* getClientSocket() ; private: comm::RemoteConnection* a_remoteConnection; - void initialize() throw(RuntimeException); - void finalize() throw(); - void clone() throw(RuntimeException); - std::string asString() const throw(); - xml::Node* asXML(xml::Node*) const throw(); + void initialize() noexcept(false); + void finalize() ; + void clone() noexcept(false); + std::string asString() const ; + xml::Node* asXML(xml::Node*) const ; }; } diff --git a/include/anna/comm/handler/ServerSocket.hpp b/include/anna/comm/handler/ServerSocket.hpp index 86181e1..2d3bf24 100644 --- a/include/anna/comm/handler/ServerSocket.hpp +++ b/include/anna/comm/handler/ServerSocket.hpp @@ -28,18 +28,18 @@ public: a_serverSocket(NULL) {;} - void setup(comm::ServerSocket* serverSocket) throw() { a_serverSocket = serverSocket; } + void setup(comm::ServerSocket* serverSocket) { a_serverSocket = serverSocket; } private: comm::ServerSocket* a_serverSocket; - void initialize() throw(RuntimeException) ; - void apply() throw(RuntimeException); - void breakAddress(const in_addr_t&) throw() ; - void finalize() throw(); + void initialize() noexcept(false) ; + void apply() noexcept(false); + void breakAddress(const in_addr_t&) ; + void finalize() ; - std::string asString() const throw(); - xml::Node* asXML(xml::Node*) const throw(); + std::string asString() const ; + xml::Node* asXML(xml::Node*) const ; }; } diff --git a/include/anna/comm/internal/BinderSocket.hpp b/include/anna/comm/internal/BinderSocket.hpp index 765f8c4..a8aa92d 100644 --- a/include/anna/comm/internal/BinderSocket.hpp +++ b/include/anna/comm/internal/BinderSocket.hpp @@ -26,16 +26,16 @@ class ServerSocket; //------------------------------------------------------------------------------- class BinderSocket : public ClientSocket { public: - static const char* className() throw() { return "anna::comm::BinderSocket"; } + static const char* className() { return "anna::comm::BinderSocket"; } private: ServerSocket& a_serverSocket; // socket Socket que esta intentando hacer el bind sobre una IP:puerto compartido. BinderSocket(ServerSocket*); - void requestBind(const struct sockaddr* s, const int len) throw(RuntimeException); - void responseBind() throw(RuntimeException); - void waitBind(const Millisecond &maxDelay) throw(RuntimeException); + void requestBind(const struct sockaddr* s, const int len) noexcept(false); + void responseBind() noexcept(false); + void waitBind(const Millisecond &maxDelay) noexcept(false); friend class ServerSocket; diff --git a/include/anna/comm/internal/ConnectionRecover.hpp b/include/anna/comm/internal/ConnectionRecover.hpp index 10b2770..249c83a 100644 --- a/include/anna/comm/internal/ConnectionRecover.hpp +++ b/include/anna/comm/internal/ConnectionRecover.hpp @@ -26,12 +26,12 @@ class Communicator; class ConnectionRecover { public: - bool isRunning() const throw() { return a_isRunning; } + bool isRunning() const { return a_isRunning; } - void annotateFault(Server* server) throw(); -// bool contains (Server* server) const throw (); -// void erase (Server* server) throw (); - xml::Node* asXML(xml::Node* parent) const throw(RuntimeException); + void annotateFault(Server* server) ; +// bool contains (Server* server) const ; +// void erase (Server* server) ; + xml::Node* asXML(xml::Node* parent) const noexcept(false); private: typedef std::vector break_container; @@ -44,7 +44,7 @@ private: Millisecond a_nextTime; ConnectionRecover(Communicator* communicator) : a_communicator(*communicator), a_isRunning(false) {;} - void tryRecover() throw(); + void tryRecover() ; friend class Communicator; }; diff --git a/include/anna/comm/internal/LocalConnection.hpp b/include/anna/comm/internal/LocalConnection.hpp index ac26685..37c16d3 100644 --- a/include/anna/comm/internal/LocalConnection.hpp +++ b/include/anna/comm/internal/LocalConnection.hpp @@ -40,39 +40,39 @@ public: socket cliente no est�asociado a ningn servidor de sockets. \return El servidor de socket a partir del cual se cre este socket cliente. */ - ServerSocket* getServerSocket() const throw() { return a_serverSocket; } + ServerSocket* getServerSocket() const { return a_serverSocket; } /** Devuelve el socket cliente asociado a esta conexion. Puede ser NULL si la conexion no ha sido establecida. \return El socket cliente asociado a esta conexion. */ - ClientSocket* getClientSocket() throw() { return a_clientSocket; } + ClientSocket* getClientSocket() { return a_clientSocket; } /** Devuelve una cadena con la informacin referente a este socket. \return Una cadena con la informacin referente a este socket. */ - std::string asString() const throw(); + std::string asString() const ; /** Devuelve un nodo XML con la informacin referente a este objeto. \param parent Nodo XML a partir del cual introducir la informacin. \return Un nodo XML con la informacin referente a este objeto. */ - xml::Node* asXML(xml::Node* parent) const throw(RuntimeException); + xml::Node* asXML(xml::Node* parent) const noexcept(false); /** Devuelve el nombre logico de esta clase. \return el nombre logico de esta clase. */ - static const char* className() throw() { return "anna::comm::LocalConnection"; } + static const char* className() { return "anna::comm::LocalConnection"; } private: ServerSocket* a_serverSocket; ClientSocket* a_clientSocket; - void setServerSocket(ServerSocket* serverSocket) throw() { a_serverSocket = serverSocket; } - void setClientSocket(ClientSocket* clientSocket) throw() { a_clientSocket = clientSocket; } + void setServerSocket(ServerSocket* serverSocket) { a_serverSocket = serverSocket; } + void setClientSocket(ClientSocket* clientSocket) { a_clientSocket = clientSocket; } friend class ServerSocket; friend class handler::ServerSocket; diff --git a/include/anna/comm/internal/Poll.hpp b/include/anna/comm/internal/Poll.hpp index 437c089..9670cbe 100644 --- a/include/anna/comm/internal/Poll.hpp +++ b/include/anna/comm/internal/Poll.hpp @@ -35,14 +35,14 @@ public: FD_ZERO(&a_fdset); } - void setTimeout(const Millisecond &timeout) throw(); + void setTimeout(const Millisecond &timeout) ; - void waitMessage() throw(RuntimeException); - int fetch() throw(); - bool isEmpty() const throw() { return a_pollr <= 0; } - void clear() throw() { a_maxfd = 0; a_minfd = INT_MAX; FD_ZERO(&a_fdmask); FD_ZERO(&a_fdset);} - void insert(const int fd) throw(); - void erase(const int fd) throw(); + void waitMessage() noexcept(false); + int fetch() ; + bool isEmpty() const { return a_pollr <= 0; } + void clear() { a_maxfd = 0; a_minfd = INT_MAX; FD_ZERO(&a_fdmask); FD_ZERO(&a_fdset);} + void insert(const int fd) ; + void erase(const int fd) ; private: fd_set a_fdmask; @@ -55,7 +55,7 @@ private: timeval a_timeout; static int select(const int maxfd, fd_set* fdset, timeval* timeout) - throw(RuntimeException) { + noexcept(false) { int result; do { @@ -70,7 +70,7 @@ private: return result; } - static int min(const Millisecond &n1, const Millisecond &n2) throw() { return (n1 < n2) ? n1 : n2; } + static int min(const Millisecond &n1, const Millisecond &n2) { return (n1 < n2) ? n1 : n2; } }; } diff --git a/include/anna/comm/internal/RemoteConnection.hpp b/include/anna/comm/internal/RemoteConnection.hpp index 318d716..4adc679 100644 --- a/include/anna/comm/internal/RemoteConnection.hpp +++ b/include/anna/comm/internal/RemoteConnection.hpp @@ -22,17 +22,17 @@ class ClientSocket; class RemoteConnection { public: - Server* getServer() throw() { return a_server; } + Server* getServer() { return a_server; } /** Conversor de invocacion. \return La instancia del socket asociado a esta instancia. Si no hay socket asociado lanzara una excepcion. */ - ClientSocket* getClientSocket() throw() { return a_clientSocket; } + ClientSocket* getClientSocket() { return a_clientSocket; } - std::string asString() const throw(); - xml::Node* asXML(xml::Node* parent) const throw(RuntimeException); - static const char* className() throw() { return "anna::comm::RemoteConnection"; } + std::string asString() const ; + xml::Node* asXML(xml::Node* parent) const noexcept(false); + static const char* className() { return "anna::comm::RemoteConnection"; } private: Server* a_server; diff --git a/include/anna/comm/internal/sccs.hpp b/include/anna/comm/internal/sccs.hpp index 8ddf7da..c6a5bf8 100644 --- a/include/anna/comm/internal/sccs.hpp +++ b/include/anna/comm/internal/sccs.hpp @@ -15,7 +15,7 @@ namespace comm { class sccs { public: - static void activate() throw(); + static void activate() ; }; } diff --git a/include/anna/config/Release.hpp b/include/anna/config/Release.hpp index 0c9cbb4..5c46544 100644 --- a/include/anna/config/Release.hpp +++ b/include/anna/config/Release.hpp @@ -21,13 +21,13 @@ public: * @brief getVersion * @return The version of this compilation */ - static std::string getVersion() throw(); + static std::string getVersion() ; /** * @brief getArchitecture * @return The literal which contains information about this release. */ - static std::string getArchitecture() throw(); + static std::string getArchitecture() ; }; } diff --git a/include/anna/core/Allocator.hpp b/include/anna/core/Allocator.hpp index 1924a7d..8e76303 100644 --- a/include/anna/core/Allocator.hpp +++ b/include/anna/core/Allocator.hpp @@ -22,13 +22,13 @@ public: Creacion de una instancia de tipo T. \return Una nueva instancia del tipo T. */ - static T* create() throw() { return new T; } + static T* create() { return new T; } /** Libera los recursos asociados a la instancia recibida como parametro. \param t Instancia que vamos a liberar. */ - static void destroy(T* t) throw() { delete t; } + static void destroy(T* t) { delete t; } }; } diff --git a/include/anna/core/AutoPointer.hpp b/include/anna/core/AutoPointer.hpp index 687ffde..1213e3b 100644 --- a/include/anna/core/AutoPointer.hpp +++ b/include/anna/core/AutoPointer.hpp @@ -42,19 +42,19 @@ public: * Devuelve la operación que se realizará cuando se termine con esta instancia y se invoque a anna::AutoPointer::release. * \return la operación que se realizará cuando se termine con esta instancia y se invoque a anna::AutoPointer::release. */ - WhenFinished::_v getWhenFinished() const throw() { return a_whenFinished; } + WhenFinished::_v getWhenFinished() const { return a_whenFinished; } /** * Establece la operación a realizar cuando se invoca al método anna::AutoPointer::release. * \param whenFinished Indica que operación a realizar cuando se invoque a anna::AutoPointer::release. */ - void setWhenFinished(const WhenFinished::_v whenFinished) throw() { a_whenFinished = whenFinished; } + void setWhenFinished(const WhenFinished::_v whenFinished) { a_whenFinished = whenFinished; } /** Devuelve una cadena con la informacion relevante de este objeto. \return Una cadena con la informacion relevante de este objeto. */ - virtual String asString() const throw(); + virtual String asString() const ; /** * Si fuera necesario libera de la instancia recibida. @@ -62,7 +62,7 @@ public: * \return Devolverá \em NULL si la instancia ha sido liberada o la misma instancia recibida en caso de que no haya sido liberada. */ template static T* release(T& instance) - throw() { + { return release(&instance); } @@ -72,7 +72,7 @@ public: * \return Devolverá \em NULL si la instancia ha sido liberada o la misma instancia recibida en caso de que no haya sido liberada. */ template static T* release(T* instance) - throw() { + { if(instance == NULL) return NULL; @@ -88,7 +88,7 @@ public: * Devuelve el nombre lógico de esta clase. * \return el nombre lógico de esta clase. */ - static const char* className() throw() { return "AutoPointer"; } + static const char* className() { return "AutoPointer"; } protected: /** diff --git a/include/anna/core/Cloneable.hpp b/include/anna/core/Cloneable.hpp index 8db08c3..bf36f6f 100644 --- a/include/anna/core/Cloneable.hpp +++ b/include/anna/core/Cloneable.hpp @@ -35,13 +35,13 @@ public: * Genera de esta instancia. Por cada clon generado habrá que invocar a #release. * \return Un clon de la instancia recibida */ - virtual Cloneable* clone() const throw() = 0; + virtual Cloneable* clone() const = 0; /** * Devuelve el nombre lógico de esta clase. * \return el nombre lógico de esta clase. */ - static const char* className() throw() { return "Cloneable"; } + static const char* className() { return "Cloneable"; } protected: /** @@ -65,12 +65,12 @@ protected: * * \code #define anna_clone_final(Class) \ - Class* clone () const throw () { return new Class (*this); } \ + Class* clone () const { return new Class (*this); } \ friend class AutoPointer; * \endcode */ #define anna_clone_final(Class) \ - Class* clone () const throw () { return new Class (*this); } \ + Class* clone () const { return new Class (*this); } \ friend class AutoPointer; /** @@ -79,12 +79,12 @@ protected: * * \code #define anna_clone_default(Class) \ - virtual Class* clone () const throw () { return new Class (*this); } \ + virtual Class* clone () const { return new Class (*this); } \ friend class AutoPointer; * \endcode */ #define anna_clone_default(Class) \ - virtual Class* clone () const throw () { return new Class (*this); } \ + virtual Class* clone () const { return new Class (*this); } \ friend class AutoPointer; /** @@ -93,12 +93,12 @@ protected: * la instancia creada al tipo adecuado de 'Cloneable', tendrá la forma: * \code #define anna_clone_abstract(Class) \ - virtual Class* clone () const throw () = 0; \ + virtual Class* clone () const = 0; \ friend class AutoPointer; * \endcode */ #define anna_clone_abstract(Class) \ - virtual Class* clone () const throw () = 0; \ + virtual Class* clone () const = 0; \ friend class AutoPointer; } diff --git a/include/anna/core/DataBlock.hpp b/include/anna/core/DataBlock.hpp index beac8c5..259eb38 100644 --- a/include/anna/core/DataBlock.hpp +++ b/include/anna/core/DataBlock.hpp @@ -30,7 +30,7 @@ public: cualquier otro bloque de memoria a este, se reserva (si fuese necesario) la memoria para ubicar el buffer y despues realizara una copia byte a byte. */ - explicit DataBlock(const bool deepCopy = false) throw() : + explicit DataBlock(const bool deepCopy = false) : a_buffer(NULL), a_size(0), a_deepCopy(deepCopy), @@ -45,7 +45,7 @@ public: cualquier otro bloque de memoria a este, se reserva la memoria para ubicar el buffer y despues realizara una copia byte a byte. */ - DataBlock(const char* buffer, const int size, const bool deepCopy = false) throw(RuntimeException); + DataBlock(const char* buffer, const int size, const bool deepCopy = false) noexcept(false); /** Constructor copia. @@ -53,7 +53,7 @@ public: @param other Bloque de memoria con el que instanciar esta instancia. */ - DataBlock(const DataBlock& other) throw(RuntimeException); + DataBlock(const DataBlock& other) noexcept(false); /** Destructor. @@ -67,7 +67,7 @@ public: @return Tamaño de la memoria reservada por esta instancia. */ - int getMaxSize() const throw() { return a_maxSize; } + int getMaxSize() const { return a_maxSize; } /** Éste metodo solo debe usarse en aplicaciones mono-thread o en situaciones en las que estemos seguros @@ -75,7 +75,7 @@ public: @return Tamaño del bloque de memoria contenido actualmente. */ - int getSize() const throw() { return a_size; } + int getSize() const { return a_size; } /** Éste metodo solo debe usarse en aplicaciones mono-thread o en situaciones en las que estemos seguros @@ -83,28 +83,28 @@ public: @return El contenido del bloque de memoria. */ - const char* getData() const throw() { return a_buffer; } + const char* getData() const { return a_buffer; } /** Devuelve informacion acerca del estado de ocupacion de este bloque de memoria. @return \em true si el bloque de memoria esta vacio o \em false en otro caso. */ - bool isEmpty() const throw() { return (a_size == 0) ? true : false; } + bool isEmpty() const { return (a_size == 0) ? true : false; } /** Devuelve informacion acerca de la configuracion de reserva de memoria de este bloque. @return @em true si el bloque de memoria tiene activado el sistema de copia profunda o @em false en otro caso. */ - bool deepCopy() const throw() { return a_deepCopy; } + bool deepCopy() const { return a_deepCopy; } /** Establece el numero de bytes que tiene asociado a este bloque de datos. \param size numero de bytes que tiene asociado a este bloque de datos. \warning El DataBlock delega la gestion de la memoria a la clase heredada. */ - void setSize(const int size) throw(RuntimeException); + void setSize(const int size) noexcept(false); /** Anade el caracter recibido al bloque de memoria. Para poder usar este operador el bloque de @@ -115,7 +115,7 @@ public: @returns Una referencia a si mismo. */ - DataBlock& operator += (const char c) throw(RuntimeException) { + DataBlock& operator += (const char c) noexcept(false) { append(&c, sizeof(c)); return *this; } @@ -129,7 +129,7 @@ public: @returns Una referencia a si mismo. */ - DataBlock& operator += (const DataBlock& right) throw(RuntimeException) { + DataBlock& operator += (const DataBlock& right) noexcept(false) { if(this != &right) append(right.a_buffer, right.a_size); @@ -145,7 +145,7 @@ public: @returns Una referencia a si mismo. */ - DataBlock& operator += (const std::string& str) throw(RuntimeException) { + DataBlock& operator += (const std::string& str) noexcept(false) { append(str.c_str(), str.length()); return *this; } @@ -155,14 +155,14 @@ public: \param pos Posicion a la que acceder. \return La posicion i-esima del bloque de datos. */ - const char operator [](const int pos) const throw(RuntimeException); + const char operator [](const int pos) const noexcept(false); /** Devuelve la posicion i-esima del bloque de datos. \param pos Posicion a la que acceder. \return La posicion i-esima del bloque de datos. */ - char& operator [](const int pos) throw(RuntimeException); + char& operator [](const int pos) noexcept(false); /** Anade el bloque de memoria recibido. Para poder usar este operador el bloque de memoria @@ -172,7 +172,7 @@ public: \param data Direccion donde comienza el bloque de datos. \param len Longitud del bloque de datos. */ - void append(const char* data, const int len) throw(RuntimeException); + void append(const char* data, const int len) noexcept(false); /** Anade el bloque de memoria recibido. Para poder usar este operador el bloque de memoria @@ -181,14 +181,14 @@ public: \param other Bloque de memoria a añadir. */ - void append(const DataBlock& other) throw(RuntimeException) { append(other.a_buffer, other.a_size); } + void append(const DataBlock& other) noexcept(false) { append(other.a_buffer, other.a_size); } /** Copia el contenido del bloque recibido como parámetro. @param right Bloque de memoria del que copiar. @returns Una referencia a si mismo. */ - void assign(const DataBlock& right) throw(RuntimeException) { *this = right; } + void assign(const DataBlock& right) noexcept(false) { *this = right; } /** Copia o direcciona el contenido del bloque recibido como parámetro. @@ -196,7 +196,7 @@ public: \param size Tamaño de la memoria. @returns Una referencia a si mismo. */ - void assign(const char* buffer, const int size) throw(RuntimeException); + void assign(const char* buffer, const int size) noexcept(false); /** operador copia. El modo de copiar vendra definido por el modo copia con el que hayamos @@ -204,7 +204,7 @@ public: @param right Bloque de memoria del que copiar. @returns Una referencia a si mismo. */ - DataBlock& operator = (const DataBlock& right) throw(RuntimeException); + DataBlock& operator = (const DataBlock& right) noexcept(false); /** Operador de inicializacion. El bloque destino debera tener activado el sistema de @@ -212,7 +212,7 @@ public: @param c Caracter con el que vamos a inicializar el contenido del bloque. @returns Una referencia a si mismo. */ - DataBlock& operator = (const char c) throw(RuntimeException) { clear(); (*this) += c; return *this; } + DataBlock& operator = (const char c) noexcept(false) { clear(); (*this) += c; return *this; } /** Operador de inicializacion. El bloque destino debera tener activado el sistema de @@ -220,7 +220,7 @@ public: @param str Cadena con el que vamos a inicializar el contenido del bloque. @returns Una referencia a si mismo. */ - DataBlock& operator = (const std::string& str) throw(RuntimeException) { clear(); (*this) += str; return *this; } + DataBlock& operator = (const std::string& str) noexcept(false) { clear(); (*this) += str; return *this; } // Metodos /** @@ -229,7 +229,7 @@ public: @param nbytes Numero de bytes a reservar. */ - void allocate(const int nbytes) throw(RuntimeException); + void allocate(const int nbytes) noexcept(false); /** La reserva de memoria actual pasa a ser memoria pre-asignada, asi libera el bloque @@ -237,7 +237,7 @@ public: ser necesario puede reutilizarlo sin tener que volver a realizar una llamada al sistema para obtener memoria dinamica. */ - void clear() throw(RuntimeException) { a_size = 0; } + void clear() noexcept(false) { a_size = 0; } /** Elimina del bloque de memoria unos determinados bytes. @@ -245,18 +245,18 @@ public: @param pos Posicion del bloque donde empezar a eliminar. @param nbytes Numero de bytes a descartar a partir de la posicion indicada. */ - void remove(const int pos, const int nbytes) throw(RuntimeException); + void remove(const int pos, const int nbytes) noexcept(false); /** Elimina del bloque de memoria los n primeros bytes. @param nbytes Numero de bytes a descartar a partir de la posicion indicada. */ - void remove(const int nbytes) throw(RuntimeException); + void remove(const int nbytes) noexcept(false); /** * Muestra el contenido de este buffer en forma de buffer hexadecimal vs bytes. */ - std::string asString(const int characterByLine = 24) const throw(); + std::string asString(const int characterByLine = 24) const ; protected: /** @@ -267,21 +267,21 @@ protected: @param buffer Bloque de memoria con el que inicializar el buffer de esta instancia. @param size Numero de bytes del bloque de memoria recibido. */ - void initialize(const char* buffer, const int size) throw(RuntimeException); + void initialize(const char* buffer, const int size) noexcept(false); /** Establece el espacio de memoria asociado a este bloque de datos. \param buffer Nuevo buffer de datos asociado a este bloque. \warning El DataBlock delega la gestion de la memoria a la clase heredada. */ - void setBuffer(const char* buffer) throw() { a_buffer = (char*) buffer; } + void setBuffer(const char* buffer) { a_buffer = (char*) buffer; } /** Establece el numero de bytes que tiene reservados este bloque de datos. \param maxSize numero de bytes que tiene reservados este bloque de datos. \warning El DataBlock delega la gestion de la memoria a la clase heredada. */ - void setMaxSize(const int maxSize) throw() { a_maxSize = maxSize; } + void setMaxSize(const int maxSize) { a_maxSize = maxSize; } private: char* a_buffer; @@ -289,7 +289,7 @@ private: bool a_deepCopy; int a_maxSize; - void extend(const int nbytes) throw(RuntimeException); + void extend(const int nbytes) noexcept(false); }; } //namespace anna diff --git a/include/anna/core/Exception.hpp b/include/anna/core/Exception.hpp index 1e205da..eba4ba2 100644 --- a/include/anna/core/Exception.hpp +++ b/include/anna/core/Exception.hpp @@ -43,13 +43,13 @@ public: /** Destructor. */ - virtual ~Exception() throw() {;} + virtual ~Exception() {;} // Accesores /** @return Devuelve el texto explicativo asociado a esta excepcion. */ - const std::string& getText() const throw() { return m_text;} + const std::string& getText() const { return m_text;} /** @return El nombre del fichero donde se genero la excepcion. Coincidira con el indicado @@ -61,7 +61,7 @@ public: @return La linea del fichero donde se genero la excepcion. Coincidira con la indicada en el constructor. */ - int getFromLine() const throw() { return m_fromLine; } + int getFromLine() const { return m_fromLine; } /** Establecer un codigo de error asociado a esta excepcion. @@ -69,12 +69,12 @@ public: @param errorCode Valor a establecer. El significado de este error dependera de la interpretacion particular que queramos darle en nuestra aplicacion. */ - void setErrorCode(const int errorCode) throw() { m_errorCode = errorCode; } + void setErrorCode(const int errorCode) { m_errorCode = errorCode; } /** @return El codigo de error asociado a esta excepcion. */ - int getErrorCode() const throw() { return m_errorCode; } + int getErrorCode() const { return m_errorCode; } // Operadores /** @@ -84,7 +84,7 @@ public: @return Referencia a esta instancia. */ - Exception& operator = (const Exception& right) throw(); + Exception& operator = (const Exception& right) ; // Metodos /** @@ -93,7 +93,7 @@ public: @return Instancia de la cadena conteniendo la informacion de la excepcion. */ - std::string asString() const throw(); + std::string asString() const ; /** Devuelve una cadena conteniendo toda la informacion referente a la excepcion @@ -103,7 +103,7 @@ public: @return Puntero a la cadena conteniendo la informacion de la excepcion. */ - const char* what() const throw() { return asString().c_str(); } // JASC, 23/9/2003 antes dAata() ( no tenia el trailing null ) + const char* what() const noexcept { return asString().c_str(); } // JASC, 23/9/2003 antes dAata() ( no tenia el trailing null ) /** Saca una traza de error en el fichero de log con el texto asociado a este excepcion. @@ -111,7 +111,7 @@ public: @see asString @see Logger#write */ - void trace() const throw(); + void trace() const ; protected: Exception(const char* text, const char* name, const char* fromFile, const int fromLine); @@ -121,14 +121,14 @@ protected: @param text Nuevo texto asociado a esta excepcion. */ - void setText(const char* text) throw() { m_text = text; } + void setText(const char* text) { m_text = text; } /** Establece el texto asociado a esta excepcion. @param text Nuevo texto asociado a esta excepcion. */ - void setText(const std::string& text) throw() { m_text = text; } + void setText(const std::string& text) { m_text = text; } private: std::string m_text; diff --git a/include/anna/core/RuntimeException.hpp b/include/anna/core/RuntimeException.hpp index 46858b5..d4e2cb4 100644 --- a/include/anna/core/RuntimeException.hpp +++ b/include/anna/core/RuntimeException.hpp @@ -75,7 +75,7 @@ public: /** @return El numero de error con el que se inicio la excepcion. */ - int getErrorNumber() const throw() { return a_errno; } + int getErrorNumber() const { return a_errno; } private: const int a_errno; diff --git a/include/anna/core/Singleton.hpp b/include/anna/core/Singleton.hpp index 2c869fb..4423587 100644 --- a/include/anna/core/Singleton.hpp +++ b/include/anna/core/Singleton.hpp @@ -64,7 +64,7 @@ namespace anna { ... ... - void anyClass::anyFunction () throw (RuntimeException) + void anyClass::anyFunction () noexcept(false) { A& a (A::instantiate ()); diff --git a/include/anna/core/define.autoenum.hpp b/include/anna/core/define.autoenum.hpp index 9378110..a05c120 100644 --- a/include/anna/core/define.autoenum.hpp +++ b/include/anna/core/define.autoenum.hpp @@ -47,19 +47,19 @@ */ #define anna_declare_enum(name) \ static const char* literal []; \ - static int calculateSize () throw () { \ + static int calculateSize () { \ int ii = 0; \ while (literal [ii] != NULL) ii ++; \ return ii; \ } \ - static _v asEnum (const char* str) throw () { \ + static _v asEnum (const char* str) { \ for (int ii = 0; literal [ii] != NULL; ii ++) { \ if (strcasecmp (str, literal [ii]) == 0) \ return (_v) ii; \ } \ return None; \ } \ - static _v asEnumEx (const char* str) throw (anna::RuntimeException) { \ + static _v asEnumEx (const char* str) noexcept(false) { \ if (str == NULL) { \ std::string msg (#name); \ msg += "::asEnumEx | str can not be null"; \ @@ -76,11 +76,11 @@ } \ return result; \ } \ - static _v asEnum (const std::string& str) throw () { return asEnum (str.c_str ()); } \ - static _v asEnumEx (const std::string& str) throw (anna::RuntimeException) { return asEnumEx (str.c_str ()); } \ - static const char* asCString (const _v v) throw () { return (v != None) ? literal [v]: NULL; } \ - static const char* asNotNullCString (const _v v) throw () { return (v != None) ? literal [v]: ""; } \ - static std::string asList () throw () {\ + static _v asEnum (const std::string& str) { return asEnum (str.c_str ()); } \ + static _v asEnumEx (const std::string& str) noexcept(false) { return asEnumEx (str.c_str ()); } \ + static const char* asCString (const _v v) { return (v != None) ? literal [v]: NULL; } \ + static const char* asNotNullCString (const _v v) { return (v != None) ? literal [v]: ""; } \ + static std::string asList () {\ std::string result;\ for (int ii = 0; literal [ii] != NULL; ii ++) { \ if (ii == 0 && strcmp (literal [ii], "None") == 0) continue; \ diff --git a/include/anna/core/functions.hpp b/include/anna/core/functions.hpp index 78fe13b..0d67ade 100644 --- a/include/anna/core/functions.hpp +++ b/include/anna/core/functions.hpp @@ -74,12 +74,12 @@ struct functions { /** @return La versin de functions con la que hemos linkado nuestra aplicacion. */ - static std::string getVersion() throw(); + static std::string getVersion() ; /** @return Un literal con la arquitectura sobre la que hemos compilado nuestra aplicacion. */ - static std::string getArchitecture() throw(); + static std::string getArchitecture() ; /** Indica el número de bits de un entero. @@ -95,31 +95,31 @@ struct functions { \param number Numero a convertir. @return Un literal con el numero convertido a cadena decimal. */ - static std::string asString(const int number) throw(); + static std::string asString(const int number) ; /** \param number Numero a convertir. @return Un literal con el numero sin signo convertido a cadena decimal. */ - static std::string asString(const unsigned int number) throw(); + static std::string asString(const unsigned int number) ; /** Devuelve un literal con tel numero convertido a cadena decimal @return Un literal con el numero signo convertido a cadena decimal. */ - static std::string asString(const S64 number) throw(); + static std::string asString(const S64 number) ; /** Devuelve un literal con tel numero convertido a cadena decimal @return Un literal con el numero signo convertido a cadena decimal. */ - static std::string asString(const U64 number) throw(); + static std::string asString(const U64 number) ; /** \param _bool Booleano a convertir. \return Un literal con el boolean convertido a cadena. */ - static const char* asString(const bool _bool) throw() { return (_bool == true) ? "true" : "false"; } + static const char* asString(const bool _bool) { return (_bool == true) ? "true" : "false"; } /** Devuelve una cadena con el bloque de datos decodificado en grupos de 16 bytes. @@ -127,7 +127,7 @@ struct functions { \param characterByLine Número de caracteres en cada línea. @return Devuelve una cadena con el bloque de datos decodificado en grupos de 16 bytes. */ - static std::string asString(const DataBlock& dataBlock, const int characterByLine = 16) throw(); + static std::string asString(const DataBlock& dataBlock, const int characterByLine = 16) ; /** Devuelve una cadena con el numero en coma flotante. @@ -135,7 +135,7 @@ struct functions { \param format Formato aplicado para convertir el numero a cadena. Ver \em man printf. \return una cadena con el numero en coma flotante. */ - static std::string asString(const double v, const char* format = "%e") throw(); + static std::string asString(const double v, const char* format = "%e") ; /** Devuelve una cadena con el numero en coma flotante. @@ -143,7 +143,7 @@ struct functions { \param format Formato aplicado para convertir el numero a cadena. Ver \em man printf. \return una cadena con el numero en coma flotante. */ - static std::string asString(const float v, const char* format = "%f") throw(); + static std::string asString(const float v, const char* format = "%f") ; /** \param comment Comentario que precede al valor. @@ -151,7 +151,7 @@ struct functions { @return Un literal con el numero convertido a cadena decimal. */ static std::string asText(const char* comment, const int number) - throw() { + { std::string result(comment); return result += asString(number); } @@ -162,7 +162,7 @@ struct functions { @return Un literal con el numero convertido a cadena decimal. */ static std::string asText(const char* comment, const S64 number) - throw() { + { std::string result(comment); return result += asString(number); } @@ -173,7 +173,7 @@ struct functions { @return Un literal con el numero convertido a cadena decimal. */ static std::string asText(const char* comment, const bool _bool) - throw() { + { std::string result(comment); return result += asString(_bool); } @@ -185,7 +185,7 @@ struct functions { @return Un literal con el numero convertido a cadena decimal. */ static std::string asText(const char* comment, const DataBlock& dataBlock, const int characterByLine = 16) - throw() { + { std::string result(comment); return result += asString(dataBlock, characterByLine); } @@ -197,7 +197,7 @@ struct functions { \return Un literal con el numero convertido a cadena. */ static std::string asText(const char* comment, const float value, const char* format = "%f") - throw() { + { std::string result(comment); return result += asString(value, format); } @@ -209,7 +209,7 @@ struct functions { \return Un literal con el numero convertido a cadena. */ static std::string asText(const char* comment, const double value, const char* format = "%e") - throw() { + { std::string result(comment); return result += asString(value, format); } @@ -218,19 +218,19 @@ struct functions { \param number Numero a convertir. @return Un literal con el numero convertido a cadena hexadecimal. */ - static std::string asHexString(const int number) throw(); + static std::string asHexString(const int number) ; /** \param number Numero a convertir. @return Un literal con el numero convertido a cadena hexadecimal. */ - static std::string asHexString(const S64 number) throw(); + static std::string asHexString(const S64 number) ; /** \param number Numero a convertir. @return Un literal con el numero convertido a cadena hexadecimal. */ - static std::string asHexString(const U64 number) throw() { return asHexString((S64) number); } + static std::string asHexString(const U64 number) { return asHexString((S64) number); } /** \param comment Comentario que precede al valor. @@ -238,7 +238,7 @@ struct functions { @return Un literal con el numero convertido a cadena decimal. */ static std::string asHexText(const char* comment, const int number) - throw() { + { std::string result(comment); return result += asHexString(number); } @@ -249,7 +249,7 @@ struct functions { @return Un literal con el numero convertido a cadena decimal. */ static std::string asHexText(const char* comment, const S64 number) - throw() { + { std::string result(comment); return result += asHexString(number); } @@ -261,7 +261,7 @@ struct functions { * \param dataBlock Bloque a codificar. * \return La cadena que contiene el valor literal del buffer de datos. */ - static std::string asHexString(const DataBlock& dataBlock) throw(); + static std::string asHexString(const DataBlock& dataBlock) ; /** * Obtiene el valor original de una cadena obtenido con #asHexString (const DataBlock&). @@ -269,7 +269,7 @@ struct functions { * \param target Bloque de datos sobre el que decodificar la cadena. * \return El bloque de datos original correspondiente a la cadena recibida. */ - static DataBlock& fromHexString(const std::string& hexString, DataBlock& target) throw(RuntimeException); + static DataBlock& fromHexString(const std::string& hexString, DataBlock& target) noexcept(false); /** Devuelve una cadena con la hora en formato 'dd/mm/yyyy hh:mm:ss'. @@ -278,7 +278,7 @@ struct functions { @return Un literal con la hora en el formato 'dd/mm/yyyy hh:mm:ss'. */ - static std::string asDateTime(const Second &second) throw(); + static std::string asDateTime(const Second &second) ; /** Devuelve una cadena con la hora en formato 'dd/mm/yyyy hh:mm:ss'. @@ -290,19 +290,19 @@ struct functions { @return El puntero recibido como parametro conteniendo el literal con la hora en el formato 'dd/mm/yyyy hh:mm:ss'. */ - static const char* asDateTime(const Second &second, char* result) throw(); + static const char* asDateTime(const Second &second, char* result) ; /** Calcula la funcion hash de la cadena recibida como parametro. \param str Cadena a la que aplicar la funcion hash. */ - static S64 hash(const char* str) throw(); + static S64 hash(const char* str) ; /** Calcula la funcion hash de la cadena recibida como parametro. \param str Cadena a la que aplicar la funcion hash. */ - static S64 hash(const std::string& str) throw() { return hash(str.c_str()); } + static S64 hash(const std::string& str) { return hash(str.c_str()); } /** Devuelve la cadena que contiene el resultado de aplicar la especificacion \em format @@ -314,7 +314,7 @@ struct functions { \return la cadena que contiene el resultado de aplicar la especificacion \em format sobre el resto de los parametros. */ - static std::string asString(const char* format, ...) throw(); + static std::string asString(const char* format, ...) ; /** Devuelve el resultado de invocar a metodo asString de la clase recibida como parametro. @@ -323,11 +323,11 @@ struct functions { \return el resultado de invoca a T::asString () si t es distinto de NULL. \warning La clase T debe tener un metodo estatico con la signatura: \code - static const char* className () throw (); + static const char* className () ; \endcode */ template static std::string asString(const T* t) - throw() { + { if(t == NULL) { std::string result(T::className()); result += " { }"; @@ -343,20 +343,20 @@ struct functions { \param str Instancia de la cadena. \return La misma instancia recibida como parametro. */ - static const std::string& asString(const std::string& str) throw() { return str; } + static const std::string& asString(const std::string& str) { return str; } /** Detiene la ejecucion del thread durante el numero de milisegundos indicados. \param millisecond Numero de milisegundos que vamos a detener la ejecucion de este thread. */ - static void sleep(const Millisecond &millisecond) throw(); + static void sleep(const Millisecond &millisecond) ; /** Obtiene el numero de segundos transcurridos desde el 1 del 1 de 1970. \return El numero de segundos transcurridos desde el 1 del 1 de 1970. */ - static Second second() throw() { + static Second second() { Second result(::time(NULL)); return result; } @@ -365,7 +365,7 @@ struct functions { Obtiene el numero de microsegundos transcurridos desde el 1 del 1 de 1970. \return El numero de microsegundos transcurridos desde el 1 del 1 de 1970. */ - static Microsecond microsecond() throw() { + static Microsecond microsecond() { struct timeval tv; gettimeofday(&tv, NULL); Microsecond result((Microsecond::type_t)1000000 * tv.tv_sec + tv.tv_usec); @@ -376,7 +376,7 @@ struct functions { Obtiene el numero de milisegundos transcurridos desde el 1 del 1 de 1970. \return El numero de milisegundos transcurridos desde el 1 del 1 de 1970. */ - static Millisecond millisecond() throw() { + static Millisecond millisecond() { struct timeval tv; gettimeofday(&tv, NULL); Millisecond result((Millisecond::type_t)1000 * tv.tv_sec + tv.tv_usec / 1000); @@ -387,7 +387,7 @@ struct functions { Devuelve la referencia interna de los microsegundos transcurrido en el procesador. \return la referencia interna de los microsegundos transcurrido en el procesador. */ - static Microsecond hardwareClock() throw() { + static Microsecond hardwareClock() { timespec ts; //clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts); // DONT works (original) //clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts); // DONT works @@ -411,33 +411,33 @@ struct functions { \return El valor booleano correspondiente a la cadena recibida. */ - static bool asBool(const char* str) throw(RuntimeException); + static bool asBool(const char* str) noexcept(false); /** Interpreta la cadena recibida como parametro como un entero de 32 bits. \return */ - static int asInteger(const char* str) throw() { return atoi(str); } + static int asInteger(const char* str) { return atoi(str); } /** Interpreta la cadena recibida como parametro como un entero de 32 bits. \return */ - static S64 asInteger64(const char* str) throw(); + static S64 asInteger64(const char* str) ; /** Devuelve el identificador de thread desde el que es invocado este metodo. Si el programa no tuviera soporta para MT siempre devolvera 0. \return el identificador de thread desde el que es invocado este metodo. */ - static pthread_t getCurrentThread() throw(); + static pthread_t getCurrentThread() ; /** Devuelve \em true si la version de nucleo que estamos ejecutado soporta multithread o \em false en otro caso. \return \em true si la version de nucleo que estamos ejecutado soporta multithread o \em false en otro */ - static bool supportMultithread() throw() { + static bool supportMultithread() { WHEN_SINGLETHREAD(return false); WHEN_MULTITHREAD(return true); } @@ -450,21 +450,21 @@ struct functions { \see regexec para mas informacion sobre las expresiones regulares. */ - static bool isLike(const char* pattern, const std::string& value) throw(RuntimeException); + static bool isLike(const char* pattern, const std::string& value) noexcept(false); /** * Devuelve el número de bits necesarios para representar el valor recibido como parámetro. * \param n Valor a estudiar. * \return el número de bits necesarios para representar el valor recibido como parámetro. */ - static int bitsize(const int n) throw() { return (n == 0) ? 1 : functions::log2(n) + 1; } + static int bitsize(const int n) { return (n == 0) ? 1 : functions::log2(n) + 1; } /** * Devuelve el número de bits necesarios para representar el valor recibido como parámetro. * \param n Valor a estudiar. * \return el número de bits necesarios para representar el valor recibido como parámetro. */ - static int bitsize(const S64 n) throw() { + static int bitsize(const S64 n) { int aux = n >> intBitSize; return (aux != 0) ? (bitsize(aux) + intBitSize) : bitsize((int) n); } @@ -479,14 +479,14 @@ struct functions { * \param bitShift Número de bits a desplazar. * \param n2 Número a combinar con el resultado de la operación (n1 << bitShift). */ - static S64 merge(const char* whatis, const int n1, const int n2, const int bitShift) throw(RuntimeException); + static S64 merge(const char* whatis, const int n1, const int n2, const int bitShift) noexcept(false); /** * Calcula el logaritmo en base 2 del número recibo como parámetro. * \param v Valor a calcular. * \return El algoritmo en base 2 del número recibido como parámetro o -1 si el parámetro recibido es 0. */ - static int log2(const unsigned int v) throw(); + static int log2(const unsigned int v) ; @@ -537,7 +537,7 @@ struct functions { @return Coherent literal as '%d ' */ - static std::string entriesAsString(int number, const char * wordForSingular = NULL, const char * wordForPlural = NULL) throw(); + static std::string entriesAsString(int number, const char * wordForSingular = NULL, const char * wordForPlural = NULL) ; /** Justify text (traces and output improvement) @@ -548,7 +548,7 @@ struct functions { @return Processed text */ - static std::string justify(const std::string & title, TextJustifyMode::_v mode = TextJustifyMode::Left, char filler = ' ') throw(); + static std::string justify(const std::string & title, TextJustifyMode::_v mode = TextJustifyMode::Left, char filler = ' ') ; /** Highligth text (traces and output improvement) @@ -560,7 +560,7 @@ struct functions { @return Processed text */ - static std::string highlight(const std::string & title, TextHighlightMode::_v mode = TextHighlightMode::Underline, char filler = '-', bool appendCR = true) throw(); + static std::string highlight(const std::string & title, TextHighlightMode::_v mode = TextHighlightMode::Underline, char filler = '-', bool appendCR = true) ; /** Highligth and justify text (traces and output improvement) @@ -574,7 +574,7 @@ struct functions { @return Processed text */ - static std::string highlightJustify(const std::string & title, TextHighlightMode::_v hMode = TextHighlightMode::OverAndUnderline, TextJustifyMode::_v jMode = TextJustifyMode::Center, char highlightFiller = '=', char justifyFiller = ' ', bool appendCR = true) throw() { + static std::string highlightJustify(const std::string & title, TextHighlightMode::_v hMode = TextHighlightMode::OverAndUnderline, TextJustifyMode::_v jMode = TextJustifyMode::Center, char highlightFiller = '=', char justifyFiller = ' ', bool appendCR = true) { return(highlight(justify(title, jMode, justifyFiller), hMode, highlightFiller, appendCR)); } @@ -584,7 +584,7 @@ struct functions { @param text Text processed @param tabSpaces Tab spaces (three by default) */ - static std::string tab(const std::string & text, int tabSpaces = 3) throw(); + static std::string tab(const std::string & text, int tabSpaces = 3) ; ////////////////////////////////////////////////////////////////////////////////////////////////// @@ -603,7 +603,7 @@ struct functions { \see Component */ template static T* componentByName(const char *className, const char* fromFile, const int fromLine) - throw(RuntimeException) { + noexcept(false) { ComponentManager &cm = ComponentManager::instantiate(); T* result = static_cast (cm.find(className)); @@ -626,12 +626,12 @@ struct functions { \return Component instance for the class provided at the pattern \warning T class must implement a method in the form: \code - static const char* getClassName () throw (); + static const char* getClassName () ; \endcode \see Component */ template static T* component(const char* fromFile, const int fromLine) - throw(RuntimeException) { + noexcept(false) { return functions::componentByName (T::getClassName(), fromFile, fromLine); } @@ -643,7 +643,7 @@ struct functions { @return Boolean about ocurrency */ - static bool endsWith(const std::string & pattern, const std::string & suffix) throw() { + static bool endsWith(const std::string & pattern, const std::string & suffix) { std::string dummy; return endsWith(pattern, suffix, dummy); } @@ -651,7 +651,7 @@ struct functions { /** Similar to #endsWith but returning additional preffix string by reference (pattern without suffix) */ - static bool endsWith(const std::string & pattern, const std::string & suffix, std::string & preffix) throw(); + static bool endsWith(const std::string & pattern, const std::string & suffix, std::string & preffix) ; /** Finds string at the begining of another @@ -661,7 +661,7 @@ struct functions { @return Boolean about ocurrency */ - static bool startsWith(const std::string & pattern, const std::string & preffix) throw() { + static bool startsWith(const std::string & pattern, const std::string & preffix) { std::string dummy; return startsWith(pattern, preffix, dummy); } @@ -669,7 +669,7 @@ struct functions { /** Similar to #startsWith but returning additional suffix string by reference (pattern without preffix) */ - static bool startsWith(const std::string & pattern, const std::string & preffix, std::string & suffix) throw(); + static bool startsWith(const std::string & pattern, const std::string & preffix, std::string & suffix) ; /** Finds 'item' and replaces it with 'target' within the string provided ('text'). @@ -682,31 +682,31 @@ struct functions { @return Modified string */ - static std::string replace(const std::string & text, const char *item, const char *target, bool all = true) throw(); + static std::string replace(const std::string & text, const char *item, const char *target, bool all = true) ; /** * Coverts original string without quotation into quoted one: '\%s' */ - static std::string addQuotationMarks(const std::string & str) throw(); - static std::string addQuotationMarks(const char * str) throw(); - static std::string addQuotationMarks(const int & integer) throw(); + static std::string addQuotationMarks(const std::string & str) ; + static std::string addQuotationMarks(const char * str) ; + static std::string addQuotationMarks(const int & integer) ; /** * Generates space-separated string lists based on integer elements * Also, another separator could be used. */ - static std::string vectorToStringRepresentation(const std::vector & v, const char separator = ' ') throw(); + static std::string vectorToStringRepresentation(const std::vector & v, const char separator = ' ') ; /** * Generates space-separated string lists based on string elements. * Also, another separator could be used. */ - static std::string vectorToStringRepresentation(const std::vector & v, const char separator = ' ') throw(); + static std::string vectorToStringRepresentation(const std::vector & v, const char separator = ' ') ; /** Returns socket notation 'Address:Port' */ - static std::string socketLiteralAsString(const std::string & address, int port) throw(); + static std::string socketLiteralAsString(const std::string & address, int port) ; /** Ascii string for buffer/size data block @@ -717,12 +717,12 @@ struct functions { @return Ascii string representation, and dots for non-printable cheracters */ - static std::string asAsciiString(const char * buffer, int size, bool & isFullyPrintable) throw(); + static std::string asAsciiString(const char * buffer, int size, bool & isFullyPrintable) ; /** Same as #asAsciiString but without interest about if is printable or not */ - static std::string asAsciiString(const char * buffer, int size) throw() { + static std::string asAsciiString(const char * buffer, int size) { bool isFullyPrintable; return asAsciiString(buffer, size, isFullyPrintable); } @@ -730,14 +730,14 @@ struct functions { /** Same as #asAsciiString providing anna::DataBlock */ - static std::string asAsciiString(const DataBlock & db, bool & isFullyPrintable) throw() { + static std::string asAsciiString(const DataBlock & db, bool & isFullyPrintable) { return asAsciiString(db.getData(), db.getSize(), isFullyPrintable); } /** Same as #asAsciiString providing DataBlock and without interest about if is printable or not */ - static std::string asAsciiString(const DataBlock & db) throw() { + static std::string asAsciiString(const DataBlock & db) { bool isFullyPrintable; return asAsciiString(db.getData(), db.getSize(), isFullyPrintable); } @@ -758,7 +758,7 @@ struct functions { * * @return Encoded DataBlock */ - static DataBlock rawIpPresentationAsRaw(const std::string & rawPresentation) throw(RuntimeException); + static DataBlock rawIpPresentationAsRaw(const std::string & rawPresentation) noexcept(false); /** @@ -777,7 +777,7 @@ struct functions { * * @return Decoded IP address */ - static std::string rawIpPresentationToIpAsString(const std::string & rawPresentation, bool normalize = false) throw(RuntimeException) { + static std::string rawIpPresentationToIpAsString(const std::string & rawPresentation, bool normalize = false) noexcept(false) { return rawIpAsString(rawIpPresentationAsRaw(rawPresentation), normalize); } @@ -795,7 +795,7 @@ struct functions { * * @return Human-readable raw IP presentation */ - static std::string rawIpAsRawIpPresentation(const DataBlock & db) throw(RuntimeException); + static std::string rawIpAsRawIpPresentation(const DataBlock & db) noexcept(false); /** @@ -803,14 +803,14 @@ struct functions { * * @return Hostname */ - static std::string getHostname() throw(); + static std::string getHostname() ; /** * Gets the domain name * * @return Domainname */ - static std::string getDomainname() throw(); + static std::string getDomainname() ; /** * Gets the FQDN (Fully Qualified Domain Name) @@ -820,14 +820,14 @@ struct functions { * * @return FQDN (.) */ - static std::string getFQDN(const char *hostname = NULL, const char *domainname = NULL) throw(); + static std::string getFQDN(const char *hostname = NULL, const char *domainname = NULL) ; /** * Gets the IP based on hostname (#getHostname) * * @return Hostname-based IP */ - static std::string getHostnameIP() throw(); + static std::string getHostnameIP() ; @@ -854,7 +854,7 @@ struct functions { * * @return Boolean for IPv4 nature */ - static bool isIPv4(const std::string & ip, IPv4Type::_v ipv4Type = IPv4Type::Estrict) throw(); + static bool isIPv4(const std::string & ip, IPv4Type::_v ipv4Type = IPv4Type::Estrict) ; /** * IPv6 address family detection @@ -863,7 +863,7 @@ struct functions { * * @return Boolean for IPv6 nature */ - static bool isIPv6(const std::string & ip) throw(); + static bool isIPv6(const std::string & ip) ; /** * Convert an IPv4 address to IPv6. Also removes dots from IPv4-mapped format. @@ -872,7 +872,7 @@ struct functions { * * @return string IPv6 formatted address or launch exception if invalid input */ - static std::string IPv4To6(const std::string & ipv4) throw(RuntimeException); + static std::string IPv4To6(const std::string & ipv4) noexcept(false); /** * Normalizes an IP address to long notation. Specially used for IPv6, but valid for IPv4 (via IPv4To6 conversion). @@ -885,7 +885,7 @@ struct functions { * * @return Normalized IP address */ - static std::string normalizeIP(const std::string & ip) throw(RuntimeException); + static std::string normalizeIP(const std::string & ip) noexcept(false); /** * Compare two IP addresses by mean normalization @@ -895,7 +895,7 @@ struct functions { * * @return Boolean about IP's comparison */ - static bool sameIP(const std::string & ip1, const std::string & ip2) throw(RuntimeException); + static bool sameIP(const std::string & ip1, const std::string & ip2) noexcept(false); /** * Compare two IP addresses by mean internal comparison after ipv6 preffix restriction @@ -905,7 +905,7 @@ struct functions { * * @return Boolean about subnet matching */ - static bool matchIPv6(const std::string & ipv6, const std::string & preffixedIpv6) throw(RuntimeException); + static bool matchIPv6(const std::string & ipv6, const std::string & preffixedIpv6) noexcept(false); /** * IP Address serialization @@ -914,7 +914,7 @@ struct functions { * * @return Encoded DataBlock */ - static DataBlock ipAsRaw(const std::string & ip) throw(RuntimeException); + static DataBlock ipAsRaw(const std::string & ip) noexcept(false); /** * IP Address decoding @@ -924,7 +924,7 @@ struct functions { * * @return Decoded IP address */ - static std::string rawIpAsString(const DataBlock & db, bool normalize = false) throw(RuntimeException) { + static std::string rawIpAsString(const DataBlock & db, bool normalize = false) noexcept(false) { return (rawIpAsString(db.getData(), db.getSize(), normalize)); } @@ -937,7 +937,7 @@ struct functions { * * @return Decoded IP address */ - static std::string rawIpAsString(const char *buffer, int bufferLength, bool normalize = false) throw(RuntimeException); + static std::string rawIpAsString(const char *buffer, int bufferLength, bool normalize = false) noexcept(false); /** * Abbreviates an IP address. Specially used for IPv6, but valid for IPv4. @@ -950,7 +950,7 @@ struct functions { * * @return Abbreviated IP address */ - static std::string abbreviateIP(const std::string & ip) throw(RuntimeException) { + static std::string abbreviateIP(const std::string & ip) noexcept(false) { return (rawIpAsString(ipAsRaw(ip))); } @@ -966,7 +966,7 @@ struct functions { * @param address Address extracted by reference * @param port Port extracted by reference */ - static void getAddressAndPortFromSocketLiteral(const std::string &literal, std::string &address, int &port) throw(); + static void getAddressAndPortFromSocketLiteral(const std::string &literal, std::string &address, int &port) ; /** * Translate pipe-separated socket literal list into Address/Port vector. @@ -974,7 +974,7 @@ struct functions { * @param list Comma-separated Address/Port list. I.e.: '10.95.10.25:4000,10.95.10.25:4001', or 'fed1:4000,fed2:4001' * @return Address/Port socket items vector */ - static socket_v getSocketVectorFromString(const std::string & list) throw(); + static socket_v getSocketVectorFromString(const std::string & list) ; /** * Translate Address/Port vector into comma-separated Address/Port list. @@ -983,7 +983,7 @@ struct functions { * * @return Comma-separated Address/Port list. I.e.: '10.95.10.25:4000,10.95.10.25:4001', or 'fed1:4000,fed2:4001' */ - static std::string socketVectorAsString(const socket_v & socketVector) throw(); + static std::string socketVectorAsString(const socket_v & socketVector) ; /** @@ -991,7 +991,7 @@ struct functions { @result Returns true when the system is little endian, false if big endian */ - static bool littleEndian() throw(); + static bool littleEndian() ; /** Encodes an integer number with 32 bits over a buffer with at least 4 bytes of length. @@ -999,7 +999,7 @@ struct functions { @param n Number to encode. \return Buffer with the encoded number. */ - static const char* codeInteger(char* result, const int n) throw(); + static const char* codeInteger(char* result, const int n) ; /** Encodes an integer number with 16 bits over a buffer with at least 2 bytes of length. @@ -1007,7 +1007,7 @@ struct functions { @param n Number to encode. \return Buffer with the encoded number. */ - static const char* codeShort(char* result, const short int n) throw(); + static const char* codeShort(char* result, const short int n) ; /** Encodes an integer number with 64 bits over a buffer with at least 8 bytes of length. @@ -1015,7 +1015,7 @@ struct functions { @param n Number to encode. \return Buffer with the encoded number. */ - static const char* codeInteger64(char* result, const S64 n) throw(); + static const char* codeInteger64(char* result, const S64 n) ; /** Encodes a floating number with 32 bits (according to the standard IEEE-754) over a buffer with at least 4 bytes of length. @@ -1023,7 +1023,7 @@ struct functions { @param n Number to encode. \return Buffer with the encoded number. */ - static const char* codeFloat(char* result, const float n) throw(); + static const char* codeFloat(char* result, const float n) ; /** Encodes a floating number with 64 bits (according to the standard IEEE-754) over a buffer with at least 8 bytes of length. @@ -1031,42 +1031,42 @@ struct functions { @param n Number to encode. \return Buffer with the encoded number. */ - static const char* codeDouble(char* result, const double n) throw(); + static const char* codeDouble(char* result, const double n) ; /** Decodes an 32 bits integer number contained in a 4-bytes buffer. @param data Buffer with the encoded number. @return Value for the number contained in the buffer. */ - static int decodeInteger(const char* data) throw(); + static int decodeInteger(const char* data) ; /** Decodes an 16 bits integer number contained in a 2-bytes buffer. @param data Buffer with the encoded number. @return Value for the number contained in the buffer. */ - static short int decodeShort(const char* data) throw(); + static short int decodeShort(const char* data) ; /** Decodes an 64 bits integer number contained in a 8-bytes buffer. @param data Buffer with the encoded number. @return Value for the number contained in the buffer. */ - static S64 decodeInteger64(const char* data) throw(); + static S64 decodeInteger64(const char* data) ; /** Decodes an 32 bits floating number (according to the standard IEEE-754) contained in a 4-bytes buffer. @param data Buffer with the encoded number. @return Value for the number contained in the buffer. */ - static float decodeFloat(const char* data) throw(); + static float decodeFloat(const char* data) ; /** Decodes an 64 bits floating number (according to the standard IEEE-754) contained in a 8-bytes buffer. @param data Buffer with the encoded number. @return Value for the number contained in the buffer. */ - static double decodeDouble(const char* data) throw(); + static double decodeDouble(const char* data) ; /** @@ -1077,7 +1077,7 @@ struct functions { * @param isupNumber Isup number decoded by reference. * @param calledOrCalling True for called party number, false for calling */ - static void decodeIsupNumber(const char *buffer, int length, isup_number_t & isupNumber, bool calledOrCalling) throw(RuntimeException); + static void decodeIsupNumber(const char *buffer, int length, isup_number_t & isupNumber, bool calledOrCalling) noexcept(false); /** * Encodes an ISUP Number (called or calling party number). @@ -1087,7 +1087,7 @@ struct functions { * @param buffer Isup number content encoded buffer. * @param length Isup number content encoded length. */ - static void codeIsupNumber(const isup_number_t & isupNumber, bool calledOrCalling, char * buffer, int & length) throw(RuntimeException); + static void codeIsupNumber(const isup_number_t & isupNumber, bool calledOrCalling, char * buffer, int & length) noexcept(false); /** * Encodes an ISUP Number (called or calling party number). @@ -1096,7 +1096,7 @@ struct functions { * @param calledOrCalling True for called party number, false for calling * @param target Isup number octet string. */ - static void codeIsupNumber(const isup_number_t & isupNumber, bool calledOrCalling, std::string & target) throw(RuntimeException); + static void codeIsupNumber(const isup_number_t & isupNumber, bool calledOrCalling, std::string & target) noexcept(false); /** * Base64 encoding @@ -1129,7 +1129,7 @@ struct functions { * * @return success for read operation */ - static bool getContentFromFile(const std::string &pathfile, std::string &content) throw(anna::RuntimeException); + static bool getContentFromFile(const std::string &pathfile, std::string &content) noexcept(false); }; } diff --git a/include/anna/core/internal/ModuleManager.hpp b/include/anna/core/internal/ModuleManager.hpp index 970a5c5..757aca8 100644 --- a/include/anna/core/internal/ModuleManager.hpp +++ b/include/anna/core/internal/ModuleManager.hpp @@ -21,12 +21,12 @@ public: typedef std::vector Modules; typedef Modules::const_iterator const_iterator; - void insert(const char* module, const char* revision) throw(); - const_iterator begin() const throw() { return a_modules.begin(); } - const_iterator end() const throw() { return a_modules.end(); } + void insert(const char* module, const char* revision) ; + const_iterator begin() const { return a_modules.begin(); } + const_iterator end() const { return a_modules.end(); } - static const char* module(const_iterator& ii) throw() { return ii->first; } - static const char* revision(const_iterator& ii) throw() { return ii->second;; } + static const char* module(const_iterator& ii) { return ii->first; } + static const char* revision(const_iterator& ii) { return ii->second;; } private: Modules a_modules; diff --git a/include/anna/core/internal/sccs.hpp b/include/anna/core/internal/sccs.hpp index c243560..720bdea 100644 --- a/include/anna/core/internal/sccs.hpp +++ b/include/anna/core/internal/sccs.hpp @@ -34,7 +34,7 @@ namespace anna { class sccs { public: - static void activate() throw(); + static void activate() ; }; } diff --git a/include/anna/core/mt/Guard.hpp b/include/anna/core/mt/Guard.hpp index 3c99cf8..5c28744 100644 --- a/include/anna/core/mt/Guard.hpp +++ b/include/anna/core/mt/Guard.hpp @@ -38,7 +38,7 @@ public: Constructor. @param object Sobre el que actuar para iniciar la guarda. */ - Guard(const Safe& object) throw(RuntimeException) : a_whatis(NULL) { + Guard(const Safe& object) noexcept(false) : a_whatis(NULL) { lock(a_safeObject = const_cast (&object), NULL); } @@ -46,14 +46,14 @@ public: Constructor. @param object Sobre el que actuar para iniciar la guarda. */ - Guard(const Safe* object) throw(RuntimeException); + Guard(const Safe* object) noexcept(false); /** Constructor. @param object Sobre el que actuar para iniciar la guarda. @param whatis Texto que indica la naturaleza del objeto a bloquear. */ - Guard(const Safe& object, const char* whatis) throw(RuntimeException) : a_whatis(whatis) { + Guard(const Safe& object, const char* whatis) noexcept(false) : a_whatis(whatis) { lock(a_safeObject = const_cast (&object), whatis); } @@ -62,25 +62,25 @@ public: @param object Sobre el que actuar para iniciar la guarda. @param whatis Texto que indica la naturaleza del objeto a bloquear. */ - Guard(const Safe* object, const char* whatis) throw(RuntimeException); + Guard(const Safe* object, const char* whatis) noexcept(false); /** Destructor. Termina la guarda iniciada con el objeto recibido como parametro en el constructor. */ - virtual ~Guard() throw() { deactivate(); } + virtual ~Guard() { deactivate(); } /** Desactiva la seccion critica antes de que termine el ambito de actuacion de la misma. */ - void deactivate() throw(); + void deactivate() ; private: Safe* a_safeObject; const char* a_whatis; - void lock(Safe*, const char* whatis) throw(RuntimeException); + void lock(Safe*, const char* whatis) noexcept(false); }; } //namespace anna diff --git a/include/anna/core/mt/Mutex.hpp b/include/anna/core/mt/Mutex.hpp index b962bb0..fcbe16e 100644 --- a/include/anna/core/mt/Mutex.hpp +++ b/include/anna/core/mt/Mutex.hpp @@ -51,9 +51,9 @@ public: */ virtual ~Mutex(); - virtual void lock() throw(RuntimeException); + virtual void lock() noexcept(false); - virtual void unlock() throw(); + virtual void unlock() ; /** * Devuelve \em true en caso de que haya conseguido bloquear el mutex, o @@ -61,13 +61,13 @@ public: * \return \em true en caso de que haya conseguido bloquear el mutex, o * \em false en otro caso. */ - bool trylock() throw(RuntimeException); + bool trylock() noexcept(false); /** * Operador de conversión. * \return El \em pthread_mutex_t asociado a esta instancia. */ - operator const pthread_mutex_t*() const throw() { + operator const pthread_mutex_t*() const { #ifdef _MT return &a_id; #else @@ -92,8 +92,8 @@ private: */ #define anna_declare_mutex(ClassName) \ anna::Mutex a_autoMutex; \ - void lock () throw (anna::RuntimeException) { a_autoMutex.lock (); } \ - void unlock () throw () { a_autoMutex.unlock (); } \ + void lock () noexcept(false) { a_autoMutex.lock (); } \ + void unlock () { a_autoMutex.unlock (); } \ friend class anna::Guard ; #define anna_access_mutex a_autoMutex diff --git a/include/anna/core/mt/Resource.hpp b/include/anna/core/mt/Resource.hpp index 4167987..63a5cb0 100644 --- a/include/anna/core/mt/Resource.hpp +++ b/include/anna/core/mt/Resource.hpp @@ -43,7 +43,7 @@ public: Devuelve el nombre logico de este recurso remoto. @return El nombre logico de este recurso remoto. */ - const std::string& getName() const throw() { return a_name; } + const std::string& getName() const { return a_name; } /** Devuelve el estado referente a la habilitacion de este recurso. @@ -55,7 +55,7 @@ public: \return \em true Si el recurso esta habilitado o \em false en otro caso. */ - bool isEnabled() const throw() { return a_isEnabled; } + bool isEnabled() const { return a_isEnabled; } /** * Obtiene el valor de la marca de tiempo asociada a este recurso. Se usa desde las clases @@ -64,13 +64,13 @@ public: * * \param timeStamp Marca de tiempo asociada al recurso. */ - void setTimeStamp(const Millisecond &timeStamp) throw() { a_timeStamp = timeStamp; } + void setTimeStamp(const Millisecond &timeStamp) { a_timeStamp = timeStamp; } /* * Devuelve la marca de tiempo asociada al recurso. * \return la marca de tiempo asociada al recurso. */ - const Millisecond &getTimeStamp() const throw() { return a_timeStamp; } + const Millisecond &getTimeStamp() const { return a_timeStamp; } /** Operador de comparacion. @@ -78,7 +78,7 @@ public: \return Devuelve \em true si el nombre recibido como parametro coincide con el indicado en el constructor de esta instancia o \em false en caso contrario. */ - bool operator == (const std::string& name) const throw() { return a_name == name; } + bool operator == (const std::string& name) const { return a_name == name; } /** Operador de comparacion. @@ -86,7 +86,7 @@ public: \return Devuelve \em true si el nombre recibido como parametro coincide con el indicado en el constructor de esta instancia o \em false en caso contrario. */ - bool operator == (const Resource& other) const throw() { return a_name == other.a_name; } + bool operator == (const Resource& other) const { return a_name == other.a_name; } /** Habilita el uso de este recurso. @@ -94,19 +94,19 @@ public: disponible. \warning La invocacion a este metodo deberia hacerse en modo exclusivo. */ - void enable() throw(RuntimeException) { Guard guard(this, "Resource"); a_isEnabled = true; } + void enable() noexcept(false) { Guard guard(this, "Resource"); a_isEnabled = true; } /** Evita el uso de este recurso. \warning La invocacion a este metodo deberia hacerse en modo exclusivo. */ - void disable() throw(RuntimeException) { Guard guard(this, "Resource"); a_isEnabled = false; } + void disable() noexcept(false) { Guard guard(this, "Resource"); a_isEnabled = false; } /** Devuelve una cadena con la informacin referente a este recurso remoto. @return Una cadena con la informacin referente a este recurso remoto. */ - virtual std::string asString() const throw(); + virtual std::string asString() const ; /** Devuelve el estado de disponibilidad de este recurso. @@ -118,7 +118,7 @@ public: @return \em false si el recurso no esta preparado para ser usado debido a causas internas o \em true en otro caso. */ - virtual bool isAvailable() const throw(RuntimeException) = 0; + virtual bool isAvailable() const noexcept(false) = 0; private: const std::string a_name; diff --git a/include/anna/core/mt/Runnable.hpp b/include/anna/core/mt/Runnable.hpp index c2e9789..369fdd8 100644 --- a/include/anna/core/mt/Runnable.hpp +++ b/include/anna/core/mt/Runnable.hpp @@ -31,7 +31,7 @@ public: Devuelve el nombre logico de esta instancia. @return El nombre logico de esta instancia. */ - const std::string& getId() const throw() { return a_id; } + const std::string& getId() const { return a_id; } /** Devuelve el valor del indicador de parada. @@ -39,25 +39,25 @@ public: \warning La implementacion particular del metodo run deberia comprobar este valor periodicamente. */ - bool hasRequestedStop() const throw() { return a_requestedStop == true; } + bool hasRequestedStop() const { return a_requestedStop == true; } /** Devuelve \em true si la instancia esta en ejecucion dentro de su propio thread o \em false en otro caso. \return \em true si la instancia esta en ejecucion dentro de su propio thread o \em false en otro caso. */ - bool isRunning() const throw() { return a_isRunning; } + bool isRunning() const { return a_isRunning; } /** Solicita la parada de esta instancia. */ - void requestStop() throw(RuntimeException); + void requestStop() noexcept(false); /** Devuelve una cadena con la informacion relevante de este objeto. \return Una cadena con la informacion relevante de este objeto. */ virtual std::string asString() const - throw() { + { std::string result("anna::Runnable { Id: "); result += a_id; result += functions::asText(" | Running: ", a_isRunning); @@ -87,38 +87,38 @@ protected: Establece el nombre logico de esta instancia. \param id Nuevo nombre logico de esta instancia. */ - void setId(const std::string& id) throw() { a_id = id; } + void setId(const std::string& id) { a_id = id; } /** Establece el indicador que informa sobre si esta instancia esta en ejecucion o no. \param isRunning Indicador que informa sobre si esta instancia esta en ejecucion. \warning Uso interno. Se invoca automaticamente desde Thread. */ - void setIsRunning(const bool isRunning) throw() { a_isRunning = isRunning; } + void setIsRunning(const bool isRunning) { a_isRunning = isRunning; } /** Metodo que se debe reescribir para inicializar el contenido de la clase justo antes de comenzar su ejecucion. */ - virtual void initialize() throw(RuntimeException) {;} + virtual void initialize() noexcept(false) {;} /** Metodo que debe reescribir para realizar la accion concreta. Por defecto invocara do_action mientras que no se invoque la metodo requestStop de la instancia. */ - virtual void run() throw(RuntimeException); + virtual void run() noexcept(false); /** Metodo que se debe reescribir para finalizar la ejecucion de esta instancia. \warning La re-implementacion de este metodo siempre debera invocar a la implementacion original que esta re-escribiiendo. */ - virtual void terminate() throw() { a_requestedStop = false; } + virtual void terminate() { a_requestedStop = false; } /** Metodo indicado por Runnable::run en tanto en cuanto no se invoque a requestStop. */ - virtual void do_action() throw(RuntimeException) = 0; + virtual void do_action() noexcept(false) = 0; private: std::string a_id; @@ -128,7 +128,7 @@ private: friend class Thread; }; -#define anna_complete_runnable(Class) void do_action () throw () {;} +#define anna_complete_runnable(Class) void do_action () {;} } //namespace anna diff --git a/include/anna/core/mt/Safe.hpp b/include/anna/core/mt/Safe.hpp index 14763c1..3231f15 100644 --- a/include/anna/core/mt/Safe.hpp +++ b/include/anna/core/mt/Safe.hpp @@ -27,14 +27,14 @@ public: \warning Cada invocacion a este metodo debe tener su correspondiente llamada al metodo #unlock. Es muy aconsejable delegar las llamadas a estos metodos en una instancia Guard. */ - virtual void lock() throw(RuntimeException) = 0; + virtual void lock() noexcept(false) = 0; /** Indica el final del acceso seguro iniciado al invocar #lock. \warning Indica el final del acceso seguro iniciado al invocar #lock. Es muy aconsejable delegar las llamadas a estos metodos en una instancia Guard. */ - virtual void unlock() throw() = 0; + virtual void unlock() = 0; protected: /** diff --git a/include/anna/core/mt/SafeRecycler.hpp b/include/anna/core/mt/SafeRecycler.hpp index 518ae0e..acfa9a3 100644 --- a/include/anna/core/mt/SafeRecycler.hpp +++ b/include/anna/core/mt/SafeRecycler.hpp @@ -62,7 +62,7 @@ public: @return Un puntero a una instancia de tipo T. */ T* create() - throw(RuntimeException) { + noexcept(false) { std::string name(typeid(*this).name()); name += "::create"; Guard guard(this, name.c_str()); @@ -74,7 +74,7 @@ public: \return el iterador que apunta al objeto recibido como parametro. */ iterator find(T* t) - throw(RuntimeException) { + noexcept(false) { std::string name(typeid(*this).name()); name += "::find"; Guard guard(this, name.c_str()); @@ -91,7 +91,7 @@ public: @param t Instancia de un puntero de tipo T obtenido a partir del metodo #create. */ void release(T* t) - throw() { + { if(t == NULL) return; @@ -109,7 +109,7 @@ public: Libera el puntero asociado al iterador recibido como parametro. \param ii Instancia a liberar. */ - void release(iterator& ii) throw() { + void release(iterator& ii) { try { std::string name(typeid(*this).name()); name += "::release (iterator)"; @@ -129,13 +129,13 @@ public: @param t Instancia de un puntero de tipo T obtenido a partir del metodo #create. */ - void release(const T* t) throw() { release(const_cast (t)); } + void release(const T* t) { release(const_cast (t)); } /** Marca como disponibles todos los objetos contenidos en memoria. */ void clear() - throw() { + { std::string name(typeid(*this).name()); name += "::clear"; Guard guard(this, name.c_str()); diff --git a/include/anna/core/mt/SafeSortedVector.hpp b/include/anna/core/mt/SafeSortedVector.hpp index efffba4..50d308c 100644 --- a/include/anna/core/mt/SafeSortedVector.hpp +++ b/include/anna/core/mt/SafeSortedVector.hpp @@ -49,7 +49,7 @@ public: vector o \em en otro caso. */ bool contains(const T* t) const - throw() { + { if(t == NULL) return false; @@ -63,7 +63,7 @@ public: \return \em true si ha registrado la nueva instancia o \em false en otro caso. */ bool add(T* t) - throw(RuntimeException) { + noexcept(false) { if(t == NULL) return false; @@ -77,7 +77,7 @@ public: \return \em true si ha eliminado la instancia o \em false en otro caso. */ bool erase(T* t) - throw(RuntimeException) { + noexcept(false) { if(t == NULL) return false; @@ -91,7 +91,7 @@ public: \return la instancia asociada a la clave recibida como parametro o NULL si no existe. */ T* find(const TKey key) - throw() { + { Guard guard(this, "SafeSortedVector ::find"); return SortedVector ::find(key); } @@ -101,7 +101,7 @@ public: \param key Clave a buscar en el vector. \return la instancia asociada a la clave recibida como parametro o NULL si no existe. */ - const T* find(const TKey key) const throw() { + const T* find(const TKey key) const { return const_cast *>(this)->find(key); } }; diff --git a/include/anna/core/mt/Semaphore.hpp b/include/anna/core/mt/Semaphore.hpp index acf21d2..1b1e3f3 100644 --- a/include/anna/core/mt/Semaphore.hpp +++ b/include/anna/core/mt/Semaphore.hpp @@ -54,25 +54,25 @@ public: Cada llamada a este metodo debe tener su correspondiente llamada a #signal. */ - void wait() throw(RuntimeException); + void wait() noexcept(false); /** Comprueba si se ha alcanzado la cuenta maxima de accesos simultaneos y devolvera \em true si todavia es posible acceder sin quedar bloqueado o \em false en otro caso. */ - bool tryWait() throw(RuntimeException); + bool tryWait() noexcept(false); /** Decrementa la cuenta de utilizacion del recurso, con lo que algunos de los threads que puede haber esperando se desbloqueara. */ - void signal() throw(RuntimeException); + void signal() noexcept(false); /** Devuelve una cadena con informacion relevante de esta instancia. \return Una cadena con informacion relevante de esta instancia. */ - virtual std::string asString() const throw(); + virtual std::string asString() const ; protected: /** @@ -81,7 +81,7 @@ protected: Es muy aconsejable delegar las llamadas a estos metodos en una instancia Guard. \return Siempre devuelve \em true; */ - void lock() throw(RuntimeException) { wait(); } + void lock() noexcept(false) { wait(); } /** Indica el final del acceso seguro iniciado al invocar #lock. @@ -89,7 +89,7 @@ protected: Es muy aconsejable delegar las llamadas a estos metodos en una instancia Guard. \return Siempre devuelve \em true; */ - void unlock() throw() { signal(); } + void unlock() { signal(); } private: sem_t a_id; diff --git a/include/anna/core/mt/Thread.hpp b/include/anna/core/mt/Thread.hpp index 02de8fe..f90f70b 100644 --- a/include/anna/core/mt/Thread.hpp +++ b/include/anna/core/mt/Thread.hpp @@ -52,26 +52,26 @@ public: /** @return El identificador de este thread a nivel de sistema operativo. */ - pthread_t getId() const throw() { return a_id; } + pthread_t getId() const { return a_id; } /** * Establece los flags que configuran el comportamiento de este thread. * \param flag Una combinación de los valores definidos por Thread::Flags::_v. * \warning Los flags deben establecerse antes de invocar al método #start. */ - void setFlags(const int flags) throw() { a_flags = flags; } + void setFlags(const int flags) { a_flags = flags; } /** * Devuelve el indicador que informa sobre si se podría aplicar el método #join sobre este thread */ - bool isJoinable() const throw() { return (a_flags & Flag::Joinable) != 0; } + bool isJoinable() const { return (a_flags & Flag::Joinable) != 0; } /** Devuelve el estado de ejecucion de �te thread. \return El estado de ejecucion de �te thread \em true si est�en ejecucion o \em false en otro caso. */ - bool isRunning() const throw() { return (a_id != (pthread_t) - 1); } + bool isRunning() const { return (a_id != (pthread_t) - 1); } // Metodos /** @@ -82,13 +82,13 @@ public: @param runnable Instancia del objeto que va a ser ejecutado en el nuevo thread. */ - void start(Runnable& runnable) throw(RuntimeException); + void start(Runnable& runnable) noexcept(false); /** Introduce un nuevo punto de cancelacin. Esto slo sera necesario en caso de que el proceso que implementa nuestro thread no haga ninguna llamada al sistema. */ - void testCancel() throw() { pthread_testcancel(); } + void testCancel() { pthread_testcancel(); } /** Suspende la ejecución del thread que invoca a este método hasta que termine la ejecución @@ -113,13 +113,13 @@ public: Con esto desde el thread C hemos lanzado los threads A y B; C quedar�bloqueado a la espera de que termine la ejecucion del thread B y una vez hecho esto termina la ejecucion del thread A. */ - void join() throw(RuntimeException); + void join() noexcept(false); /** Devuelve una cadena con la informacin referente a �te thread. \return Una cadena con la informacin referente a �te thread. */ - virtual std::string asString() const throw(); + virtual std::string asString() const ; private: struct Data { diff --git a/include/anna/core/mt/ThreadData.hpp b/include/anna/core/mt/ThreadData.hpp index 707318e..da47d4b 100644 --- a/include/anna/core/mt/ThreadData.hpp +++ b/include/anna/core/mt/ThreadData.hpp @@ -37,7 +37,7 @@ public: Si no existen se crean mediante el contructor vacio. \return Los datos asociados al thread desde el que se invoca a este metodo. */ - T& get() throw() { + T& get() { #ifndef _MT return a_data; #else diff --git a/include/anna/core/mt/ThreadManager.hpp b/include/anna/core/mt/ThreadManager.hpp index 6f3061b..57eadb0 100644 --- a/include/anna/core/mt/ThreadManager.hpp +++ b/include/anna/core/mt/ThreadManager.hpp @@ -70,7 +70,7 @@ public: * Devuelve el nombre asociado a este gestor. * \return el nombre asociado a este gestor. */ - const std::string& getName() const throw() { return a_name; } + const std::string& getName() const { return a_name; } /** Obtiene la instancia de un thread. El thread sólo se liberará de forma automática cuando se termine la ejecución del mismo. @@ -78,39 +78,39 @@ public: \warning Solo debe haber un único punto de creación de thread's por cada instancia de esta clase. */ - Thread* createThread() throw(RuntimeException); + Thread* createThread() noexcept(false); /** * Bloquea el proceso hasta que todos los threads lanzados por este gestor hayan terminado su ejecución. * \warning \li No debería invocarse desde un thread que haya sido creado por este gestor. * \li Los threads deberían crearse con el flag Thread::Flag::Joinable. */ - void join() throw(RuntimeException); + void join() noexcept(false); /** Devuelve un iterador al comienzo de la lista de threads. \return un iterador al comienzo de la lista de threads. */ - thread_iterator thread_begin() throw() { return begin(); } + thread_iterator thread_begin() { return begin(); } /** Devuelve un iterador al final de la lista de threads. \return un iterador al final de la lista de threads. */ - thread_iterator thread_end() throw() { return end(); } + thread_iterator thread_end() { return end(); } /** Devuelve el thread referenciado por el iterador recibido como parametro. \param ii Iterador. \return el thread referenciado por el iterador recibido como parametro. */ - static Thread* thread(thread_iterator ii) throw() { return SafeRecycler ::data(ii); } + static Thread* thread(thread_iterator ii) { return SafeRecycler ::data(ii); } /** * Devuelve una cadena con la información relevante sobre este gestor de threads * \return una cadena con la información relevante sobre este gestor de threads */ - std::string asString() const throw(); + std::string asString() const ; private: const std::string a_name; @@ -121,7 +121,7 @@ private: bool a_destroying; // Se invoca cuando el thread detecta que va a terminar y que tiene una factoria asociada. - void releaseThread(Thread* thread) throw(RuntimeException); + void releaseThread(Thread* thread) noexcept(false); friend class Thread; }; diff --git a/include/anna/core/oam/Configuration.hpp b/include/anna/core/oam/Configuration.hpp index ef17698..d11f7b6 100644 --- a/include/anna/core/oam/Configuration.hpp +++ b/include/anna/core/oam/Configuration.hpp @@ -48,10 +48,10 @@ class Configuration : public anna::Singleton { std::string a_alarm_text_delimiter_psS; std::string a_alarm_text_delimiter_psR; - const string_vector_t * getAlarmPreffixComponents() const throw() { return (a_alarms_preffix_enabled ? &a_alarm_text_preffix_components : NULL); } - const string_vector_t * getAlarmSuffixComponents() const throw() { return (a_alarms_suffix_enabled ? &a_alarm_text_suffix_components : NULL); } + const string_vector_t * getAlarmPreffixComponents() const { return (a_alarms_preffix_enabled ? &a_alarm_text_preffix_components : NULL); } + const string_vector_t * getAlarmSuffixComponents() const { return (a_alarms_suffix_enabled ? &a_alarm_text_suffix_components : NULL); } - void getAlarmTextDelimiters(char & zS, std::string & psL, std::string & psS, std::string & psR) const throw(); + void getAlarmTextDelimiters(char & zS, std::string & psL, std::string & psS, std::string & psR) const ; Configuration(); // private constructor @@ -82,7 +82,7 @@ public: * @param psS Preffix/Suffix separator delimiter * @param psR Preffix/Suffix right delimiter */ - void setAlarmTextDelimiters(const char zS, const std::string & psL, const std::string & psS, const std::string & psR) throw(); + void setAlarmTextDelimiters(const char zS, const std::string & psL, const std::string & psS, const std::string & psR) ; /** @@ -94,7 +94,7 @@ public: * * @param components Preffix components for alarm text */ - void setAlarmPreffixComponents(const std::vector & components) throw() { a_alarm_text_preffix_components = components; } + void setAlarmPreffixComponents(const std::vector & components) { a_alarm_text_preffix_components = components; } /** @@ -106,38 +106,38 @@ public: * * @param components Suffix components for alarm text */ - void setAlarmSuffixComponents(const std::vector & components) throw() { a_alarm_text_suffix_components = components; } + void setAlarmSuffixComponents(const std::vector & components) { a_alarm_text_suffix_components = components; } /** * Show general alarm preffix (enabled by default at constructor). */ - void enableAlarmsPreffix() throw(); + void enableAlarmsPreffix() ; /** * Show general alarm suffix (enabled by default at constructor). */ - void enableAlarmsSuffix() throw(); + void enableAlarmsSuffix() ; /** * Hide general alarm preffix (enabled by default at constructor). */ - void disableAlarmsPreffix() throw(); + void disableAlarmsPreffix() ; /** * Hide general alarm suffix (enabled by default at constructor). */ - void disableAlarmsSuffix() throw(); + void disableAlarmsSuffix() ; /** * Class XML representation * * @return XML with class content */ - anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); + anna::xml::Node* asXML(anna::xml::Node* parent) const ; }; } diff --git a/include/anna/core/oam/Counter.hpp b/include/anna/core/oam/Counter.hpp index ad541f3..8ba93f1 100644 --- a/include/anna/core/oam/Counter.hpp +++ b/include/anna/core/oam/Counter.hpp @@ -31,7 +31,7 @@ public: de crear el contador mediante el metodo CounterScope::create. \return El nombre logico del contador. */ - const std::string& getName() const throw() { return a_name; } + const std::string& getName() const { return a_name; } /** Devuelve la referencia logica de este contador. Sera el numero resultante de combinar @@ -39,44 +39,44 @@ public: ambito. \return La referencia logica de este contador. */ - int getReference() const throw(); + int getReference() const ; /** * Devuelve el valor actual de este contador. Este valor se podrá a cero cada vez que los contadores * se graben. * \return El valor actual de este contador. */ - type_t getValue() const throw() { return a_value; } + type_t getValue() const { return a_value; } /** * Devuelve el valor acumulado de este contador. * \return El valor acumulado de este contador. */ - U64 getAccumulatedValue() const throw() { return a_accValue; } + U64 getAccumulatedValue() const { return a_accValue; } /** Operador de conversion. \return El valor asociado a este contador. */ - operator type_t () const throw() { return a_value; } + operator type_t () const { return a_value; } /** Inicializa el valor de este contador. */ - void reset() throw() { a_value = 0; } + void reset() { a_value = 0; } /** Inicializa el valor acumulado de este contador. \return Devuelve 'true' si fue reseteado, 'false' si ya lo estaba */ - bool resetAcc() throw() { bool result = (a_accValue != 0); a_accValue = 0; return result; } + bool resetAcc() { bool result = (a_accValue != 0); a_accValue = 0; return result; } /** Devuelve una cadena con la informacion relevante de este objeto. \return Una cadena con la informacion relevante de este objeto. */ - std::string asString() const throw(); + std::string asString() const ; private: CounterScope& a_scope; @@ -88,7 +88,7 @@ private: Counter(CounterScope& scope, const int id, const char* name); Counter(const Counter&); - void debug() const throw(); + void debug() const ; friend class CounterScope; }; diff --git a/include/anna/core/oam/CounterRecorder.hpp b/include/anna/core/oam/CounterRecorder.hpp index d1a91fd..b9cd90b 100644 --- a/include/anna/core/oam/CounterRecorder.hpp +++ b/include/anna/core/oam/CounterRecorder.hpp @@ -30,25 +30,25 @@ public: /** Inicia el proceso de grabacion. */ - virtual void open() throw(RuntimeException) = 0; + virtual void open() noexcept(false) = 0; /** Transfiere el contador recibido como parametro al medio fisico. Solo nos llegaran los contadores modificados desde la ultima vez que se ejecuto el proceso de grabacion. \param counter Contador que debemos transferir al medio fisico. */ - virtual void apply(const Counter& counter) throw(RuntimeException) = 0; + virtual void apply(const Counter& counter) noexcept(false) = 0; /** Termina el proceso de grabacion. */ - virtual void close() throw() = 0; + virtual void close() = 0; /** Devuelve una cadena con la informacion relevante de este objeto. \return Una cadena con la informacion relevante de este objeto. */ - virtual std::string asString() const throw() = 0; + virtual std::string asString() const = 0; }; } diff --git a/include/anna/core/oam/CounterScope.hpp b/include/anna/core/oam/CounterScope.hpp index 5b58578..300b821 100644 --- a/include/anna/core/oam/CounterScope.hpp +++ b/include/anna/core/oam/CounterScope.hpp @@ -44,32 +44,32 @@ public: de crear el contador mediante el metodo CounterScope::create. \return El nombre logico del contador. */ - const std::string& getName() const throw() { return a_name; } + const std::string& getName() const { return a_name; } /** Devuelve el identificador del ambito \return El identificador del ambito. */ - const int getId() const throw() { return a_id; } + const int getId() const { return a_id; } /** Crea un nuevo contador. \param counter Numero logico del contador a crear. Debera ser menor de MaxCounter. \param name Nombre logico del ambito. */ - void create(const int counter, const char* name) throw(RuntimeException); + void create(const int counter, const char* name) noexcept(false); /** Devuelve una cadena con la informacion relevante de este objeto. \return Una cadena con la informacion relevante de este objeto. */ - std::string asString() const throw(); + std::string asString() const ; /** * Devuelve la información relevante de esta instancia en un documento XML. * \return la información relevante de esta instancia en un documento XML. */ - xml::Node* asXML(xml::Node* parent) const throw(RuntimeException); + xml::Node* asXML(xml::Node* parent) const noexcept(false); protected: /** @@ -78,7 +78,7 @@ protected: * a este ámbito. * \return El valor actual del contador. */ - Counter::type_t increment(const int counter, const Counter::type_t value) throw(RuntimeException); + Counter::type_t increment(const int counter, const Counter::type_t value) noexcept(false); /** * Establece el valor del contador recibido como parámetro. @@ -86,19 +86,19 @@ protected: * a este ámbito. * \return El valor actual del contador. */ - Counter::type_t assign(const int counter, const Counter::type_t value) throw(RuntimeException); + Counter::type_t assign(const int counter, const Counter::type_t value) noexcept(false); /** * Devuelve el valor actual del contador pasado como parámetro. * \param counter Identificador del contedor cuyo valor queremos obtener. */ - Counter::type_t getValue(const int counter) const throw(RuntimeException); + Counter::type_t getValue(const int counter) const noexcept(false); /** * Devuelve la instancia del contador. Puede ser NULL. * \return la instancia del contador. */ - const Counter* getCounter(const int counter) const throw(RuntimeException); + const Counter* getCounter(const int counter) const noexcept(false); public: @@ -106,13 +106,13 @@ public: * Devuelve el valor actual acumulado del contador pasado como parámetro. * \param counter Identificador del contedor cuyo valor acumulado queremos obtener. */ - U64 getAccValue(const int counter) const throw(RuntimeException); + U64 getAccValue(const int counter) const noexcept(false); /** * Resetea los valores acumulados totales de los contadores incluidos en el ámbito. * \return Numero de contadores afectados que tenian un acumulado no nulo. */ - int resetAccValues() throw(RuntimeException); + int resetAccValues() noexcept(false); private: const int a_id; diff --git a/include/anna/core/oam/Handler.hpp b/include/anna/core/oam/Handler.hpp index 67f6a6a..553161a 100644 --- a/include/anna/core/oam/Handler.hpp +++ b/include/anna/core/oam/Handler.hpp @@ -45,7 +45,7 @@ protected: * * @return Boolean counter data for 'type' when registered, NULL if not found */ - virtual const counter_data_t *counterEvent(const Module *module, const int & type, const int & amount) const throw(); + virtual const counter_data_t *counterEvent(const Module *module, const int & type, const int & amount) const ; /** * Event for alarms generated at the module provided. Base implementation trace the event based on #Module::getDefaultAlarmDescription, @@ -64,7 +64,7 @@ protected: * * @return Boolean alarm data for 'type' when registered, NULL if not found */ - virtual const alarm_data_t *alarmEvent(const Module *module, const char *textPreffix, const char *textSuffix, char textSeparator, bool activation, const int & type, va_list argList) const throw(); + virtual const alarm_data_t *alarmEvent(const Module *module, const char *textPreffix, const char *textSuffix, char textSeparator, bool activation, const int & type, va_list argList) const ; public: @@ -87,7 +87,7 @@ public: * @param module Reference OAM module * @see #anna::oam::Module::registerCounter */ - virtual void registerCounter(Module *module, const int &type, const std::string &description, const int &offset) throw(anna::RuntimeException) {;} + virtual void registerCounter(Module *module, const int &type, const std::string &description, const int &offset) noexcept(false) {;} /** * Invokes module alarm registration procedure. @@ -96,7 +96,7 @@ public: * @param module Reference OAM module * @see #anna::oam::Module::registerAlarm */ - virtual void registerAlarm(Module *module, const int &type, const std::string &description, const int &externalId, const std::string &dynamicVariablesCSL, const int &activationId, const int &cancellationId = -1) throw(anna::RuntimeException) {;} + virtual void registerAlarm(Module *module, const int &type, const std::string &description, const int &externalId, const std::string &dynamicVariablesCSL, const int &activationId, const int &cancellationId = -1) noexcept(false) {;} friend class Module; diff --git a/include/anna/core/oam/Module.hpp b/include/anna/core/oam/Module.hpp index 520bef2..ea8e627 100644 --- a/include/anna/core/oam/Module.hpp +++ b/include/anna/core/oam/Module.hpp @@ -151,33 +151,33 @@ class Module { // GENERIC ALARMS typedef std::map < int /*type*/, alarm_data_t > alarm_container; alarm_container a_alarms; - void alarmEvent(bool activation, const int & type, va_list argList) const throw(); + void alarmEvent(bool activation, const int & type, va_list argList) const ; // dynamic modifications over alarm text bool a_alarms_preffix_enabled; // Show own module alarm preffix bool a_alarms_suffix_enabled; // Show own module alarm suffix - std::string alarmComponentsToText(const std::vector & components, const std::string & psL, const std::string & psS, const std::string & psR) const throw(); + std::string alarmComponentsToText(const std::vector & components, const std::string & psL, const std::string & psS, const std::string & psR) const ; // Counters typedef scope_container::iterator scope_iterator; typedef scope_container::const_iterator const_scope_iterator; - scope_iterator scope_find(const int &key) throw() { return a_scopes.find(key); } - scope_iterator scope_begin() throw() { return a_scopes.begin(); } - scope_iterator scope_end() throw() { return a_scopes.end(); } - static anna::oam::CounterScope* scope(scope_iterator ii) throw() { return ii->second; } - const_scope_iterator scope_begin() const throw() { return a_scopes.begin(); } - const_scope_iterator scope_end() const throw() { return a_scopes.end(); } - static const anna::oam::CounterScope* scope(const_scope_iterator ii) throw() { return ii->second; } - anna::oam::CounterScope *getScope(const int &id) throw(); + scope_iterator scope_find(const int &key) { return a_scopes.find(key); } + scope_iterator scope_begin() { return a_scopes.begin(); } + scope_iterator scope_end() { return a_scopes.end(); } + static anna::oam::CounterScope* scope(scope_iterator ii) { return ii->second; } + const_scope_iterator scope_begin() const { return a_scopes.begin(); } + const_scope_iterator scope_end() const { return a_scopes.end(); } + static const anna::oam::CounterScope* scope(const_scope_iterator ii) { return ii->second; } + anna::oam::CounterScope *getScope(const int &id) ; typedef counter_container::iterator counter_iterator; typedef counter_container::const_iterator const_counter_iterator; -// bool counter_remove(const int &key) throw(); - const_counter_iterator counter_find(const int &key) const throw() { return a_counters.find(key); } - const_counter_iterator counter_begin() const throw() { return a_counters.begin(); } - const_counter_iterator counter_end() const throw() { return a_counters.end(); } - counter_iterator counter_find(const int &key) throw() { return a_counters.find(key); } - counter_iterator counter_begin() throw() { return a_counters.begin(); } - counter_iterator counter_end() throw() { return a_counters.end(); } +// bool counter_remove(const int &key) ; + const_counter_iterator counter_find(const int &key) const { return a_counters.find(key); } + const_counter_iterator counter_begin() const { return a_counters.begin(); } + const_counter_iterator counter_end() const { return a_counters.end(); } + counter_iterator counter_find(const int &key) { return a_counters.find(key); } + counter_iterator counter_begin() { return a_counters.begin(); } + counter_iterator counter_end() { return a_counters.end(); } CounterRecorder* a_counterRecorder; bool a_counterRecording; @@ -192,14 +192,14 @@ class Module { // Alarms typedef alarm_container::iterator alarm_iterator; typedef alarm_container::const_iterator const_alarm_iterator; -// bool alarm_remove(const int &key) throw(); - const_alarm_iterator alarm_find(const int &key) const throw() { return a_alarms.find(key); } - const_alarm_iterator alarm_begin() const throw() { return a_alarms.begin(); } - const_alarm_iterator alarm_end() const throw() { return a_alarms.end(); } - alarm_iterator alarm_find(const int &key) throw() { return a_alarms.find(key); } - alarm_iterator alarm_begin() throw() { return a_alarms.begin(); } - alarm_iterator alarm_end() throw() { return a_alarms.end(); } - void getAlarmPreffixSuffixAndZoneSeparator(std::string & preffix, std::string & suffix, char & zS) const throw(); +// bool alarm_remove(const int &key) ; + const_alarm_iterator alarm_find(const int &key) const { return a_alarms.find(key); } + const_alarm_iterator alarm_begin() const { return a_alarms.begin(); } + const_alarm_iterator alarm_end() const { return a_alarms.end(); } + alarm_iterator alarm_find(const int &key) { return a_alarms.find(key); } + alarm_iterator alarm_begin() { return a_alarms.begin(); } + alarm_iterator alarm_end() { return a_alarms.end(); } + void getAlarmPreffixSuffixAndZoneSeparator(std::string & preffix, std::string & suffix, char & zS) const ; public: @@ -233,59 +233,59 @@ public: * Enable all the counters registered in this module (enabled by default at constructor). * Usually managed at PROCCESS implementation */ - void enableCounters(void) throw(); + void enableCounters(void) ; /** * Disable all the counters registered in this module (enabled by default at constructor). * Usually managed at PROCCESS implementation */ - void disableCounters(void) throw(); + void disableCounters(void) ; /** * Enable all the alarms registered in this module (enabled by default at constructor). * Usually managed at PROCCESS implementation */ - void enableAlarms(void) throw(); + void enableAlarms(void) ; /** * Disable all the alarms registered in this module (enabled by default at constructor). * Usually managed at PROCCESS implementation */ - void disableAlarms(void) throw(); + void disableAlarms(void) ; /** Getter for counters enabled */ - bool countersEnabled() const throw() { return a_counters_enabled; } + bool countersEnabled() const { return a_counters_enabled; } /** Getter for alarms enabled */ - bool alarmsEnabled() const throw() { return a_alarms_enabled; } + bool alarmsEnabled() const { return a_alarms_enabled; } /** * Show own module alarm preffix (enabled by default at constructor). * Usually managed at PROCCESS implementation */ - void enableAlarmsPreffix(void) throw(); + void enableAlarmsPreffix(void) ; /** * Show own module alarm suffix (enabled by default at constructor). * Usually managed at PROCCESS implementation */ - void enableAlarmsSuffix(void) throw(); + void enableAlarmsSuffix(void) ; /** * Hide own module alarm preffix (enabled by default at constructor). * Usually managed at PROCCESS implementation */ - void disableAlarmsPreffix(void) throw(); + void disableAlarmsPreffix(void) ; /** * Hide own module alarm suffix (enabled by default at constructor). * Usually managed at PROCCESS implementation */ - void disableAlarmsSuffix(void) throw(); + void disableAlarmsSuffix(void) ; /** * Sets the operations handler. By default, all modules will use the default anna::oam::Handler. @@ -296,7 +296,7 @@ public: * * @param handler Handler used for OAM operations (registering and launch). NULL is ignored */ - void setHandler(Handler *handler) throw() { if(handler) a_handler = handler; } + void setHandler(Handler *handler) { if(handler) a_handler = handler; } /** * Counter scope registration. Usually, only one scope id will be registered, but multicontext applications @@ -312,7 +312,7 @@ public: * better than 'Main OAM Module' for all of them. Also, you can use the same description for all scopes * (that is the case of default assignment). */ - void initializeCounterScope(const int & scopeId, const std::string & description = "") throw(anna::RuntimeException); + void initializeCounterScope(const int & scopeId, const std::string & description = "") noexcept(false); /** @@ -322,7 +322,7 @@ public: * * @param scopeId Counter scope id which becomes active. */ - void setActiveCounterScope(const int & scopeId) throw(); + void setActiveCounterScope(const int & scopeId) ; /** @@ -330,7 +330,7 @@ public: * * @return Activated counter scope */ - const anna::oam::CounterScope* getActiveCounterScope() const throw() { return a_active_counter_scope; } + const anna::oam::CounterScope* getActiveCounterScope() const { return a_active_counter_scope; } /** * Child oam module classes should define descriptions for each enum type. A good practice would be the use of @@ -341,7 +341,7 @@ public: * * @return Default alarm description */ - virtual std::string getDefaultInternalAlarmDescription(const int & type) const throw(); + virtual std::string getDefaultInternalAlarmDescription(const int & type) const ; /** * Child oam module classes should define descriptions for each enum type. A good practice would be the use of @@ -352,7 +352,7 @@ public: * * @return Default counter description */ - virtual std::string getDefaultInternalCounterDescription(const int & type) const throw(); + virtual std::string getDefaultInternalCounterDescription(const int & type) const ; /** @@ -365,7 +365,7 @@ public: * for non-registered will be searched (#getDefaultInternalCounterDescription). * @param offset Counter offset over (1000 * scope id). Offset has 0-999 range. */ - void registerCounter(const int &type, const std::string &description, const int &offset) throw(anna::RuntimeException); + void registerCounter(const int &type, const std::string &description, const int &offset) noexcept(false); /** @@ -381,7 +381,7 @@ public: * @param activationId Alarm activation identifier * @param cancellationId Alarm cancellation identifier. If missing, the alarm will interpreted as non-transferable */ - void registerAlarm(const int &type, const std::string &description, const int &externalId, const std::string &dynamicVariablesCSL, const int &activationId, const int &cancellationId = -1) throw(anna::RuntimeException); + void registerAlarm(const int &type, const std::string &description, const int &externalId, const std::string &dynamicVariablesCSL, const int &activationId, const int &cancellationId = -1) noexcept(false); /** @@ -389,7 +389,7 @@ public: @param OAM module name */ - const char *getName() const throw() { return a_name.c_str(); } + const char *getName() const { return a_name.c_str(); } /** @@ -397,7 +397,7 @@ public: @param type Alarm enum-identification within the own context/module. */ - const counter_data_t *counter(const int &type) const throw() { + const counter_data_t *counter(const int &type) const { const_counter_iterator it = counter_find(type); return ((it != counter_end()) ? (&(*it).second) : NULL); } @@ -407,7 +407,7 @@ public: @param type Counter enum-identification within the own context/module. */ - const alarm_data_t *alarm(const int &type) const throw() { + const alarm_data_t *alarm(const int &type) const { const_alarm_iterator it = alarm_find(type); return ((it != alarm_end()) ? (&(*it).second) : NULL); } @@ -420,7 +420,7 @@ public: * @param type Counter enum-identification within the own context/module * @param amount Units increased. Default is 1 */ - void count(const int & type, const int & amount = 1) throw(anna::RuntimeException); + void count(const int & type, const int & amount = 1) noexcept(false); /** @@ -431,7 +431,7 @@ public: * * @return Number of affected counters which have been reset (only those which have non-zero accumulated count). */ - int resetCounters(const int & scopeId = -1) throw(); + int resetCounters(const int & scopeId = -1) ; /** @@ -439,7 +439,7 @@ public: * @counterRecorder Provided instance * @warning It should be invoked periodically as a common solution */ - void setCounterRecorder(CounterRecorder* counterRecorder) throw() { a_counterRecorder = counterRecorder; } + void setCounterRecorder(CounterRecorder* counterRecorder) { a_counterRecorder = counterRecorder; } /** * Dumps the modified counters from last invocation to this method. @@ -447,7 +447,7 @@ public: * will have the specific behaviour. This procedure is oriented to have physical storage * for counters information. */ - void recordCounters() throw(anna::RuntimeException); + void recordCounters() noexcept(false); /** @@ -457,7 +457,7 @@ public: * @param alarmType Alarm enum-identification within the own context/module * @param ... Optional parsing data for dynamic-composed text. */ - void activateAlarm(int type, ...) const throw(anna::RuntimeException); + void activateAlarm(int type, ...) const noexcept(false); /** @@ -467,7 +467,7 @@ public: * @param alarmType Alarm enum-identification within the own context/module * @param ... Optional parsing data for dynamic-composed text. */ - void cancelAlarm(int type, ...) const throw(anna::RuntimeException); + void cancelAlarm(int type, ...) const noexcept(false); /** @@ -476,7 +476,7 @@ public: * * @return String with class content */ - virtual std::string asString(void) const throw(); + virtual std::string asString(void) const ; /** @@ -485,7 +485,7 @@ public: * * @return XML with class content */ - virtual anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); + virtual anna::xml::Node* asXML(anna::xml::Node* parent) const ; protected: @@ -500,7 +500,7 @@ protected: * * @param components Alarm preffix components defined by oam module. Empty on default implementation. */ - virtual void readAlarmPreffixComponents(std::vector & components) const throw() {;} + virtual void readAlarmPreffixComponents(std::vector & components) const {;} /** @@ -513,7 +513,7 @@ protected: * * @param components Alarm suffix components defined by oam module. Empty on default implementation. */ - virtual void readAlarmSuffixComponents(std::vector & components) const throw() {;} + virtual void readAlarmSuffixComponents(std::vector & components) const {;} friend class RecordingGuard; diff --git a/include/anna/core/tracing/Configuration.hpp b/include/anna/core/tracing/Configuration.hpp index adbddff..23f4c94 100644 --- a/include/anna/core/tracing/Configuration.hpp +++ b/include/anna/core/tracing/Configuration.hpp @@ -49,7 +49,7 @@ private: friend class TraceLevelChecker; - const trace_trigger_map_t & getTraceTriggers() const throw() { return a_traceTriggers; } + const trace_trigger_map_t & getTraceTriggers() const { return a_traceTriggers; } public: @@ -57,7 +57,7 @@ public: /** * Deletes all added triggers for selective tracing. */ - void resetTraceTriggers() throw() { a_traceTriggers.clear(); } + void resetTraceTriggers() { a_traceTriggers.clear(); } /** @@ -72,7 +72,7 @@ public: * trigger reference. * @param level Desired trace level when context fulfill this trigger reference. Debug by default */ - void activateTraceTrigger(const std::string & trigger, bool accumulate = false, anna::Logger::Level level = anna::Logger::Debug) throw(); + void activateTraceTrigger(const std::string & trigger, bool accumulate = false, anna::Logger::Level level = anna::Logger::Debug) ; /** @@ -80,7 +80,7 @@ public: * * @param trigger String reference to be erased from internal trigger set */ - void deactivateTraceTrigger(const std::string & trigger) throw(); + void deactivateTraceTrigger(const std::string & trigger) ; /** @@ -90,7 +90,7 @@ public: * * @return Boolean about if regular expressions interpretation are activated. */ - bool readRegexpForTraceTriggers() const throw() { return (a_readTraceTriggersAsRegexp); } + bool readRegexpForTraceTriggers() const { return (a_readTraceTriggersAsRegexp); } /** @@ -100,7 +100,7 @@ public: * * @param readRegexp Boolean for activation/deactivation of regexp funtionality */ - void useRegexpForTraceTriggers(bool readRegexp = true) throw() { a_readTraceTriggersAsRegexp = readRegexp; } + void useRegexpForTraceTriggers(bool readRegexp = true) { a_readTraceTriggersAsRegexp = readRegexp; } /** @@ -108,7 +108,7 @@ public: * * @return String with class content */ - std::string asString(void) const throw(); + std::string asString(void) const ; }; } diff --git a/include/anna/core/tracing/Logger.hpp b/include/anna/core/tracing/Logger.hpp index de92545..ec0c50e 100644 --- a/include/anna/core/tracing/Logger.hpp +++ b/include/anna/core/tracing/Logger.hpp @@ -63,7 +63,7 @@ public: @param id Identificador logico. Usado en el DefaultWriter para inicializar el sistema del log (metodo syslog). */ - virtual void initialize(const char* id) throw() = 0; + virtual void initialize(const char* id) = 0; /** Transfiere el mensaje de trazas al log del sistema. El metodo implementado debe ser @@ -75,7 +75,7 @@ public: @param level Nivel de las trazas que vamos a sacar. @param text Especificacion de formato del mensaje. Similar al usado en el comando sprintf. */ - virtual void do_write(int level, const char* text, ...) throw() = 0; + virtual void do_write(int level, const char* text, ...) = 0; protected: /** @@ -94,7 +94,7 @@ public: @return La instancia del bloque de datos con memoria reservada para poder interpretar los parametros. */ - DataBlock& getDataBlock() throw() { return *a_dataBlock; } + DataBlock& getDataBlock() { return *a_dataBlock; } private: DataBlock* a_dataBlock; @@ -116,7 +116,7 @@ public: @see DefaultWriter. */ - static void initialize(const char* ident) throw(); + static void initialize(const char* ident) ; /** Inicializa el sistema de historico de nuestra aplicacion. Solo debe invocarse una unica vez @@ -135,12 +135,12 @@ public: @see DefaultWriter. */ - static void initialize(const char* ident, Writer* writer) throw(); + static void initialize(const char* ident, Writer* writer) ; /** @return El nivel de trazado de nuestra aplicacion. */ - static Level getLevel() throw() { return st_level; } + static Level getLevel() { return st_level; } /** Establece el nivel de trazado de nuestra aplicacion. El nivel de trazado por defecto @@ -153,7 +153,7 @@ public: @param level Nivel de trazado que deseamos establecer. */ static void setLevel(const Level level) - throw(RuntimeException) { + noexcept(false) { Guard guard(st_mutex, "Logger::setLevel"); st_level = (level <= Error) ? Error : level; } @@ -166,20 +166,20 @@ public: @return @em true Si el nivel de trazado de nuestra aplicacion es mayor que el recibido como parametro o @em false en otro caso. */ - static bool isActive(const Level level) throw() { + static bool isActive(const Level level) { return (st_writer != NULL && level <= Error) ? true : (st_enabled && level <= st_level && st_writer != NULL); } /** Desactiva el sistema de trazado. */ - static void disable() throw(RuntimeException); + static void disable() noexcept(false); /** Activa el sistema de trazado y establece el nivel de trazado existente antes de la desactivacion (Ver #disable). */ - static void enable() throw(RuntimeException); + static void enable() noexcept(false); /** * Establece el valor del indicador que hace que se vuelque el PID del proceso en la linea de trazas. @@ -188,7 +188,7 @@ public: * * \param showPID Valor del indicador. */ - static void showPID(const bool show) throw(); + static void showPID(const bool show) ; /** Traza el texto recibido en el historico con el nivel indicado. @@ -201,7 +201,7 @@ public: @param fromFile Nombre del archivo donde se genera la traza. @param fromLine Numero de linea del archivo donde se genera la traza. */ - static void write(const Level level, const char* text, const char* fromFile, const int fromLine) throw(); + static void write(const Level level, const char* text, const char* fromFile, const int fromLine) ; /** Traza el texto recibido en el historico con el nivel indicado. @@ -214,7 +214,7 @@ public: @param fromFile Nombre del archivo donde se genera la traza. @param fromLine Numero de linea del archivo donde se genera la traza. */ - static void write(const Level level, const std::string& text, const char* fromFile, const int fromLine) throw() { + static void write(const Level level, const std::string& text, const char* fromFile, const int fromLine) { write(level, text.c_str(), fromFile, fromLine); } @@ -230,7 +230,7 @@ public: @param fromFile Nombre del archivo donde se genera la traza. @param fromLine Numero de linea del archivo donde se genera la traza. */ - static void write(const Level level, const char* text, const char* value, const char* fromFile, const int fromLine) throw(); + static void write(const Level level, const char* text, const char* value, const char* fromFile, const int fromLine) ; /** Traza el texto recibido en el historico con el nivel indicado. @@ -245,7 +245,7 @@ public: @param fromLine Numero de linea del archivo donde se genera la traza. */ static void write(const Level level, const char* text, const std::string& value, const char* fromFile, const int fromLine) - throw() { + { write(level, text, value.c_str(), fromFile, fromLine); } @@ -262,7 +262,7 @@ public: @param fromLine Numero de linea del archivo donde se genera la traza. */ static void write(const Level level, const std::string& text, const std::string& value, const char* fromFile, const int fromLine) - throw() { + { write(level, text.c_str(), value.c_str(), fromFile, fromLine); } @@ -279,7 +279,7 @@ public: @param fromLine Numero de linea del archivo donde se genera la traza. */ static void write(const Level level, const char* text, const int value, const char* fromFile, const int fromLine) - throw(); + ; /** Traza el texto recibido en el historico con el nivel indicado. @@ -294,7 +294,7 @@ public: @param fromLine Numero de linea del archivo donde se genera la traza. */ static void write(const Level level, const char* text, const DataBlock& value, const char* fromFile, const int fromLine) - throw(); + ; /** Si el nivel \em Debug esta activado traza el texto recibido en el historico. @@ -303,7 +303,7 @@ public: @param fromLine Numero de linea del archivo donde se genera la traza. */ static void debug(const std::string& text, const char* fromFile, const int fromLine) - throw() { + { write(Logger::Debug, text, fromFile, fromLine); } @@ -314,7 +314,7 @@ public: @param fromLine Numero de linea del archivo donde se genera la traza. */ static void information(const std::string& text, const char* fromFile, const int fromLine) - throw() { + { write(Logger::Information, text, fromFile, fromLine); } @@ -325,7 +325,7 @@ public: @param fromLine Numero de linea del archivo donde se genera la traza. */ static void notice(const std::string& text, const char* fromFile, const int fromLine) - throw() { + { write(Logger::Notice, text, fromFile, fromLine); } @@ -336,7 +336,7 @@ public: @param fromLine Numero de linea del archivo donde se genera la traza. */ static void warning(const std::string& text, const char* fromFile, const int fromLine) - throw() { + { write(Logger::Warning, text, fromFile, fromLine); } @@ -347,7 +347,7 @@ public: @param fromLine Numero de linea del archivo donde se genera la traza. */ static void error(const std::string& text, const char* fromFile, const int fromLine) - throw() { + { write(Logger::Error, text, fromFile, fromLine); } @@ -358,7 +358,7 @@ public: @param fromLine Numero de linea del archivo donde se genera la traza. */ static void critical(const std::string& text, const char* fromFile, const int fromLine) - throw() { + { write(Logger::Critical, text, fromFile, fromLine); } @@ -369,7 +369,7 @@ public: @param fromLine Numero de linea del archivo donde se genera la traza. */ static void alert(const std::string& text, const char* fromFile, const int fromLine) - throw() { + { write(Logger::Alert, text, fromFile, fromLine); } @@ -380,7 +380,7 @@ public: @param fromLine Numero de linea del archivo donde se genera la traza. */ static void emergency(const std::string& text, const char* fromFile, const int fromLine) - throw() { + { write(Logger::Emergency, text, fromFile, fromLine); } @@ -388,7 +388,7 @@ public: @return La cadena que identifica al nivel recibido como parametro. */ - static const char* asString(const Level level) throw(); + static const char* asString(const Level level) ; /** Traduce la cadena recibida al nivel correspondiente. @@ -397,7 +397,7 @@ public: \warning Debe de ser alguno de los siguiente literales: emerg, alert, crit, err, warning, notice, info, debug */ - static Level asLevel(const char* level) throw(RuntimeException); + static Level asLevel(const char* level) noexcept(false); private: static NRMutex st_mutex; diff --git a/include/anna/core/tracing/TraceLevelChecker.hpp b/include/anna/core/tracing/TraceLevelChecker.hpp index 742ad20..f546f86 100644 --- a/include/anna/core/tracing/TraceLevelChecker.hpp +++ b/include/anna/core/tracing/TraceLevelChecker.hpp @@ -104,7 +104,7 @@ public: * @param contextData String to be compared * @param targetLevel Desired target level configured for each trigger item at global Configuration class */ - virtual bool changeLevelCondition(const std::string & contextData, anna::Logger::Level & targetLevel) const throw(); + virtual bool changeLevelCondition(const std::string & contextData, anna::Logger::Level & targetLevel) const ; /** @@ -122,7 +122,7 @@ public: * * @return Boolean about trace level change because of condition result */ - bool load(const char * contextData = NULL) throw(); + bool load(const char * contextData = NULL) ; /** @@ -132,7 +132,7 @@ public: * * @return Boolean about Trace level change because restore proceed */ - bool restore(void) throw(); + bool restore(void) ; }; } diff --git a/include/anna/core/tracing/TraceLogger.hpp b/include/anna/core/tracing/TraceLogger.hpp index 7bce72b..8ffdacb 100644 --- a/include/anna/core/tracing/TraceLogger.hpp +++ b/include/anna/core/tracing/TraceLogger.hpp @@ -35,7 +35,7 @@ private: @param ident Identifica las trazas de nuestra aplicacion que apareceran en el archivo de historico. Deberia ser un texto con entre 4 y 16 caracteres. */ - void initialize(const char* ident) throw(); + void initialize(const char* ident) ; /** Transfiere el mensaje de trazas al log del sistema. @@ -43,7 +43,7 @@ private: @param level Nivel de las trazas que vamos a sacar. @param text Especificacion de formato del mensaje. Similar al usado en el comando sprintf. */ - void do_write(int level, const char* text, ...) throw(); + void do_write(int level, const char* text, ...) ; }; } diff --git a/include/anna/core/tracing/TraceWriter.hpp b/include/anna/core/tracing/TraceWriter.hpp index b9a3d97..6f237b0 100644 --- a/include/anna/core/tracing/TraceWriter.hpp +++ b/include/anna/core/tracing/TraceWriter.hpp @@ -47,7 +47,7 @@ public: Devuelve el tama�o maximo del fichero de trazas. \return El tama�o maximo del fichero de trazas. */ - int getMaxSize() const throw() { return a_maxSize; } + int getMaxSize() const { return a_maxSize; } /** Metodo para cambiar dinamicamente la configuracion del grabador de trazas. Las seccciones @@ -70,7 +70,7 @@ public: \warning La configuracion debera estar correctamente cargada. Ver Configuration::load. */ - void setup(const char* fileName, const Configuration& configuration) throw(); + void setup(const char* fileName, const Configuration& configuration) ; /** Metodo para cambiar dinamicamente la configuracion del grabador de trazas. @@ -84,12 +84,12 @@ public: \warning Solo deberia llamarse una vez para cambiar de la configuracion por defecto a la configuracion particular de cada proceso. */ - void setup(const char* fileName, const int maxSize = 0, const bool clean = true) throw(); + void setup(const char* fileName, const int maxSize = 0, const bool clean = true) ; /** Saca por pantalla la informacion relevente de este grabador de trazas. */ - void printResume() throw(); + void printResume() ; /** Conecta esta instancia con un TraceWriterObserver, lo que permitira que esta instancia @@ -103,7 +103,7 @@ public: \warning La instancia del TraceWriterObserver debera estar disponible durante toda la ejecucion. */ - void attach(TraceWriterObserver* observer) throw(); + void attach(TraceWriterObserver* observer) ; private: typedef std::vector ::iterator observer_iterator; @@ -128,15 +128,15 @@ private: std::vector a_observers; bool a_observed; - observer_iterator observer_begin() throw() { return a_observers.begin(); } - observer_iterator observer_end() throw() { return a_observers.end(); } + observer_iterator observer_begin() { return a_observers.begin(); } + observer_iterator observer_end() { return a_observers.end(); } - static TraceWriterObserver* observer(observer_iterator& ii) throw() { return *ii; } + static TraceWriterObserver* observer(observer_iterator& ii) { return *ii; } - void initialize(const char*) throw() { printResume(); } - void do_write(int level, const char* text, ...) throw(); - const char* getDate() throw(); - int prepareOutput(const char* date) throw(); + void initialize(const char*) { printResume(); } + void do_write(int level, const char* text, ...) ; + const char* getDate() ; + int prepareOutput(const char* date) ; }; } diff --git a/include/anna/core/tracing/TraceWriterObserver.hpp b/include/anna/core/tracing/TraceWriterObserver.hpp index efdd20a..f05528f 100644 --- a/include/anna/core/tracing/TraceWriterObserver.hpp +++ b/include/anna/core/tracing/TraceWriterObserver.hpp @@ -29,13 +29,13 @@ public: /** Devuelve el nombre logico de este observador. */ - const char* getName() const throw() { return a_name; } + const char* getName() const { return a_name; } /** Devuelve una cadena con la informacion relevante de esta clase. \return una cadena con la informacion relevante de esta clase. */ - std::string asString() const throw() { + std::string asString() const { std::string result("anna::TraceWriterObserver { Name: "); result += a_name; return result += " }"; @@ -54,7 +54,7 @@ protected: \warning El fichero usado para escribir las trazas puede abrirse un numero indeterminado de veces durante la ejecucion de nuestra aplicacion. */ - virtual void handleOpen(const int fd) throw() = 0; + virtual void handleOpen(const int fd) = 0; /** Metodo que hay que reescribir para tratar la notificacion de cierre del fichero de trazas. @@ -63,7 +63,7 @@ protected: \warning El fichero usado para escribir las trazas puede cerrar un numero indeterminado de veces durante la ejecucion de nuestra aplicacion. */ - virtual void handleClose(const int fd) throw() = 0; + virtual void handleClose(const int fd) = 0; private: const char* a_name; diff --git a/include/anna/core/util/Average.hpp b/include/anna/core/util/Average.hpp index 17e3687..e70d1b6 100644 --- a/include/anna/core/util/Average.hpp +++ b/include/anna/core/util/Average.hpp @@ -35,45 +35,45 @@ public: Devuelve el indicador de validez de esta media. \return \em true Si la media no tiene ningun valor o \em false en caso contrario. */ - bool isEmpty() const throw() { return (a_n == 0); } + bool isEmpty() const { return (a_n == 0); } /** Devuelve \em true si el valor de la media es cero, bien por no tener valores o bien porque todos ellos eran cero. \return \em true el valor de la media es cero o \em false en otro caso. */ - bool isZero() const throw() { return a_n == 0 || a_accumulator == 0; } + bool isZero() const { return a_n == 0 || a_accumulator == 0; } /** Devuelve el numero de elementos de contiene la media. \return el numero de elementos de contiene la media. */ - int size() const throw() { return a_n; } + int size() const { return a_n; } /** Devuelve el valor acumulado. \return el valor acumulado. */ - T getAccumulator() const throw() { return a_accumulator; } + T getAccumulator() const { return a_accumulator; } /** Devuelve la media de la sucesion de valores numericos asociados a esta. \return La media de la sucesion de valores numericos asociados a esta. \warning Antes de invocar a este operador hay que verificar que #isEmpty devuelve \em false. */ - T value() const throw() { return (isEmpty() == true) ? T(0) : (a_accumulator / a_n); } + T value() const { return (isEmpty() == true) ? T(0) : (a_accumulator / a_n); } /** Inicializa el valor de la media. */ - void clear() throw() { a_accumulator = 0; a_n = 0; } + void clear() { a_accumulator = 0; a_n = 0; } /** * Establece manualmente el valor de la estadística. * \param value Valor que tomará el acumulador de este instancia. * \param _n valor que tomará el conteador de esta instancia. */ - void setValue(const T& value, const unsigned int _n) throw() { + void setValue(const T& value, const unsigned int _n) { a_accumulator = value; a_n = _n; } @@ -83,7 +83,7 @@ public: \return La media de la sucesion de valores numericos asociados a esta. \warning Antes de invocar a este operador hay que verificar que #isEmpty devuelve \em false. */ - operator T() const throw() { return value(); } + operator T() const { return value(); } /** Inicializa el valor de esta media. @@ -91,7 +91,7 @@ public: \return La referencia a esta instancia. */ Average& operator = (const T value) - throw() { + { a_accumulator = value; a_n = 1; return *this; @@ -103,7 +103,7 @@ public: \return La referencia a esta instancia. */ Average& operator = (const Average& other) - throw() { + { a_accumulator = other.a_accumulator; a_n = other.a_n; return *this; @@ -115,7 +115,7 @@ public: \return La referencia a esta instancia. */ Average& operator += (const T& v) - throw() { + { const T backup(a_accumulator); if((a_accumulator += v) < backup) { @@ -133,7 +133,7 @@ public: \return La referencia a esta instancia. */ Average& operator -= (const T v) - throw() { + { if(a_accumulator > v && a_n > 1) { a_accumulator -= v; a_n --; @@ -150,7 +150,7 @@ public: \return Una cadena con la informacion referente a esta clase. */ std::string asString() const - throw() { + { std::string msg(a_name); msg += " { Accumulate: "; msg += functions::asString(a_accumulator); diff --git a/include/anna/core/util/CommaSeparatedList.hpp b/include/anna/core/util/CommaSeparatedList.hpp index a92839e..5ebd5bb 100644 --- a/include/anna/core/util/CommaSeparatedList.hpp +++ b/include/anna/core/util/CommaSeparatedList.hpp @@ -79,7 +79,7 @@ public: \param t Parametro con el que ampliar la lista. \return La instancia de la lista destino. */ - CommaSeparatedList& operator, (T& t) throw() { a_parameters.push_back(&t); return *this; } + CommaSeparatedList& operator, (T& t) { a_parameters.push_back(&t); return *this; } /** Operador de asignacion. @@ -87,14 +87,14 @@ public: \param t Parametro con el que ampliar la lista. \return La instancia de la lista destino. */ - CommaSeparatedList& operator= (T& t) throw() { a_parameters.push_back(&t); return *this; } + CommaSeparatedList& operator= (T& t) { a_parameters.push_back(&t); return *this; } /** Operador de copia. \param rsh Lista de parametros a copiar. \return La instancia de la lista destino. */ - CommaSeparatedList& operator= (CommaSeparatedList& rsh) throw() { + CommaSeparatedList& operator= (CommaSeparatedList& rsh) { if(this != &rsh) a_parameters = rsh.parameters; @@ -104,43 +104,43 @@ public: /** Elimina el contenido actual de la lista de parametros. */ - void clear() throw() { a_parameters.clear(); } + void clear() { a_parameters.clear(); } /** Devuelve un iterator al primer parametro de la lista. \return Un iterator al primer parametro de la lista. */ - iterator begin() throw() { return a_parameters.begin(); } + iterator begin() { return a_parameters.begin(); } /** Devuelve un iterator al primer parametro de la lista. \return Un iterator al primer parametro de la lista. */ - const_iterator begin() const throw() { return a_parameters.begin(); } + const_iterator begin() const { return a_parameters.begin(); } /** Devuelve un iterator al ultimo parametro de la lista. \return Un iterator al ultimo parametro de la lista. */ - iterator end() throw() { return a_parameters.end(); } + iterator end() { return a_parameters.end(); } /** Devuelve un iterator al ultimo parametro de la lista. \return Un iterator al ultimo parametro de la lista. */ - const_iterator end() const throw() { return a_parameters.end(); } + const_iterator end() const { return a_parameters.end(); } /** Devuelve el puntero sobre el que esta posicionado el iterador recibido como parametro. \return El puntero sobre el que esta posicionado el iterador recibido como parametro. */ - static T* data(iterator& ii) throw() { return *ii; } + static T* data(iterator& ii) { return *ii; } /** Devuelve el puntero sobre el que esta posicionado el iterador recibido como parametro. \return El puntero sobre el que esta posicionado el iterador recibido como parametro. */ - static const T* data(const_iterator& ii) throw() { return *ii; } + static const T* data(const_iterator& ii) { return *ii; } private: std::vector a_parameters; diff --git a/include/anna/core/util/CommandLine.hpp b/include/anna/core/util/CommandLine.hpp index 6cd4c78..664fee0 100644 --- a/include/anna/core/util/CommandLine.hpp +++ b/include/anna/core/util/CommandLine.hpp @@ -33,7 +33,7 @@ class Node; class CommandLine : public Singleton { /* returns first no-leading hyphen position; -1 is error */ - static int removeLeadingHyphens(std::string &argv) throw(); + static int removeLeadingHyphens(std::string &argv) ; public: /** @@ -47,12 +47,12 @@ public: @return la lista de cadenas indicadas en la linea de comandos al ejecutar este programa. Mientras que no invoquemos al metodo #initialize devolvera NULL. */ - const char** getArgv() const throw() { return a_argv; } + const char** getArgv() const { return a_argv; } /** @return El numero de parametros indicados en la linea de comandos al ejecutar este programa. */ - int getArgc() const throw() { return a_argc; } + int getArgc() const { return a_argc; } // // Metodos @@ -70,7 +70,7 @@ public: These positional arguments are mandatory, and the user could retrieve their values through #getPositional. By default no positional arguments are specified. */ - void initialize(const char** argv, const int argc, int positionalArguments = 0) throw(RuntimeException); + void initialize(const char** argv, const int argc, int positionalArguments = 0) noexcept(false); /** Register an argument name in our application @@ -82,7 +82,7 @@ public: @param comment Argument explanation. @param needValue If our argument has an additional associated value, this will be true. False in other case (flags). */ - void add(const char* argumentExpression, Argument::Type type, const char* comment, const bool needValue = true) throw(); + void add(const char* argumentExpression, Argument::Type type, const char* comment, const bool needValue = true) ; /** Gets a positional argument. There must be registered or NULL will be returned. @@ -91,7 +91,7 @@ public: @return Value of mandatory positional argument with position provided */ - const char *getPositional(int position) const throw() { + const char *getPositional(int position) const { const char *result = NULL; if ((position > 0) && (position <= a_positionalArguments)) result = a_argv[position]; return result; @@ -111,7 +111,7 @@ public: @return Valor asociadoal argumento recibido como parametro. Puede ser NULL. */ - const char* getValue(const char* argumentExpression, const bool exitOnFault = true) throw(); + const char* getValue(const char* argumentExpression, const bool exitOnFault = true) ; /** Obtiene el valor asociado al argumento recibido, pero convirtiendo a @@ -121,7 +121,7 @@ public: @return Valor numerico del valor devuelto por #getValue. */ - int getIntegerValue(const char* argumentExpression) throw() { return atoi(getValue(argumentExpression)); } + int getIntegerValue(const char* argumentExpression) { return atoi(getValue(argumentExpression)); } /** Comprueba si el argumento recibido como parametro estña presente en la linea de @@ -131,7 +131,7 @@ public: @return true si el argumento esta en la linea de comandos y false en otro caso. */ - bool exists(const char* argumentExpression) throw() { return (getValue(argumentExpression, false) != NULL) ? true : false; } + bool exists(const char* argumentExpression) { return (getValue(argumentExpression, false) != NULL) ? true : false; } /** Comprueba la linea de comandos del programa para verificar que coincide con los argumentos @@ -146,21 +146,21 @@ public: Si hay algun fallo en la linea de comandos establecida al ejecutar el programa visualiza un resumen con los parametros soportados y la ejecucion del programa finaliza. */ - void verify() throw(RuntimeException); + void verify() noexcept(false); /** Class string representation \return String with relevant information for this instance. */ - std::string asString() const throw(); + std::string asString() const ; /** Class xml representation \param parent Parent XML node on which hold this instance information. \return XML document with relevant information for this instance. */ - xml::Node* asXML(xml::Node* parent) const throw(); + xml::Node* asXML(xml::Node* parent) const ; private: @@ -175,21 +175,21 @@ private: virtual ~Variable() { if(a_value) free(a_value); } // Accesores - const std::string& getName1() const throw() { return a_name1; } - const std::string& getName2() const throw() { return a_name2; } - std::string getHelpExpression() const throw(); - const char* getValue() const throw() { return a_value; } - const char* getComment() const throw() { return a_comment; } - bool getNeedValue() const throw() { return a_needValue; } - bool getIsOn() const throw() { return a_isOn; } - Argument::Type getType() const throw() { return a_type; } + const std::string& getName1() const { return a_name1; } + const std::string& getName2() const { return a_name2; } + std::string getHelpExpression() const ; + const char* getValue() const { return a_value; } + const char* getComment() const { return a_comment; } + bool getNeedValue() const { return a_needValue; } + bool getIsOn() const { return a_isOn; } + Argument::Type getType() const { return a_type; } // Modificadores - void setValue(const char* value) throw() { a_value = (value == NULL) ? NULL : strdup(value); } - void setIsOn(const bool isOn) throw() { a_isOn = isOn; } + void setValue(const char* value) { a_value = (value == NULL) ? NULL : strdup(value); } + void setIsOn(const bool isOn) { a_isOn = isOn; } // Metodos - std::string asString() const throw(); + std::string asString() const ; protected: std::string a_name1, a_name2; @@ -208,9 +208,9 @@ private: CommandLine() : a_argv(NULL), a_argc(0), a_positionalArguments(0) {;} - bool analize() throw(); - const Variable* search(const char *argumentExpression) const throw(); - void printUsage() const throw(); + bool analize() ; + const Variable* search(const char *argumentExpression) const ; + void printUsage() const ; friend class Singleton ; }; diff --git a/include/anna/core/util/Component.hpp b/include/anna/core/util/Component.hpp index 6188f1c..6ac2e42 100644 --- a/include/anna/core/util/Component.hpp +++ b/include/anna/core/util/Component.hpp @@ -47,21 +47,21 @@ public: Gets the class name configured at constructor. \return The class name configured at constructor. */ - const char* getClassName() const throw() { return a_className.c_str(); } + const char* getClassName() const { return a_className.c_str(); } /** * Class string representation * * @return String with class content */ - virtual std::string asString(void) const throw(); + virtual std::string asString(void) const ; /** Class XML representation. \param parent XML node over which we will put instance information. \return XML documentcon with class content. */ - virtual anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); + virtual anna::xml::Node* asXML(anna::xml::Node* parent) const ; protected: diff --git a/include/anna/core/util/ComponentManager.hpp b/include/anna/core/util/ComponentManager.hpp index ea41911..7a77bba 100644 --- a/include/anna/core/util/ComponentManager.hpp +++ b/include/anna/core/util/ComponentManager.hpp @@ -34,14 +34,14 @@ public: Returns component instance for the class name provided, if not found. \return component instance for the class name provided, if not found. */ - Component* find(const char* className) throw(); + Component* find(const char* className) ; /** Class XML representation. \param parent XML node over which we will put instance information. \return XML documentcon with class content. */ - virtual xml::Node* asXML(xml::Node* parent) const throw(); + virtual xml::Node* asXML(xml::Node* parent) const ; private: @@ -55,8 +55,8 @@ private: // private destructor virtual ~ComponentManager() {}; - void attach(Component*) throw(RuntimeException); - void detach(Component*) throw(RuntimeException); + void attach(Component*) noexcept(false); + void detach(Component*) noexcept(false); friend class Singleton ; diff --git a/include/anna/core/util/Configuration.hpp b/include/anna/core/util/Configuration.hpp index 1e1cb7c..662d38b 100644 --- a/include/anna/core/util/Configuration.hpp +++ b/include/anna/core/util/Configuration.hpp @@ -44,7 +44,7 @@ public: @param configFile Ruta completa con el nombre del archivo de configuracion a cargar. Cualquier otro archivo procesado anteriormente con esta instancia se perdera. */ - void load(const char* configFile) throw(RuntimeException); + void load(const char* configFile) noexcept(false); /** Establece el valor por defecto para una determinada variable, es decir, en caso de que @@ -58,7 +58,7 @@ public: el archivo de configuracion cargado. */ void setDefaultValue(const char* sectionName, const char* variableName, const char* defaultValue) - throw(RuntimeException); + noexcept(false); /** Devuelve el valor asociada a la variable indicada. @@ -72,7 +72,7 @@ public: @return El valor asociado a la variable. Puede ser NULL. */ const char* getValue(const char* sectionName, const char* variableName, const bool strict = false) const - throw(RuntimeException); + noexcept(false); /** Devuelve el valor asociada a la variable indicada. @@ -85,7 +85,7 @@ public: @return El valor asociado a la variable. */ int getIntegerValue(const char* sectionName, const char* variableName, const bool strict = false) const - throw(RuntimeException); + noexcept(false); /** Devuelve el estado de existencia o no de la variable indicada. @@ -95,7 +95,7 @@ public: @return true si la variable existe, y false en otro caso. Solo deberia invocarse despues de invocar al metodo #load. */ - bool exists(const char* sectionName, const char* variableName) const throw(); + bool exists(const char* sectionName, const char* variableName) const ; /** Devuelve la cadena por la que podemos buscar el componente. @@ -125,16 +125,16 @@ private: Configuration(const Configuration& other); // No implementado - void initialize() throw(RuntimeException) {;} - void stop() throw() {;} + void initialize() noexcept(false) {;} + void stop() {;} - void removeAll() throw(); + void removeAll() ; bool processSection(const int nline, char* buffer, std::string& currentSection); - void processVariable(const int nline, char* buffer, const std::string& currentSection) throw(RuntimeException); - VariableEx* createVariable(const std::string& section, const char* variableName) throw(); - VariableEx* find(const std::string& section, const char* variableName) throw(); + void processVariable(const int nline, char* buffer, const std::string& currentSection) noexcept(false); + VariableEx* createVariable(const std::string& section, const char* variableName) ; + VariableEx* find(const std::string& section, const char* variableName) ; const VariableEx* find(const std::string& section, const char* variableName) const - throw() { + { return const_cast (this)->find(section, variableName); } diff --git a/include/anna/core/util/DelayMeter.hpp b/include/anna/core/util/DelayMeter.hpp index 295bd0c..752eb74 100644 --- a/include/anna/core/util/DelayMeter.hpp +++ b/include/anna/core/util/DelayMeter.hpp @@ -59,7 +59,7 @@ public: * \warning Elimina el punto de referencia temporal que puediera haberse establecido con #setTopReference. * \return El número de milisegundos transcurridos desde la última vez que inicializamos la cuenta de temporizacion. */ - void setControlPoint() throw() { + void setControlPoint() { a_timestamp = _TimeUnit::getTime(); clearTopReference(); } @@ -72,7 +72,7 @@ public: * * \param timestamp Valor de referencia a establecer. */ - void setControlPoint(const _TimeUnit& timestamp) throw() { + void setControlPoint(const _TimeUnit& timestamp) { a_timestamp = timestamp; clearTopReference(); } @@ -89,17 +89,17 @@ public: * la marca de tiempo) y el núcleo y demás partes pueden tener conocimiento de que * esa tarea ha sido finalidad. */ - void setTopReference(const _TimeUnit& topReference) throw() { a_topReference = topReference; } + void setTopReference(const _TimeUnit& topReference) { a_topReference = topReference; } /** * Elimina el punto de referencia temporal. */ - void clearTopReference() throw() { a_topReference = _TimeUnit(0); } + void clearTopReference() { a_topReference = _TimeUnit(0); } /** * Inicializa el valor del punto de referencia. */ - void clear() throw() { a_timestamp = 0; } + void clear() { a_timestamp = 0; } /** * Devuelve el número de milisegundos transcurridos desde la última vez que inicializamos la cuenta de temporización. @@ -109,7 +109,7 @@ public: * \return El número de milisegundos transcurridos desde la última vez que inicializamos la cuenta de temporizacion. * \warning Si detecta algun fallo devolvera 0. */ - _TimeUnit getValue() const throw() { + _TimeUnit getValue() const { a_now = (a_topReference == _TimeUnit(0)) ? _TimeUnit::getTime() : a_topReference; return (a_now > a_timestamp) ? (a_now - a_timestamp) : _TimeUnit(0); } @@ -123,7 +123,7 @@ public: * \return El número de milisegundos transcurridos desde la última vez que inicializamos la cuenta de temporizacion. * \warning Si detecta algun fallo devolvera 0. */ - _TimeUnit getValue(const _TimeUnit& now) const throw() { + _TimeUnit getValue(const _TimeUnit& now) const { return ((a_now = now) > a_timestamp) ? (a_now - a_timestamp) : _TimeUnit(0); } @@ -131,40 +131,40 @@ public: * Devuelve el tiempo que se usó como referencia al calcular el retardo en #getValue * \return El tiempo que se usó como referencia al calcular el retardo en #getValue */ - const _TimeUnit& getNow() const throw() { return a_now; } + const _TimeUnit& getNow() const { return a_now; } /** * Operador copia. * \param other Instancia de la que copiar. */ - DelayMeter& operator= (const DelayMeter& other) throw() { a_timestamp = other.a_timestamp; a_topReference = other.a_topReference; return *this; } + DelayMeter& operator= (const DelayMeter& other) { a_timestamp = other.a_timestamp; a_topReference = other.a_topReference; return *this; } /** * Compara el retardo acumulado por esta instancia con el valor recibido. * \param left Valor numérico con el comparar. * \return \em true si el retardo acumulado es mayor que el parámetro recibido o \em false en otro caso. */ - bool operator> (const _TimeUnit& left) const throw() { return getValue() > left; } + bool operator> (const _TimeUnit& left) const { return getValue() > left; } /** * Compara el retardo acumulado por esta instancia con el valor recibido. * \param left Valor numérico con el comparar. * \return \em true si el retardo acumulado es mayor que el parámetro recibido o \em false en otro caso. */ - bool operator< (const _TimeUnit& left) const throw() { return getValue() < left; } + bool operator< (const _TimeUnit& left) const { return getValue() < left; } /** * Devuelve la cadena que muestra el tiempo medido por esta instancia. * \return la cadena que muestra el tiempo medido por esta instancia. */ - std::string asString() const throw() { return getValue().asString(); } + std::string asString() const { return getValue().asString(); } /** * Devuelve la cadena de depuración de esta instancia. * \param whatis Texto con el nombre lógico de esta instancia. * \return la cadena de depuración de esta instancia. */ - std::string asDebugString(const char* whatis) const throw() { + std::string asDebugString(const char* whatis) const { std::string result(whatis); result += " { TopReference: "; result += a_topReference.asString(); diff --git a/include/anna/core/util/EncodedData.hpp b/include/anna/core/util/EncodedData.hpp index 0682407..4a4296c 100644 --- a/include/anna/core/util/EncodedData.hpp +++ b/include/anna/core/util/EncodedData.hpp @@ -38,7 +38,7 @@ public: \param document Documento XML que contiene la informacion con la inicializar esta clase. Deberia haber sido obtenido mediate #asXML. */ - void initialize(const xml::Node* document) throw(RuntimeException); + void initialize(const xml::Node* document) noexcept(false); /** Devuelve un documento XML con la informacion necesaria para reproducir el contenido de esta @@ -46,7 +46,7 @@ public: \param parent Nodo XML del que dependende la informacion. \return Nodo XML que en el que podemos aplicar informacion. */ - xml::Node* asXML(xml::Node* parent) const throw(RuntimeException); + xml::Node* asXML(xml::Node* parent) const noexcept(false); private: DES_key_schedule a_skey [3]; @@ -56,8 +56,8 @@ private: EncodedData(const EncodedData&); - static const std::string& asBCD(const DataBlock&, std::string&) throw(); - static int fromBCD(const std::string&, DataBlock&) throw(); + static const std::string& asBCD(const DataBlock&, std::string&) ; + static int fromBCD(const std::string&, DataBlock&) ; friend class Encoder; }; diff --git a/include/anna/core/util/Encoder.hpp b/include/anna/core/util/Encoder.hpp index 73ca0ef..069b8f2 100644 --- a/include/anna/core/util/Encoder.hpp +++ b/include/anna/core/util/Encoder.hpp @@ -36,7 +36,7 @@ public: \return Una representacion del texto codificado. \warning El texto codificado incluye el caracter cero, indicador de fin de cadena. */ - const EncodedData& encode(const char* text) throw(RuntimeException) { + const EncodedData& encode(const char* text) noexcept(false) { DataBlock aux(text, anna_strlen(text) + 1, false); return encode(aux); } @@ -47,7 +47,7 @@ public: \return Una representacion del texto codificado. \warning El texto codificado incluye el caracter cero, indicador de fin de cadena. */ - const EncodedData& encode(const std::string& text) throw(RuntimeException) { + const EncodedData& encode(const std::string& text) noexcept(false) { return encode(text.c_str()); } @@ -56,7 +56,7 @@ public: \param data Bloque de memoria a codificar. \return Una representacion del bloque de memoria codificado. */ - const EncodedData& encode(const DataBlock& data) throw(RuntimeException); + const EncodedData& encode(const DataBlock& data) noexcept(false); /** Deodifica la representacion de codificacion recibida como parametro. @@ -66,17 +66,17 @@ public: \warning Si la representacion corresponde a la codificacion de una cadena con anna::DataBlock::getData obtendremos el contenido original de la cadena. */ - const DataBlock& decode(const EncodedData& data) throw(RuntimeException); + const DataBlock& decode(const EncodedData& data) noexcept(false); /** Metodo que debe ser invocado al menos una vez. */ - static void initialize() throw(); + static void initialize() ; private: EncodedData a_data; - DataBlock& setDataBlock(const DataBlock& other) throw(RuntimeException); + DataBlock& setDataBlock(const DataBlock& other) noexcept(false); }; diff --git a/include/anna/core/util/Environment.hpp b/include/anna/core/util/Environment.hpp index f236a3e..32f4282 100644 --- a/include/anna/core/util/Environment.hpp +++ b/include/anna/core/util/Environment.hpp @@ -34,7 +34,7 @@ public: @param envp Environment array passed on main function as third argument. Cache data is cleared if NULL passed, allowing to get current environment values for variables. */ - void initialize(char **envp = NULL) throw(); + void initialize(char **envp = NULL) ; /** Return associated value (could be empty). This value could be cached at initialization (envp array from main function), if not, would be @@ -45,8 +45,8 @@ public: @return Environment value. */ - std::string getValue(const char* variableName, bool exceptionIfMissing = false) throw(RuntimeException); - std::string getValue(const std::string &variableName, bool exceptionIfMissing = false) throw(RuntimeException); + std::string getValue(const char* variableName, bool exceptionIfMissing = false) noexcept(false); + std::string getValue(const std::string &variableName, bool exceptionIfMissing = false) noexcept(false); /** Sets an environment variable. If an empty variable name is provided, or environment set operation fails, @@ -56,7 +56,7 @@ public: @param value Variable value @param overwrite Overwrite an existing variable name/value or keep old value if exists */ - void setVariable(const std::string &name, const std::string &value, bool overwrite = true) throw(RuntimeException); + void setVariable(const std::string &name, const std::string &value, bool overwrite = true) noexcept(false); /** Unsets an environment variable (different than set empty string). If an empty variable name is provided, @@ -64,7 +64,7 @@ public: @param name Variable name. If empty, nothing is done. */ - void unsetVariable(const std::string &name) throw(RuntimeException); + void unsetVariable(const std::string &name) noexcept(false); private: diff --git a/include/anna/core/util/EqualTo.hpp b/include/anna/core/util/EqualTo.hpp index 7218007..2f3f22d 100644 --- a/include/anna/core/util/EqualTo.hpp +++ b/include/anna/core/util/EqualTo.hpp @@ -26,8 +26,8 @@ template class EqualTo { public: EqualTo(const K key) : a_key(key) {;} EqualTo(const EqualTo& other) : a_key(other.a_key) {;} - bool operator()(T* t) const throw() { return *t == a_key; } - bool operator()(const T* t) const throw() { return *t == a_key; } + bool operator()(T* t) const { return *t == a_key; } + bool operator()(const T* t) const { return *t == a_key; } private: const K a_key; diff --git a/include/anna/core/util/ExclusiveHash.hpp b/include/anna/core/util/ExclusiveHash.hpp index 5b05e1d..3322b3d 100644 --- a/include/anna/core/util/ExclusiveHash.hpp +++ b/include/anna/core/util/ExclusiveHash.hpp @@ -35,7 +35,7 @@ public: \param t Instancia a la que vamos a calcular un valor numerico. */ _K calcule(const T& t) - throw() { + { typename container::iterator ii; _K result = 0; diff --git a/include/anna/core/util/LRUMap.hpp b/include/anna/core/util/LRUMap.hpp index 74d9f49..bc5141e 100644 --- a/include/anna/core/util/LRUMap.hpp +++ b/include/anna/core/util/LRUMap.hpp @@ -53,13 +53,13 @@ public: Devuelve el indicador de validez de esta media. \return \em true Si la media no tiene ningun valor o \em false en caso contrario. */ - bool isEmpty() const throw() { return a_container.size() == 0; } + bool isEmpty() const { return a_container.size() == 0; } /** * Devuelve el número de elementos contenidos en este contenedor. * \return el número de elementos contenidos en este contenedor. */ - int size() const throw() { return a_container.size(); } + int size() const { return a_container.size(); } /** * Devuelve el puntero al valor asociado a la clave recibida como parámetro. @@ -69,7 +69,7 @@ public: * * \return El puntero al valor asociado a la clave recibida como parámetro. * */ - V* find(const K& key) throw() { + V* find(const K& key) { iterator ii = a_container.find(key); if(ii == end()) @@ -89,7 +89,7 @@ public: * \param key Clave de la pareja (K,V). * \param v Valor asociado a la clave. */ - void add(const K& key, const V& v) throw() { + void add(const K& key, const V& v) { iterator ii = a_container.find(key); // Sobreescribe el valor asociado a K y actualiza su tiempo de acceso. @@ -128,35 +128,35 @@ public: /** Vacía este contenedor. */ - void clear() throw() { a_container.clear(); } + void clear() { a_container.clear(); } /** * Devuelve un iterator al primer elemento del contenedor, teniendo que la ordenación de los * pares (K,V) se hará en base a K. * \return El primer elemento del contenedor. */ - iterator begin() throw() { return a_container.begin(); } + iterator begin() { return a_container.begin(); } /** * Devuelve un iterator al primer elemento del contenedor, teniendo que la ordenación de los * pares (K,V) se hará en base a K. * \return El primer elemento del contenedor. */ - const_iterator begin() const throw() { return a_container.begin(); } + const_iterator begin() const { return a_container.begin(); } /** * Devuelve un iterator al final del contenedor, teniendo que la ordenación de los pares (K,V) se hará en * base a K. * \return El primer elemento del contenedor. */ - iterator end() throw() { return a_container.end(); } + iterator end() { return a_container.end(); } /** * Devuelve un iterator al final del contenedor, teniendo que la ordenación de los pares (K,V) se hará en * base a K. * \return El primer elemento del contenedor. */ - const_iterator end() const throw() { return a_container.end(); } + const_iterator end() const { return a_container.end(); } /** * Devuelve la clave asociada al iterador recibido como parámetro. @@ -164,7 +164,7 @@ public: * \return la clave asociada al iterador recibido como parámetro. * \warning Los acceso mediante iterador no actualiza el tiempo de acceso a la pareja (K,V). */ - static K key(iterator& ii) throw() { return ii->first; } + static K key(iterator& ii) { return ii->first; } /** * Devuelve el valor asociado al iterador recibido como parámetro. @@ -172,7 +172,7 @@ public: * \return el valor asociado al iterador recibido como parámetro. * \warning Los acceso mediante iterador no actualiza el tiempo de acceso a la pareja (K,V). */ - static V& value(iterator& ii) throw() { + static V& value(iterator& ii) { timed_value* v = &ii->second; return v->first; } @@ -182,7 +182,7 @@ public: * \param ii Iterador que debe estar comprendido entre [#begin (), #end). * \return el tiempo de acceso asociado al iterador recibido como parámetro. */ - static Millisecond& millisecond(iterator& ii) throw() { + static Millisecond& millisecond(iterator& ii) { timed_value* v = &ii->second; return v->second; } @@ -193,7 +193,7 @@ public: * \return la clave asociada al iterador recibido como parámetro. * \warning Los acceso mediante iterador no actualiza el tiempo de acceso a la pareja (K,V). */ - static K key(const_iterator& ii) throw() { return ii->first; } + static K key(const_iterator& ii) { return ii->first; } /** * Devuelve el valor asociado al iterador recibido como parámetro. @@ -201,7 +201,7 @@ public: * \return el valor asociado al iterador recibido como parámetro. * \warning Los acceso mediante iterador no actualiza el tiempo de acceso a la pareja (K,V). */ - static const V& value(const_iterator& ii) throw() { + static const V& value(const_iterator& ii) { const timed_value* v = &ii->second; return v->first; } @@ -211,7 +211,7 @@ public: * \param ii Iterador que debe estar comprendido entre [#begin (), #end). * \return el tiempo de acceso asociado al iterador recibido como parámetro. */ - static Millisecond millisecond(const_iterator& ii) throw() { + static Millisecond millisecond(const_iterator& ii) { const timed_value* v = &ii->second; return v->second; } @@ -221,7 +221,7 @@ public: \return Una cadena con la informacion referente a esta clase. */ std::string asString() const - throw() { + { std::string msg("LRUMap { Name: "); msg += a_name; msg += functions::asText(" | N: ", a_maxSize); diff --git a/include/anna/core/util/Microsecond.hpp b/include/anna/core/util/Microsecond.hpp index fab7027..7e7d45a 100644 --- a/include/anna/core/util/Microsecond.hpp +++ b/include/anna/core/util/Microsecond.hpp @@ -56,82 +56,82 @@ public: * Conversor a numérico. * \return El valor asociado a esta instancia. */ - operator type_t () const throw() { return a_value; } + operator type_t () const { return a_value; } /** * \internal */ - type_t& refValue() throw() { return a_value; } + type_t& refValue() { return a_value; } - Microsecond& operator= (const Microsecond& other) throw() { a_value = other.a_value; return *this; } + Microsecond& operator= (const Microsecond& other) { a_value = other.a_value; return *this; } - Microsecond& operator= (const Millisecond& other) throw(); + Microsecond& operator= (const Millisecond& other) ; - Microsecond& operator= (const Second& other) throw(); + Microsecond& operator= (const Second& other) ; - bool operator== (const Microsecond& other) const throw() { return a_value == other.a_value; } + bool operator== (const Microsecond& other) const { return a_value == other.a_value; } - bool operator== (const Millisecond& other) const throw(); + bool operator== (const Millisecond& other) const ; - bool operator== (const Second& other) const throw(); + bool operator== (const Second& other) const ; - bool operator!= (const Microsecond& other) const throw() { return a_value != other.a_value; } + bool operator!= (const Microsecond& other) const { return a_value != other.a_value; } - bool operator!= (const Millisecond& other) const throw(); + bool operator!= (const Millisecond& other) const ; - bool operator!= (const Second& other) const throw(); + bool operator!= (const Second& other) const ; - bool operator> (const Microsecond& other) const throw() { return a_value > other.a_value; } + bool operator> (const Microsecond& other) const { return a_value > other.a_value; } - bool operator> (const Millisecond& other) const throw(); + bool operator> (const Millisecond& other) const ; - bool operator> (const Second& other) const throw(); + bool operator> (const Second& other) const ; - bool operator< (const Microsecond& other) const throw() { return a_value < other.a_value; } + bool operator< (const Microsecond& other) const { return a_value < other.a_value; } - bool operator< (const Millisecond& other) const throw(); + bool operator< (const Millisecond& other) const ; - bool operator< (const Second& other) const throw(); + bool operator< (const Second& other) const ; - bool operator>= (const Microsecond& other) const throw() { return a_value >= other.a_value; } + bool operator>= (const Microsecond& other) const { return a_value >= other.a_value; } - bool operator>= (const Millisecond& other) const throw() { return (operator==(other) == true) ? true : operator>(other); } + bool operator>= (const Millisecond& other) const { return (operator==(other) == true) ? true : operator>(other); } - bool operator>= (const Second& other) const throw() { return (operator==(other) == true) ? true : operator>(other); } + bool operator>= (const Second& other) const { return (operator==(other) == true) ? true : operator>(other); } - bool operator<= (const Microsecond& other) const throw() { return a_value <= other.a_value; } + bool operator<= (const Microsecond& other) const { return a_value <= other.a_value; } - bool operator<= (const Millisecond& other) const throw() { return (operator==(other) == true) ? true : operator<(other); } + bool operator<= (const Millisecond& other) const { return (operator==(other) == true) ? true : operator<(other); } - bool operator<= (const Second& other) const throw() { return (operator==(other) == true) ? true : operator<(other); } + bool operator<= (const Second& other) const { return (operator==(other) == true) ? true : operator<(other); } - Microsecond& operator+= (const Microsecond& other) throw() { a_value += other.a_value; return *this; } - Microsecond& operator*= (const int& value) throw() { a_value *= value; return *this; } + Microsecond& operator+= (const Microsecond& other) { a_value += other.a_value; return *this; } + Microsecond& operator*= (const int& value) { a_value *= value; return *this; } /** * Devuelve el valor asociado a esta instancia. * \return el valor asociado a esta instancia. */ - type_t getValue() const throw() { return a_value; } + type_t getValue() const { return a_value; } /** * Devuelve la hora actual de sistema expresada en microsegundos transcurridos desde el 1 de Enero de 1970 * \return la hora actual de sistema expresada en microsegundos transcurridos desde el 1 de Enero de 1970 */ - static Microsecond getTime() throw(); + static Microsecond getTime() ; /** * Devuelve una cadena con el valor de esta instancia y las unidades "us". * \return una cadena con el valor de esta instancia y las unidades "us". */ - std::string asString() const throw(); + std::string asString() const ; /** * Obtiene los microsegundos del valor contenido en la cadena recibida como parámetro. * \param value Cadena que contiene los microsegundos habrá sido obtenida con #asString. * \return los microsegundos del valor contenido en la cadena recibida como parámetro. */ - static Microsecond fromString(const std::string& value) throw(RuntimeException); + static Microsecond fromString(const std::string& value) noexcept(false); private: type_t a_value; @@ -139,35 +139,35 @@ private: friend class Millisecond; friend class Second; - friend class Microsecond operator - (const Microsecond& left, const Microsecond& right) throw(); - friend class Microsecond operator + (const Microsecond& left, const Microsecond& right) throw(); - friend class Microsecond operator / (const Microsecond& left, const Microsecond& right) throw(); - friend class Microsecond operator / (const Microsecond& left, const int right) throw(); - friend class Microsecond operator / (const Microsecond& left, const unsigned int right) throw(); + friend class Microsecond operator - (const Microsecond& left, const Microsecond& right) ; + friend class Microsecond operator + (const Microsecond& left, const Microsecond& right) ; + friend class Microsecond operator / (const Microsecond& left, const Microsecond& right) ; + friend class Microsecond operator / (const Microsecond& left, const int right) ; + friend class Microsecond operator / (const Microsecond& left, const unsigned int right) ; }; inline Microsecond operator - (const Microsecond& left, const Microsecond& right) -throw() { +{ return Microsecond(left.a_value - right.a_value); } inline Microsecond operator + (const Microsecond& left, const Microsecond& right) -throw() { +{ return Microsecond(left.a_value + right.a_value); } inline Microsecond operator / (const Microsecond& left, const Microsecond& right) -throw() { +{ return Microsecond(left.a_value / right.a_value); } inline Microsecond operator / (const Microsecond& left, const int right) -throw() { +{ return Microsecond(left.a_value / right); } inline Microsecond operator / (const Microsecond& left, const unsigned int right) -throw() { +{ return Microsecond(left.a_value / right); } diff --git a/include/anna/core/util/Millisecond.hpp b/include/anna/core/util/Millisecond.hpp index ea4aaca..c9e60f0 100644 --- a/include/anna/core/util/Millisecond.hpp +++ b/include/anna/core/util/Millisecond.hpp @@ -58,66 +58,66 @@ public: * Conversor a numérico. * \return El valor asociado a esta instancia. */ - operator type_t () const throw() { return a_value; } + operator type_t () const { return a_value; } /** * \internal */ - type_t& refValue() throw() { return a_value; } + type_t& refValue() { return a_value; } - Millisecond& operator= (const type_t other) throw() { a_value = other; return *this; } + Millisecond& operator= (const type_t other) { a_value = other; return *this; } - Millisecond& operator= (const Millisecond& other) throw() { a_value = other.a_value; return *this; } + Millisecond& operator= (const Millisecond& other) { a_value = other.a_value; return *this; } - Millisecond& operator= (const Second& other) throw(); + Millisecond& operator= (const Second& other) ; - Millisecond& operator= (const Microsecond& other) throw(); + Millisecond& operator= (const Microsecond& other) ; - bool operator== (const Millisecond& other) const throw() { return a_value == other.a_value; } + bool operator== (const Millisecond& other) const { return a_value == other.a_value; } - bool operator== (const Second& other) const throw(); + bool operator== (const Second& other) const ; - bool operator== (const Microsecond& other) const throw(); + bool operator== (const Microsecond& other) const ; - bool operator!= (const Millisecond& other) const throw() { return a_value != other.a_value; } + bool operator!= (const Millisecond& other) const { return a_value != other.a_value; } - bool operator!= (const Second& other) const throw(); + bool operator!= (const Second& other) const ; - bool operator!= (const Microsecond& other) const throw(); + bool operator!= (const Microsecond& other) const ; - bool operator> (const Millisecond& other) const throw() { return a_value > other.a_value; } + bool operator> (const Millisecond& other) const { return a_value > other.a_value; } - bool operator> (const Second& other) const throw(); + bool operator> (const Second& other) const ; - bool operator> (const Microsecond& other) const throw(); + bool operator> (const Microsecond& other) const ; - bool operator< (const Millisecond& other) const throw() { return a_value < other.a_value; } + bool operator< (const Millisecond& other) const { return a_value < other.a_value; } - bool operator< (const Second& other) const throw(); + bool operator< (const Second& other) const ; - bool operator< (const Microsecond& other) const throw(); + bool operator< (const Microsecond& other) const ; - bool operator>= (const Millisecond& other) const throw() { return a_value >= other.a_value; } + bool operator>= (const Millisecond& other) const { return a_value >= other.a_value; } - bool operator>= (const Second& other) const throw() { return (operator==(other) == true) ? true : operator>(other); } + bool operator>= (const Second& other) const { return (operator==(other) == true) ? true : operator>(other); } - bool operator>= (const Microsecond& other) const throw() { return (operator==(other) == true) ? true : operator>(other); } + bool operator>= (const Microsecond& other) const { return (operator==(other) == true) ? true : operator>(other); } - bool operator<= (const Millisecond& other) const throw() { return a_value <= other.a_value; } + bool operator<= (const Millisecond& other) const { return a_value <= other.a_value; } - bool operator<= (const Second& other) const throw() { return (operator==(other) == true) ? true : operator<(other); } + bool operator<= (const Second& other) const { return (operator==(other) == true) ? true : operator<(other); } - bool operator<= (const Microsecond& other) const throw() { return (operator==(other) == true) ? true : operator<(other); } + bool operator<= (const Microsecond& other) const { return (operator==(other) == true) ? true : operator<(other); } - Millisecond& operator+= (const Millisecond& other) throw() { a_value += other.a_value; return *this; } + Millisecond& operator+= (const Millisecond& other) { a_value += other.a_value; return *this; } - Millisecond& operator-= (const Millisecond& other) throw() {(a_value > other.a_value) ? (a_value -= other.a_value) : (a_value = 0); return *this; } + Millisecond& operator-= (const Millisecond& other) {(a_value > other.a_value) ? (a_value -= other.a_value) : (a_value = 0); return *this; } /** * Devuelve el valor asociado a esta instancia. * \return el valor asociado a esta instancia. */ - type_t getValue() const throw() { return a_value; } + type_t getValue() const { return a_value; } /** * Si el valor de esta instancia es positivo devuelve el valor asociado a esta instancia en una estructura de @@ -126,26 +126,26 @@ public: * \return Si el valor de esta instancia es positivo devuelve el valor asociado a esta instancia en una estructura de * time \em timeval usada habitualmente para temporizar operaciones a nivel de SO, en otro caso retorna NULL. */ - timeval* getTimeVal(timeval& tv) const throw(); + timeval* getTimeVal(timeval& tv) const ; /** * Devuelve la hora actual de sistema expresada en milisegundos transcurridos desde el 1 de Enero de 1970 * \return la hora actual de sistema expresada en milisegundos transcurridos desde el 1 de Enero de 1970 */ - static Millisecond getTime() throw(); + static Millisecond getTime() ; /** * Devuelve una cadena con el valor de esta instancia y las unidades "ms". * \return una cadena con el valor de esta instancia y las unidades "ms". */ - std::string asString() const throw(); + std::string asString() const ; /** * Obtiene los microsegundos del valor contenido en la cadena recibida como parámetro. * \param value Cadena que contiene los microsegundos habrá sido obtenida con #asString. * \return los microsegundos del valor contenido en la cadena recibida como parámetro. */ - static Millisecond fromString(const std::string& value) throw(RuntimeException); + static Millisecond fromString(const std::string& value) noexcept(false); private: type_t a_value; @@ -153,41 +153,41 @@ private: friend class Second; friend class Microsecond; - friend class Millisecond operator / (const Millisecond& left, const Millisecond& right) throw(); - friend class Millisecond operator + (const Millisecond& left, const Millisecond& right) throw(); - friend class Millisecond operator - (const Millisecond& left, const Millisecond& right) throw(); - friend class Millisecond operator / (const Millisecond& left, const int right) throw(); - friend class Millisecond operator / (const Millisecond& left, const unsigned int right) throw(); - friend class Millisecond operator *(const Millisecond& left, const int right) throw(); + friend class Millisecond operator / (const Millisecond& left, const Millisecond& right) ; + friend class Millisecond operator + (const Millisecond& left, const Millisecond& right) ; + friend class Millisecond operator - (const Millisecond& left, const Millisecond& right) ; + friend class Millisecond operator / (const Millisecond& left, const int right) ; + friend class Millisecond operator / (const Millisecond& left, const unsigned int right) ; + friend class Millisecond operator *(const Millisecond& left, const int right) ; }; inline Millisecond operator / (const Millisecond& left, const Millisecond& right) -throw() { +{ return Millisecond(left.a_value / right.a_value); } inline Millisecond operator + (const Millisecond& left, const Millisecond& right) -throw() { +{ return Millisecond(left.a_value + right.a_value); } inline Millisecond operator - (const Millisecond& left, const Millisecond& right) -throw() { +{ return Millisecond(left.a_value - right.a_value); } inline Millisecond operator / (const Millisecond& left, const int right) -throw() { +{ return Millisecond(left.a_value / right); } inline Millisecond operator / (const Millisecond& left, const unsigned int right) -throw() { +{ return Millisecond(left.a_value / right); } inline Millisecond operator *(const Millisecond& left, const int right) -throw() { +{ return Millisecond(left.a_value * right); } diff --git a/include/anna/core/util/MultiMap.hpp b/include/anna/core/util/MultiMap.hpp index a480ee2..5fbd80e 100644 --- a/include/anna/core/util/MultiMap.hpp +++ b/include/anna/core/util/MultiMap.hpp @@ -32,14 +32,14 @@ namespace anna { */ template < typename T, typename SortBy, typename TKey = int > class MultiMap : public std::vector { struct LessT : public std::binary_function { - bool operator()(const T* first, const T* second) const throw() { + bool operator()(const T* first, const T* second) const { return SortBy::value(first) < SortBy::value(second); } }; // El orden de los operandos está impuesto por cómo se invoca al operator() desde stl_algo.h (2685). struct LessKey : public std::binary_function { - bool operator()(const T* _vv, const TKey& searched) const throw() { + bool operator()(const T* _vv, const TKey& searched) const { return SortBy::value(_vv) < searched; } }; @@ -72,7 +72,7 @@ public: \return \em true si ha registrado la nueva instancia o \em false en otro caso. */ bool add(T* _vv) - throw(RuntimeException) { + noexcept(false) { if(_vv == NULL) return false; @@ -94,12 +94,12 @@ public: \return \em true si la instancia recibida como parametro esta contenido en el map o \em en otro caso. */ - bool contains(const T* _vv) const throw() { return (_vv == NULL) ? false : (find(SortBy::value(_vv)) != NULL); } + bool contains(const T* _vv) const { return (_vv == NULL) ? false : (find(SortBy::value(_vv)) != NULL); } /** * Borra las entradas contenidas en el vector ordenado y libera la memoria asociada a las mismas. */ - void clearAndDestroy() throw() { + void clearAndDestroy() { for(iterator ii = this->begin(), maxii = this->end(); ii != maxii; ii ++) delete data(ii); @@ -112,7 +112,7 @@ public: \return La instancia correspondiente a la entrada borrada o NULL si no se encontró ninguna entrada válida. */ T* erase(const T* _vv) - throw(RuntimeException) { + noexcept(false) { if(_vv == NULL) return NULL; @@ -137,7 +137,7 @@ public: * \return La nueva posición a la que debería pasar el iterador una vez borrada la entrada. * */ - iterator erase_iterator(iterator ii) throw() { return container::erase(ii); } + iterator erase_iterator(iterator ii) { return container::erase(ii); } /** Devuelve la instancia asociada a la clave recibida como parametro o NULL si no existe. @@ -145,7 +145,7 @@ public: \return la instancia asociada a la clave recibida como parametro o NULL si no existe. */ T* find(const TKey& key) - throw() { + { iterator maxii = this->end(); iterator ii = lower_bound(this->begin(), maxii, key, a_lessKey); @@ -161,7 +161,7 @@ public: * \return el iterador a la instancia asociada a la clave recibida. */ iterator find_iterator(const TKey& key) - throw() { + { return lower_bound(this->begin(), this->end(), key, a_lessKey); } @@ -170,7 +170,7 @@ public: \param key Clave a buscar en el map. \return la instancia asociada a la clave recibida como parametro o NULL si no existe. */ - const T* find(const TKey& key) const throw() { + const T* find(const TKey& key) const { return const_cast *>(this)->find(key); } @@ -178,13 +178,13 @@ public: Devuelve el objeto referenciado por el iterador. \return El objeto referenciado por el iterador. */ - static T* data(iterator ii) throw() { return *ii; } + static T* data(iterator ii) { return *ii; } /** Devuelve el objeto referenciado por el iterador. \return El objeto referenciado por el iterador. */ - static const T* data(const_iterator ii) throw() { return *ii; } + static const T* data(const_iterator ii) { return *ii; } private: LessT a_lessT; diff --git a/include/anna/core/util/MultiRangeExpression.hpp b/include/anna/core/util/MultiRangeExpression.hpp index d79f02e..aa03b8b 100644 --- a/include/anna/core/util/MultiRangeExpression.hpp +++ b/include/anna/core/util/MultiRangeExpression.hpp @@ -26,7 +26,7 @@ class MultiRangeExpression { std::map < unsigned int, int/*dummy*/ > a_data; // expands literal - void refresh(void) throw(); // keep coherence between 'a_data' and 'a_literal' + void refresh(void) ; // keep coherence between 'a_data' and 'a_literal' public: @@ -40,21 +40,21 @@ public: * * @return Literal */ - const char * getLiteral(void) const throw() { return a_literal.c_str(); } + const char * getLiteral(void) const { return a_literal.c_str(); } /** * Gets expanded representation for stored literal. E.g.: '1-3,8,10' => '1,2,3,7,8,10' * * @return Expanded literal */ - std::string getExpandedLiteral(void) const throw(); + std::string getExpandedLiteral(void) const ; /** * Simplify stored literal. E.g.: '1,1,1,2,3,7,8,10' => '1-3,8,10' and returns it. * * @return Simplified literal */ - const char * simplifyLiteral(void) throw(); + const char * simplifyLiteral(void) ; // helpers @@ -64,7 +64,7 @@ public: * @param value Value to be tested * @return True or false */ - bool contain(const unsigned int & value) const throw() { return (a_data.find(value) != a_data.end()); } + bool contain(const unsigned int & value) const { return (a_data.find(value) != a_data.end()); } // setters @@ -73,7 +73,7 @@ public: * * @param l Literal to be stored */ - void setLiteral(const char * l) throw() { + void setLiteral(const char * l) { a_literal = l ? l : ""; refresh(); } @@ -84,7 +84,7 @@ public: * * @param l Literal to be added */ - void addLiteral(const char * l) throw() { + void addLiteral(const char * l) { if(!l) return; if(std::string(l) != "") { diff --git a/include/anna/core/util/Recycler.hpp b/include/anna/core/util/Recycler.hpp index 5d374c6..ce81533 100644 --- a/include/anna/core/util/Recycler.hpp +++ b/include/anna/core/util/Recycler.hpp @@ -68,13 +68,13 @@ public: Devuelve el número de elementos realmente utilizados hasta ahora. @return El número de elementos realmente utilizados hasta ahora. */ - int getSize() const throw() { return a_size; } + int getSize() const { return a_size; } /** Devuelve el número de elementos realmente utilizados hasta ahora. @return El número de elementos realmente utilizados hasta ahora. */ - int size() const throw() { return a_size; } + int size() const { return a_size; } /** Devuelve un puntero de tipo T. Solo crearia una nueva instancia de la clase T si al invocar a este @@ -86,7 +86,7 @@ public: @return Un puntero a una instancia de tipo T. */ T* create() - throw(RuntimeException) { + noexcept(false) { T* result = NULL; if(a_holes.empty() == false) { @@ -112,7 +112,7 @@ public: \return el iterador que apunta al objeto recibido como parametro. */ iterator find(T* t) - throw(RuntimeException) { + noexcept(false) { iterator result = end(); if(a_randomContainer != NULL) { @@ -142,7 +142,7 @@ public: @param t Instancia de un puntero de tipo T obtenido a partir del metodo #create. */ void release(T* t) - throw() { + { if(t == NULL) return; @@ -177,7 +177,7 @@ public: Libera el puntero asociado al iterador recibido como parametro. \param ii Instancia a liberar. */ - void release(iterator ii) throw() { release(data(ii)); } + void release(iterator ii) { release(data(ii)); } /** Libera el puntero recibido como parametro. No se libera fisicamente sino que se deja marcado como @@ -188,13 +188,13 @@ public: @param t Instancia de un puntero de tipo T obtenido a partir del metodo #create. */ - void release(const T* t) throw() { release(const_cast (t)); } + void release(const T* t) { release(const_cast (t)); } /** Marca como disponibles todos los objetos contenidos en memoria. */ void clear() - throw() { + { a_holes.splice(a_holes.end(), a_objects); a_size = 0; @@ -206,37 +206,37 @@ public: Devuelve un iterator al primer elemento, activo, contenido en el reciclador. \return Un iterator al primer elemento, activo, contenido en el reciclador. */ - iterator begin() throw() { return a_objects.begin(); } + iterator begin() { return a_objects.begin(); } /** Devuelve un iterator al primer elemento, activo, contenido en el reciclador. \return Un iterator al primer elemento, activo, contenido en el reciclador. */ - const_iterator begin() const throw() { return a_objects.begin(); } + const_iterator begin() const { return a_objects.begin(); } /** Devuelve un iterator al final de la lista de elementos activos en el reciclador. \return Un iterator al final de la lista de elementos activos en el reciclador. */ - iterator end() throw() { return a_objects.end(); } + iterator end() { return a_objects.end(); } /** Devuelve un iterator al final de la lista de elementos activos en el reciclador. \return Un iterator al final de la lista de elementos activos en el reciclador. */ - const_iterator end() const throw() { return a_objects.end(); } + const_iterator end() const { return a_objects.end(); } /** Devuelve el objeto referenciado por el iterator recibido como parametro. \return El objeto referenciado por el iterator recibido como parametro. */ - static T* data(iterator ii) throw() { return *ii; } + static T* data(iterator ii) { return *ii; } /** Devuelve el objeto referenciado por el iterator recibido como parametro. \return El objeto referenciado por el iterator recibido como parametro. */ - static const T* data(const_iterator ii) throw() { return *ii; } + static const T* data(const_iterator ii) { return *ii; } private: container a_objects; @@ -247,8 +247,8 @@ private: // que nuestro size, debería ser O(1), por eso hay que llevar la cuenta "a mano". int a_size; -// static T* random_data (random_iterator ii) throw () { return ii->first; } - static iterator the_iterator(random_iterator ii) throw() { return ii->second; } +// static T* random_data (random_iterator ii) { return ii->first; } + static iterator the_iterator(random_iterator ii) { return ii->second; } }; } diff --git a/include/anna/core/util/RegularExpression.hpp b/include/anna/core/util/RegularExpression.hpp index ed0f170..276c624 100644 --- a/include/anna/core/util/RegularExpression.hpp +++ b/include/anna/core/util/RegularExpression.hpp @@ -32,8 +32,8 @@ class RegularExpression { regex_t a_preg; - void freeRegex() throw(); - void compile() throw(anna::RuntimeException); + void freeRegex() ; + void compile() noexcept(false); public: @@ -48,7 +48,7 @@ public: * * @param pattern Pattern */ - void setPattern(const std::string & pattern) throw(); + void setPattern(const std::string & pattern) ; // get @@ -58,7 +58,7 @@ public: * * @return Pattern */ - const std::string & getPattern(void) const throw() { return a_pattern; } + const std::string & getPattern(void) const { return a_pattern; } // helpers @@ -67,12 +67,12 @@ public: * * @return Boolean about if value provided match regular expression */ - bool isLike(const std::string & value) throw(); + bool isLike(const std::string & value) ; /** * Same as #isLike */ - bool match(const std::string & value) throw() { return isLike(value); } + bool match(const std::string & value) { return isLike(value); } /** * Operator == diff --git a/include/anna/core/util/Second.hpp b/include/anna/core/util/Second.hpp index b8614f1..7f7fde6 100644 --- a/include/anna/core/util/Second.hpp +++ b/include/anna/core/util/Second.hpp @@ -71,62 +71,62 @@ public: * Conversor a numérico. * \return El valor asociado a esta instancia. */ - operator type_t () const throw() { return a_value; } + operator type_t () const { return a_value; } /** * \internal */ - type_t& refValue() throw() { return a_value; } + type_t& refValue() { return a_value; } - Second& operator= (const type_t other) throw() { a_value = other; return *this; } + Second& operator= (const type_t other) { a_value = other; return *this; } - Second& operator= (const Second& other) throw() { a_value = other.a_value; return *this; } + Second& operator= (const Second& other) { a_value = other.a_value; return *this; } - Second& operator= (const Millisecond& other) throw(); + Second& operator= (const Millisecond& other) ; - Second& operator= (const Microsecond& other) throw(); + Second& operator= (const Microsecond& other) ; - bool operator== (const Second& other) const throw() { return a_value == other.a_value; } + bool operator== (const Second& other) const { return a_value == other.a_value; } - bool operator== (const Millisecond& other) const throw(); + bool operator== (const Millisecond& other) const ; - bool operator== (const Microsecond& other) const throw(); + bool operator== (const Microsecond& other) const ; - bool operator!= (const Second& other) const throw() { return a_value != other.a_value; } + bool operator!= (const Second& other) const { return a_value != other.a_value; } - bool operator!= (const Millisecond& other) const throw(); + bool operator!= (const Millisecond& other) const ; - bool operator!= (const Microsecond& other) const throw(); + bool operator!= (const Microsecond& other) const ; - bool operator> (const Second& other) const throw() { return a_value > other.a_value; } + bool operator> (const Second& other) const { return a_value > other.a_value; } - bool operator> (const Millisecond& other) const throw(); + bool operator> (const Millisecond& other) const ; - bool operator> (const Microsecond& other) const throw(); + bool operator> (const Microsecond& other) const ; - bool operator< (const Second& other) const throw() { return a_value < other.a_value; } + bool operator< (const Second& other) const { return a_value < other.a_value; } - bool operator< (const Millisecond& other) const throw(); + bool operator< (const Millisecond& other) const ; - bool operator< (const Microsecond& other) const throw(); + bool operator< (const Microsecond& other) const ; - bool operator>= (const Second& other) const throw() { return a_value >= other.a_value; } + bool operator>= (const Second& other) const { return a_value >= other.a_value; } - bool operator>= (const Millisecond& other) const throw() { return (operator==(other) == true) ? true : operator>(other); } + bool operator>= (const Millisecond& other) const { return (operator==(other) == true) ? true : operator>(other); } - bool operator>= (const Microsecond& other) const throw() { return (operator==(other) == true) ? true : operator>(other); } + bool operator>= (const Microsecond& other) const { return (operator==(other) == true) ? true : operator>(other); } - bool operator<= (const Second& other) const throw() { return a_value <= other.a_value; } + bool operator<= (const Second& other) const { return a_value <= other.a_value; } - bool operator<= (const Millisecond& other) const throw() { return (operator==(other) == true) ? true : operator<(other); } + bool operator<= (const Millisecond& other) const { return (operator==(other) == true) ? true : operator<(other); } - bool operator<= (const Microsecond& other) const throw() { return (operator==(other) == true) ? true : operator<(other); } + bool operator<= (const Microsecond& other) const { return (operator==(other) == true) ? true : operator<(other); } /** * Devuelve el valor asociado a esta instancia. * \return el valor asociado a esta instancia. */ - type_t getValue() const throw() { return a_value; } + type_t getValue() const { return a_value; } /** Devuelve una cadena con la hora en formato 'dd/mm/yyyy hh:mm:ss'. @@ -135,7 +135,7 @@ public: \see man strftime */ - std::string asDateTime(const char* format = "%d/%0m/%Y %T") const throw(); + std::string asDateTime(const char* format = "%d/%0m/%Y %T") const ; /** Devuelve una cadena con la hora en formato 'dd/mm/yyyy hh:mm:ss'. @@ -146,33 +146,33 @@ public: \see man strftime */ - const char* asDateTime(char* result, const char* format = "%d/%0m/%Y %T") const throw(); + const char* asDateTime(char* result, const char* format = "%d/%0m/%Y %T") const ; /** * Devuelve una cadena con el valor de esta instancia y las unidades "sec". * \return una cadena con el valor de esta instancia y las unidades "sec". */ - std::string asString() const throw(); + std::string asString() const ; /** * Devuelve la hora actual de sistema expresada en segundos transcurridos desde el 1 de Enero de 1970 * \return la hora actual de sistema expresada en segundos transcurridos desde el 1 de Enero de 1970 */ - static Second getTime() throw(); + static Second getTime() ; /** * Devuelve la hora actual de sistema expresada en segundos transcurridos desde el 1 de Enero de 1970 aplicando * las correciones correspondientes a la hora local. * \return la hora actual de sistema expresada en segundos transcurridos desde el 1 de Enero de 1970 */ - static Second getLocalTime() throw(); + static Second getLocalTime() ; /** * Obtiene los microsegundos del valor contenido en la cadena recibida como parámetro. * \param value Cadena que contiene los microsegundos habrá sido obtenida con #asString. * \return los microsegundos del valor contenido en la cadena recibida como parámetro. */ - static Second fromString(const std::string& value) throw(RuntimeException); + static Second fromString(const std::string& value) noexcept(false); private: type_t a_value; @@ -180,35 +180,35 @@ private: friend class Millisecond; friend class Microsecond; - friend class Second operator + (const Second& left, const Second& right) throw(); - friend class Second operator - (const Second& left, const Second& right) throw(); - friend class Second operator / (const Second& left, const Second& right) throw(); - friend class Second operator / (const Second& left, const int right) throw(); - friend class Second operator / (const Second& left, const unsigned int right) throw(); + friend class Second operator + (const Second& left, const Second& right) ; + friend class Second operator - (const Second& left, const Second& right) ; + friend class Second operator / (const Second& left, const Second& right) ; + friend class Second operator / (const Second& left, const int right) ; + friend class Second operator / (const Second& left, const unsigned int right) ; }; inline Second operator + (const Second& left, const Second& right) -throw() { +{ return Second(left.a_value + right.a_value); } inline Second operator - (const Second& left, const Second& right) -throw() { +{ return Second(left.a_value - right.a_value); } inline Second operator / (const Second& left, const Second& right) -throw() { +{ return Second(left.a_value / right.a_value); } inline Second operator / (const Second& left, const int right) -throw() { +{ return Second(left.a_value / right); } inline Second operator / (const Second& left, const unsigned int right) -throw() { +{ return Second(left.a_value / right); } diff --git a/include/anna/core/util/SortedVector.hpp b/include/anna/core/util/SortedVector.hpp index cf043e4..4e4bf53 100644 --- a/include/anna/core/util/SortedVector.hpp +++ b/include/anna/core/util/SortedVector.hpp @@ -59,7 +59,7 @@ public: map o \em en otro caso. */ bool contains(const T* t) const - throw() { + { if(t == NULL) return false; @@ -73,7 +73,7 @@ public: \return \em true si ha registrado la nueva instancia o \em false en otro caso. */ bool add(T* t) - throw(RuntimeException) { + noexcept(false) { if(t == NULL) return false; @@ -89,7 +89,7 @@ public: \return \em true si ha eliminado la instancia o \em false en otro caso. */ bool erase(T* t) - throw(RuntimeException) { + noexcept(false) { if(t == NULL) return false; @@ -111,7 +111,7 @@ public: \return la instancia asociada a la clave recibida como parametro o NULL si no existe. */ T* find(const TKey key) - throw() { + { iterator ii = container::find(key); return (ii == container::end()) ? NULL : ii->second; } @@ -121,7 +121,7 @@ public: \param key Clave a buscar en el map. \return la instancia asociada a la clave recibida como parametro o NULL si no existe. */ - const T* find(const TKey key) const throw() { + const T* find(const TKey key) const { return const_cast *>(this)->find(key); } @@ -129,13 +129,13 @@ public: Devuelve el objeto referenciado por el iterador. \return El objeto referenciado por el iterador. */ - static T* data(iterator ii) throw() { return ii->second; } + static T* data(iterator ii) { return ii->second; } /** Devuelve el objeto referenciado por el iterador. \return El objeto referenciado por el iterador. */ - static const T* data(const_iterator ii) throw() { return ii->second; } + static const T* data(const_iterator ii) { return ii->second; } }; } diff --git a/include/anna/core/util/String.hpp b/include/anna/core/util/String.hpp index 49126b8..c5412f8 100644 --- a/include/anna/core/util/String.hpp +++ b/include/anna/core/util/String.hpp @@ -64,45 +64,45 @@ public: /** * Convierte a may�sculas el contenido de esta instancia. */ - void toUpper() throw(); + void toUpper() ; /** * Convierte a min�sculas el contenido de esta instancia. */ - void toLower() throw(); - - String& operator = (const char* vv) throw() { std::string::clear(); return operator<< (vv); } - String& operator = (const int vv) throw() { std::string::clear(); return operator<< (vv); } - String& operator = (const unsigned int vv) throw() { std::string::clear(); return operator<< (vv); } - String& operator = (const bool vv) throw() { std::string::clear(); return operator<< (vv); } - String& operator = (const S64 vv) throw() { std::string::clear(); return operator<< (vv); } - String& operator = (const U64 vv) throw() { std::string::clear(); return operator<< (vv); } - String& operator = (const float vv) throw() { std::string::clear(); return operator<< (vv); } - String& operator = (const double vv) throw() { std::string::clear(); return operator<< (vv); } - String& operator = (const std::string& vv) throw() { std::string::operator= (vv); return *this; } - String& operator = (const DataBlock& vv) throw() { std::string::clear(); return operator<< (vv); } - - String& operator += (const char* vv) throw() { return operator<< (vv); } - String& operator += (const int vv) throw() { return operator<< (vv); } - String& operator += (const unsigned int vv) throw() { return operator<< (vv); } - String& operator += (const bool vv) throw() { return operator<< (vv); } - String& operator += (const S64 vv) throw() { return operator<< (vv); } - String& operator += (const U64 vv) throw() { return operator<< (vv); } - String& operator += (const float vv) throw() { return operator<< (vv); } - String& operator += (const double vv) throw() { return operator<< (vv); } - String& operator += (const std::string& vv) throw() { return *this << vv; } - String& operator += (const DataBlock& vv) throw() { return *this << vv; } - - String& operator << (const char* vv) throw(); - String& operator << (const int vv) throw(); - String& operator << (const unsigned int vv) throw(); - String& operator << (const bool vv) throw() { std::string::operator+= ((vv == true) ? "true" : "false"); return *this; } - String& operator << (const S64 vv) throw(); - String& operator << (const U64 vv) throw(); - String& operator << (const float vv) throw(); - String& operator << (const double vv) throw(); - String& operator << (const std::string& vv) throw() { std::string::operator+= (vv); return *this; } - String& operator << (const DataBlock& vv) throw(); + void toLower() ; + + String& operator = (const char* vv) { std::string::clear(); return operator<< (vv); } + String& operator = (const int vv) { std::string::clear(); return operator<< (vv); } + String& operator = (const unsigned int vv) { std::string::clear(); return operator<< (vv); } + String& operator = (const bool vv) { std::string::clear(); return operator<< (vv); } + String& operator = (const S64 vv) { std::string::clear(); return operator<< (vv); } + String& operator = (const U64 vv) { std::string::clear(); return operator<< (vv); } + String& operator = (const float vv) { std::string::clear(); return operator<< (vv); } + String& operator = (const double vv) { std::string::clear(); return operator<< (vv); } + String& operator = (const std::string& vv) { std::string::operator= (vv); return *this; } + String& operator = (const DataBlock& vv) { std::string::clear(); return operator<< (vv); } + + String& operator += (const char* vv) { return operator<< (vv); } + String& operator += (const int vv) { return operator<< (vv); } + String& operator += (const unsigned int vv) { return operator<< (vv); } + String& operator += (const bool vv) { return operator<< (vv); } + String& operator += (const S64 vv) { return operator<< (vv); } + String& operator += (const U64 vv) { return operator<< (vv); } + String& operator += (const float vv) { return operator<< (vv); } + String& operator += (const double vv) { return operator<< (vv); } + String& operator += (const std::string& vv) { return *this << vv; } + String& operator += (const DataBlock& vv) { return *this << vv; } + + String& operator << (const char* vv) ; + String& operator << (const int vv) ; + String& operator << (const unsigned int vv) ; + String& operator << (const bool vv) { std::string::operator+= ((vv == true) ? "true" : "false"); return *this; } + String& operator << (const S64 vv) ; + String& operator << (const U64 vv) ; + String& operator << (const float vv) ; + String& operator << (const double vv) ; + String& operator << (const std::string& vv) { std::string::operator+= (vv); return *this; } + String& operator << (const DataBlock& vv) ; /** * Formatea el contenido del \em float con la cadena recibida como par�metro. @@ -111,7 +111,7 @@ public: * \param format Cadena usada para interpretar el valor (ver sprintf). * \return La cadena con el contenido interpretado. */ - static String format(const float vv, const char* format) throw() { return __format(vv, format); } + static String format(const float vv, const char* format) { return __format(vv, format); } /** * Formatea el contenido del \em double con la cadena recibida como par�metro. @@ -120,7 +120,7 @@ public: * \param format Cadena usada para interpretar el valor (ver sprintf). * \return La cadena con el contenido interpretado. */ - static String format(const double vv, const char* format) throw() { return __format(vv, format); } + static String format(const double vv, const char* format) { return __format(vv, format); } /** * Formatea el contenido del DataBlock con el n�mero de caracteres por l�nea recibida como par�metro. @@ -128,7 +128,7 @@ public: * \param characterByLine N�mero de caracters por l�nea. * \return La cadena con el contenido interpretado. */ - static String format(const DataBlock& vv, const int characterByLine) throw(); + static String format(const DataBlock& vv, const int characterByLine) ; /** * Formatea el valor del par�metro como un n�mero en hexadecimal. diff --git a/include/anna/core/util/TextComposer.hpp b/include/anna/core/util/TextComposer.hpp index ca12989..eef60e0 100644 --- a/include/anna/core/util/TextComposer.hpp +++ b/include/anna/core/util/TextComposer.hpp @@ -68,7 +68,7 @@ public: */ ~TextComposer(); - TextVariable& operator[](const char* varName) throw(RuntimeException) { + TextVariable& operator[](const char* varName) noexcept(false) { return *(find(varName, Exception::Mode::Throw)); } @@ -76,26 +76,26 @@ public: * Método que realiza la interpretación del texto de esta instancia. * Si la instancia se crea mediante un #util::TextManager no es necesario invocar a este método. */ - void initialize() throw(RuntimeException); + void initialize() noexcept(false); /** Devuelve el identificador del compositor, que coincidira con el indicado a la hora de crear el compositor mediante el metodo TextManager::create. \return El identificador del compositor. */ - const int getId() const throw() { return a_id; } + const int getId() const { return a_id; } /** Devuelve el nº de variables asociadas al texto. \return el nº de variables asociadas al texto. */ - int getNumberOfVariables() const throw() { return container::size(); } + int getNumberOfVariables() const { return container::size(); } /** Devuelve una cadena con la informacion relevante de este objeto. \return Una cadena con la informacion relevante de este objeto. */ - String asString() const throw(); + String asString() const ; protected: /** @@ -110,19 +110,19 @@ protected: Crea el texto teniendo en cuenta la expression y el contenido de las variables asociadas. \return El texto teniendo en cuenta la expression y el contenido de las variables asociadas. */ - String apply() const throw(RuntimeException); + String apply() const noexcept(false); /** * Devuelve la instancia de la variable a la que apunta el iterador. * return la instancia de la variable a la que apunta el iterador. */ - static TextVariable* textVariable(variable_iterator ii) throw() { return *ii; } + static TextVariable* textVariable(variable_iterator ii) { return *ii; } /** * Devuelve la instancia de la variable a la que apunta el iterador. * return la instancia de la variable a la que apunta el iterador. */ - static const TextVariable* textVariable(const_variable_iterator ii) throw() { return *ii; } + static const TextVariable* textVariable(const_variable_iterator ii) { return *ii; } private: const int a_id; @@ -133,11 +133,11 @@ private: TextComposer(const TextComposer&); - TextVariable* find(const char* name, const Exception::Mode::_v) throw(RuntimeException); - void lock() throw(RuntimeException) { a_mutex.lock(); } - void unlock() throw() { a_mutex.unlock(); } + TextVariable* find(const char* name, const Exception::Mode::_v) noexcept(false); + void lock() noexcept(false) { a_mutex.lock(); } + void unlock() { a_mutex.unlock(); } - static TextVariable::Type::_v calculeType(const char* format) throw(RuntimeException); + static TextVariable::Type::_v calculeType(const char* format) noexcept(false); friend class TextManager; // friend class Guard ; diff --git a/include/anna/core/util/TextManager.hpp b/include/anna/core/util/TextManager.hpp index 9c9642b..3a4694c 100644 --- a/include/anna/core/util/TextManager.hpp +++ b/include/anna/core/util/TextManager.hpp @@ -38,14 +38,14 @@ public: \param composer Indica el numero de compositor al que deseamos acceder. \return El compositor de textos. */ - TextComposer& operator [](const int composer) throw(RuntimeException) { return find(composer); } + TextComposer& operator [](const int composer) noexcept(false) { return find(composer); } /** Operador de acceso. El compositor solicitado deberia estar creado mediate #create. \param composer Indica el numero de compositor al que deseamos acceder. \return El compositor de textos. */ - const TextComposer& operator [](const int composer) const throw(RuntimeException) { return find(composer); } + const TextComposer& operator [](const int composer) const noexcept(false) { return find(composer); } /** Crea un nuevo compositor de textos. @@ -53,7 +53,7 @@ public: \param expression Expresion asociada al compositor que vamos a crear. El numero de variables que hay que establecer antes de invocar a TextComposer::apply dependera de este texto. */ - void create(const int composer, const char* expression) throw(RuntimeException); + void create(const int composer, const char* expression) noexcept(false); /** Devuelve el compositor de textos asociado al numero recibido como parametro. @@ -61,7 +61,7 @@ public: \param composer Indica el numero de compositor al que deseamos acceder. \return El compositor de textos. */ - TextComposer& find(const int composer) throw(RuntimeException); + TextComposer& find(const int composer) noexcept(false); /** Devuelve el compositor de textos asociado al numero recibido como parametro. @@ -69,12 +69,12 @@ public: \param composer Indica el numero de compositor al que deseamos acceder. \return El compositor de textos. */ - const TextComposer& find(const int composer) const throw(RuntimeException); + const TextComposer& find(const int composer) const noexcept(false); /** Elimina todos los compositores de texto creados hasta el momento. */ - void clear() throw(); + void clear() ; /** Metodo que podemos reescribir para crear cualquier clase heredada de TextComposer. @@ -84,7 +84,7 @@ public: \endcode \warning La reimplementacion de este metodo nunca deberia devolver NULL. */ - virtual TextComposer* createTextComposer(const int composer, const char* expression) throw(); + virtual TextComposer* createTextComposer(const int composer, const char* expression) ; private: typedef std::vector TextComposerVector; @@ -94,7 +94,7 @@ private: TextManager(const TextManager&); - TextComposer* xfind(const int composer) throw(); + TextComposer* xfind(const int composer) ; }; } diff --git a/include/anna/core/util/TextVariable.hpp b/include/anna/core/util/TextVariable.hpp index b366f35..1323612 100644 --- a/include/anna/core/util/TextVariable.hpp +++ b/include/anna/core/util/TextVariable.hpp @@ -27,37 +27,37 @@ public: * Asignación a entero. * \param value Valor a asignar a esta variable. */ - TextVariable& operator= (const int value) throw(RuntimeException) { setValue(value); return *this; } + TextVariable& operator= (const int value) noexcept(false) { setValue(value); return *this; } /** * Asignación a cadena. * \param value Valor a asignar a esta variable. */ - TextVariable& operator= (const char* value) throw(RuntimeException) { setValue(value); return *this; } + TextVariable& operator= (const char* value) noexcept(false) { setValue(value); return *this; } /** * Asignación a cadena. * \param value Valor a asignar a esta variable. */ - TextVariable& operator= (const anna::String& value) throw(RuntimeException) { setValue(value.c_str()); return *this; } + TextVariable& operator= (const anna::String& value) noexcept(false) { setValue(value.c_str()); return *this; } /** * Asignación a entero de 64 bits. * \param value Valor a asignar a esta variable. */ - TextVariable& operator= (const S64 value) throw(RuntimeException) { setValue(value); return *this; } + TextVariable& operator= (const S64 value) noexcept(false) { setValue(value); return *this; } /** * Asignación a flotante. * \param value Valor a asignar a esta variable. */ - TextVariable& operator= (const float value) throw(RuntimeException) { setValue(value); return *this; } + TextVariable& operator= (const float value) noexcept(false) { setValue(value); return *this; } /** * Asignación a flotante. * \param value Valor a asignar a esta variable. */ - TextVariable& operator= (const double value) throw(RuntimeException) { setValue(value); return *this; } + TextVariable& operator= (const double value) noexcept(false) { setValue(value); return *this; } protected: /** @@ -72,7 +72,7 @@ protected: private: const anna::String a_expression; - const char* compose(DataBlock& buffer) const throw(RuntimeException); + const char* compose(DataBlock& buffer) const noexcept(false); friend class TextComposer; }; diff --git a/include/anna/core/util/Tokenizer.hpp b/include/anna/core/util/Tokenizer.hpp index 8290775..585f34c 100644 --- a/include/anna/core/util/Tokenizer.hpp +++ b/include/anna/core/util/Tokenizer.hpp @@ -22,7 +22,7 @@ class RuntimeException; */ class Tokenizer { - int _apply(const char* str, const char* separator) throw(RuntimeException); + int _apply(const char* str, const char* separator) noexcept(false); public: typedef char* const* const_iterator; @@ -60,7 +60,7 @@ public: Devuelve el estado del indicador de activacion de eliminacion de espacios de los extremos. \return El estado del indicador de activacion de eliminacion de espacios de los extremos. */ - bool activateStrip() const throw() { return a_activateStrip; } + bool activateStrip() const { return a_activateStrip; } // Operadores @@ -69,31 +69,31 @@ public: por esta clase sin espacios por delante y por detras. \param _activateStrip Parametro que indica el estado de activacion o desactivacion. */ - void activateStrip(const bool _activateStrip) throw() { a_activateStrip = _activateStrip; } + void activateStrip(const bool _activateStrip) { a_activateStrip = _activateStrip; } /** @return El elemento que ocupa la posicion i-esima. \warning Este método tiene una eficiencia de O(1), mejor usar iteradores. */ - const char* at(const int i) throw(RuntimeException); + const char* at(const int i) noexcept(false); /** @return El elemento que ocupa la posicion i-esima. \warning Este método tiene una eficiencia de O(1), mejor usar iteradores. */ - const char* at(const int i) const throw(RuntimeException); + const char* at(const int i) const noexcept(false); /** @return El elemento que ocupa la posicion i-esima. \warning Este método tiene una eficiencia de O(1), mejor usar iteradores. */ - const char* operator [](const int i) throw(RuntimeException) { return at(i); } + const char* operator [](const int i) noexcept(false) { return at(i); } /** @return El elemento que ocupa la posicion i-esima. \warning Este método tiene una eficiencia de O(1), mejor usar iteradores. */ - const char* operator [](const int i) const throw(RuntimeException) { return at(i); } + const char* operator [](const int i) const noexcept(false) { return at(i); } /** Process the separation over the string str with the separator provided. @@ -113,8 +113,8 @@ public: @return Number of tokens */ - int apply(const char* str, const char* separator, const char *tokenizeContiguous = NULL) throw(RuntimeException); - int apply(const std::string& str, const char* separator, const char *tokenizeContiguous = NULL) throw(RuntimeException) { + int apply(const char* str, const char* separator, const char *tokenizeContiguous = NULL) noexcept(false); + int apply(const std::string& str, const char* separator, const char *tokenizeContiguous = NULL) noexcept(false) { return apply(str.c_str(), separator, tokenizeContiguous); } @@ -123,31 +123,31 @@ public: /** @return El ultimo elemento obtenido la aplicar la separacion. */ - const char* last() const throw(RuntimeException); + const char* last() const noexcept(false); /** * Devuelve el número de elementos obtenidos en la separación. * \return el número de elementos obtenidos en la separación. */ - int size() const throw() { return a_maxItem; } + int size() const { return a_maxItem; } /** * Devuelve el iterador el comiento de los elementos obtenidos por #apply * \return el iterador el comiento de los elementos obtenidos por #apply */ - const_iterator begin() const throw() { return a_items; } + const_iterator begin() const { return a_items; } /** * Devuelve el iterador al final de los elementos obtenidos por #apply * \return el iterador al final de los elementos obtenidos por #apply */ - const_iterator end() const throw() { return a_items + a_maxItem; } + const_iterator end() const { return a_items + a_maxItem; } /** Devuelve la cadena referenciada por el iterator recibido como parametro. \return la cadena referenciada por el iterator recibido como parametro. */ - static const char* data(const_iterator ii) throw() { return *ii; } + static const char* data(const_iterator ii) { return *ii; } private: static const int MaxItem; @@ -157,9 +157,9 @@ private: char** a_items; int a_maxItem; - static char* strip(char* str) throw(); + static char* strip(char* str) ; - void indexException(const int index, const char* fromFile, const int fromLine) const throw(RuntimeException); + void indexException(const int index, const char* fromFile, const int fromLine) const noexcept(false); }; } diff --git a/include/anna/core/util/Variable.hpp b/include/anna/core/util/Variable.hpp index 3db7df1..72fca5e 100644 --- a/include/anna/core/util/Variable.hpp +++ b/include/anna/core/util/Variable.hpp @@ -180,40 +180,40 @@ public: Devuelve el tipo del dato al que recubre esta variable. @return El tipo del dato al que recubre esta variable. */ - Type::_v getType() const throw() { return a_type; } + Type::_v getType() const { return a_type; } /** Devuelve el nombre logico asociado a esta variable. \return Nombre logico asociado a esta variable. */ - const char* getName() const throw() { return a_name.c_str(); } + const char* getName() const { return a_name.c_str(); } /** Devuelve \em false si esta marcado como nulo o \em true en otro caso. @return \em false si esta marcado como nulo o \em true en otro caso. */ - bool isNull() const throw() { return a_isNull; } + bool isNull() const { return a_isNull; } /** Devuelve el valor alfabetico asociado a esta variable. @return Si la variable indicada en el contructor de esta instancia puede interpretarse como una string devolvera su contenido, en otro caso lanzara una excepcion para indicar el error. */ - const char* getStringValue() const throw(RuntimeException); + const char* getStringValue() const noexcept(false); /** Devuelve el valor numerico asociado a esta variable. @return Si la variable indicada en el contructor de esta instancia puede interpretarse como un entero de 32 bits devolvera su contenido, en otro caso lanzara una excepcion para indicar el error. */ - int getIntegerValue() const throw(RuntimeException); + int getIntegerValue() const noexcept(false); /** Devuelve el valor numerico asociado a esta variable. @return Si la variable indicada en el contructor de esta instancia puede interpretarse como un entero de 64 bits devolvera su contenido, en otro caso lanzara una excepcion para indicar el error. */ - S64 getInteger64Value() const throw(RuntimeException); + S64 getInteger64Value() const noexcept(false); /** Devuelve el valor booleano asociado a esta variable. @@ -221,33 +221,33 @@ public: un booleano y este es distinto de cero devolvera true en otro caso devolvera false. indicar el error. */ - bool getBooleanValue() const throw(RuntimeException) ; + bool getBooleanValue() const noexcept(false) ; /** Devuelve el bloque de memoria asociado a esta variable. @return Si la variable indicada en el contructor de esta instancia era de type DataBlock devolvera el contenido de esta, en otro caso lanzara una excepcion. */ - const DataBlock& getDataBlockValue() const throw(RuntimeException) ; + const DataBlock& getDataBlockValue() const noexcept(false) ; /** Devuelve el valor numerico asociado a esta variable. @return Si la variable indicada en el contructor de esta instancia puede interpretarse como un entero en coma flotante devolvera su contenido, en otro caso lanzara una excepcion para indicar el error. */ - float getFloatValue() const throw(RuntimeException); + float getFloatValue() const noexcept(false); /** Devuelve el valor numerico asociado a esta variable. @return Si la variable indicada en el contructor de esta instancia puede interpretarse como un entero en coma flotante devolvera su contenido, en otro caso lanzara una excepcion para indicar el error. */ - double getDoubleValue() const throw(RuntimeException); + double getDoubleValue() const noexcept(false); /** * Devuelve el valor de un elemento definido por el usuario. */ - void* getCustom() throw(RuntimeException) { + void* getCustom() noexcept(false) { verifyMatchType(Type::Custom, ANNA_FILE_LOCATION); return a_value.a_custom; } @@ -255,7 +255,7 @@ public: /** * Devuelve el valor de un elemento definido por el usuario. */ - const void* getCustom() const throw(RuntimeException) { + const void* getCustom() const noexcept(false) { verifyMatchType(Type::Custom, ANNA_FILE_LOCATION); return a_value.a_custom; } @@ -263,7 +263,7 @@ public: /** * Devuelve el valor de un elemento definido por el usuario. */ - void setCustom(void* value) throw(RuntimeException) { + void setCustom(void* value) noexcept(false) { verifyMatchType(Type::Custom, ANNA_FILE_LOCATION); a_isNull = (value == NULL); a_value.a_custom = value; @@ -273,37 +273,37 @@ public: Interpreta el valor asociado a esta variable como un valor entero. \warning No se realiza ninguna comprobacion semantica. */ - int getInteger() const throw() { return *a_value.a_integer; } + int getInteger() const { return *a_value.a_integer; } /** Interpreta el valor asociado a esta variable como un valor entero largo. \warning No se realiza ninguna comprobacion semantica. */ - S64 getInteger64() const throw() { return *a_value.a_longInteger; } + S64 getInteger64() const { return *a_value.a_longInteger; } /** Interpreta el valor asociado a esta variable como un valor booleano. \warning No se realiza ninguna comprobacion semantica. */ - bool getBoolean() const throw() { return *a_value.a_boolean; } + bool getBoolean() const { return *a_value.a_boolean; } /** Interpreta el valor asociado a esta variable como un valor bloque de datos. \warning No se realiza ninguna comprobacion semantica. */ - const DataBlock& getDataBlock() const throw() { return *a_value.a_dataBlock; } + const DataBlock& getDataBlock() const { return *a_value.a_dataBlock; } /** Interpreta el valor asociado a esta variable como un valor en coma flotante de 32 bits \warning No se realiza ninguna comprobacion semantica. */ - float getFloat() const throw() { return *a_value.a_float; } + float getFloat() const { return *a_value.a_float; } /** Interpreta el valor asociado a esta variable como un valor en coma flotante de 64 bits \warning No se realiza ninguna comprobacion semantica. */ - double getDouble() const throw() { return *a_value.a_double; } + double getDouble() const { return *a_value.a_double; } // Modificadores /** @@ -313,7 +313,7 @@ public: * * @param value Valor que tomara la variable a la que recubre este variable. */ - void setValue(const char* value) throw(RuntimeException); + void setValue(const char* value) noexcept(false); /** * Establece el valor de la variable a la que recubre. Si la variable estaba marcada como nula la desmarca. @@ -322,7 +322,7 @@ public: * * @param value Valor que tomara la variable a la que recubre este variable. */ - void setCharPointer(const char* value) throw(RuntimeException); + void setCharPointer(const char* value) noexcept(false); /** * Establece el valor de la variable a la que recubre. Si la variable estaba marcada como nula la desmarca. @@ -331,7 +331,7 @@ public: * * @param value Valor que tomara la variable a la que recubre este variable. */ - void setValue(const int value) throw(RuntimeException); + void setValue(const int value) noexcept(false); /** * Establece el valor de la variable a la que recubre. Si la variable estaba marcada como nula la desmarca. @@ -340,7 +340,7 @@ public: * * @param value Valor que tomara la variable a la que recubre este variable. */ - void setValue(const S64 value) throw(RuntimeException) ; + void setValue(const S64 value) noexcept(false) ; /** * Establece el valor de la variable a la que recubre. Si la variable estaba marcada como nula la desmarca. @@ -349,7 +349,7 @@ public: * * @param value Valor que tomara la variable a la que recubre este variable. */ - void setValue(const bool value) throw(RuntimeException); + void setValue(const bool value) noexcept(false); /** * Establece el valor de la variable a la que recubre. Si la variable estaba marcada como nula la desmarca. @@ -358,7 +358,7 @@ public: * * @param value Valor que tomara la variable a la que recubre este variable. */ - void setValue(const DataBlock& value) throw(RuntimeException) ; + void setValue(const DataBlock& value) noexcept(false) ; /** * Establece el valor de la variable a la que recubre. Si la variable estaba marcada como nula la desmarca. @@ -367,7 +367,7 @@ public: * * @param value Valor que tomara la variable a la que recubre este variable. */ - void setValue(const float value) throw(RuntimeException) ; + void setValue(const float value) noexcept(false) ; /** * Establece el valor de la variable a la que recubre. Si la variable estaba marcada como nula la desmarca. @@ -376,61 +376,61 @@ public: * * @param value Valor que tomara la variable a la que recubre este variable. */ - void setValue(const double value) throw(RuntimeException) ; + void setValue(const double value) noexcept(false) ; /** Marca/Desmarca la variable como nula. @param isNull Indica la nueva marca de la variable. */ - void setNull(const bool isNull = true) throw() { a_isNull = isNull; } + void setNull(const bool isNull = true) { a_isNull = isNull; } /** Establece el valor asociado a esta variable como un valor entero. \warning No se realiza ninguna comprobacion semantica. */ - void setInteger(const int value) throw() { *a_value.a_integer = value; a_isNull = false; } + void setInteger(const int value) { *a_value.a_integer = value; a_isNull = false; } /** Establece el valor asociado a esta variable como un valor entero largo. \warning No se realiza ninguna comprobacion semantica. */ - void setLong(const S64 value) throw() { *a_value.a_longInteger = value; a_isNull = false; } + void setLong(const S64 value) { *a_value.a_longInteger = value; a_isNull = false; } /** Establece el valor asociado a esta variable como un valor booleano. \warning No se realiza ninguna comprobacion semantica. */ - void setBoolean(const bool value) throw() { *a_value.a_boolean = value; a_isNull = false; } + void setBoolean(const bool value) { *a_value.a_boolean = value; a_isNull = false; } /** Interpreta el valor asociado a esta variable como un valor bloque de datos. \warning No se realiza ninguna comprobacion semantica. */ - void setDataBlock(const DataBlock& value) throw() { *a_value.a_dataBlock = value; a_isNull = false; } + void setDataBlock(const DataBlock& value) { *a_value.a_dataBlock = value; a_isNull = false; } /** Interpreta el valor asociado a esta variable como número en coma flotante. \warning No se realiza ninguna comprobacion semantica. */ - void setFloat(const float value) throw() { *a_value.a_float = value; a_isNull = false; } + void setFloat(const float value) { *a_value.a_float = value; a_isNull = false; } /** Interpreta el valor asociado a esta variable como número en coma flotante. \warning No se realiza ninguna comprobacion semantica. */ - void setDouble(const double value) throw() { *a_value.a_double = value; a_isNull = false; } + void setDouble(const double value) { *a_value.a_double = value; a_isNull = false; } /** @return \em true si la variable recibida tiene el mismo nombre que esta instancia o \em false en otro caso. */ - bool isEqual(const Variable& right) const throw() { return a_name == right.a_name; } + bool isEqual(const Variable& right) const { return a_name == right.a_name; } /** Devuelve una cadena con informacion relevante de esta instancia. \return Una cadena con informacion relevante de esta instancia. */ - virtual String asString() const throw(); + virtual String asString() const ; protected: /** @@ -440,7 +440,7 @@ protected: Devuelve la referencia a memoria de esta variable. \internal */ - void* getReference() const throw(); + void* getReference() const ; /** Devuelve el area de memoria de la variable C++ a sociada a esta variable logica. @@ -448,13 +448,13 @@ protected: \warning La forma de interpretar este valor dependera del tipo de dato (ver #Type) asociado a esta variable. */ - void* buffer() const throw(); + void* buffer() const ; /** Devuelve la referencia a la variable que controla el indicador de nulo de esta variable. \return La referencia a la variable que controla el indicador de nulo de esta variable. */ - bool* getNullIndicator() throw() { return &a_isNull; } + bool* getNullIndicator() { return &a_isNull; } private: std::string a_name; @@ -482,9 +482,9 @@ private: Variable(const Variable&); Variable& operator = (const Variable&); - void verifyIsNotNull(const char* file, const int lineno) const throw(RuntimeException); - void verifyMatchSomeType(const Type::_v firstType, const Type::_v secondType, const char* file, const int lineno) const throw(RuntimeException); - void verifyMatchType(const Type::_v, const char* file, const int lineno) const throw(RuntimeException); + void verifyIsNotNull(const char* file, const int lineno) const noexcept(false); + void verifyMatchSomeType(const Type::_v firstType, const Type::_v secondType, const char* file, const int lineno) const noexcept(false); + void verifyMatchType(const Type::_v, const char* file, const int lineno) const noexcept(false); }; diff --git a/include/anna/core/util/ZBlock.hpp b/include/anna/core/util/ZBlock.hpp index e0de15d..59a089e 100644 --- a/include/anna/core/util/ZBlock.hpp +++ b/include/anna/core/util/ZBlock.hpp @@ -39,7 +39,7 @@ public: * \param mode Modo de compresión realizado. * \return El bloque de datos una vez comprimido y con la información suficiente para ser descomprimido. */ - const DataBlock& compress(const DataBlock& data, const Mode::_v mode = Mode::Default) throw(RuntimeException); + const DataBlock& compress(const DataBlock& data, const Mode::_v mode = Mode::Default) noexcept(false); /** * Descomprime el bloque de datos recibido como parámetro. @@ -47,7 +47,7 @@ public: * \param originalSize Tamaño original que tenía el buffer antes de ser comprimido. * \return El bloque de datos descomprimdo. */ - const DataBlock& uncompress(const DataBlock& zdata) throw(RuntimeException); + const DataBlock& uncompress(const DataBlock& zdata) noexcept(false); private: ZBlock(const ZBlock&); diff --git a/include/anna/core/util/defines.hpp b/include/anna/core/util/defines.hpp index 25a7e03..cd846a3 100644 --- a/include/anna/core/util/defines.hpp +++ b/include/anna/core/util/defines.hpp @@ -421,7 +421,7 @@ typedef struct { * @param v Version type * @return Version description */ - static const char* asText(const _v v) throw() { // anna_declare_enum is not safe, because labels don't have to match a sequence + static const char* asText(const _v v) { // anna_declare_enum is not safe, because labels don't have to match a sequence if(v == IPv4) return "IPv4"; if(v == IPv6) return "IPv6"; @@ -447,29 +447,29 @@ typedef struct { /** Gets the address version */ - const U16 & getVersion() const throw() { return Version; } + const U16 & getVersion() const { return Version; } /** Gets the address printable value */ - const char * getValue() const throw() { return Value.c_str(); } + const char * getValue() const { return Value.c_str(); } // Helpers /** Return true when is an IPv4 address */ - bool isIPv4() const throw() { return ((iana_address_version_t::_v)Version == iana_address_version_t::IPv4); } + bool isIPv4() const { return ((iana_address_version_t::_v)Version == iana_address_version_t::IPv4); } /** Return true when is an IPv6 address */ - bool isIPv6() const throw() { return ((iana_address_version_t::_v)Version == iana_address_version_t::IPv6); } + bool isIPv6() const { return ((iana_address_version_t::_v)Version == iana_address_version_t::IPv6); } /** Return true when is an E164 (SMDS, Frame Relay, ATM) address */ - bool isE164() const throw() { return ((iana_address_version_t::_v)Version == iana_address_version_t::E164); } + bool isE164() const { return ((iana_address_version_t::_v)Version == iana_address_version_t::E164); } /** Sets version for IPv4 address and address itself. Checking is not performed (could assign IPv6 instead ...) */ - void setIPv4(const char *value) throw() { Version = iana_address_version_t::IPv4; Value = value ? value : ""; } + void setIPv4(const char *value) { Version = iana_address_version_t::IPv4; Value = value ? value : ""; } /** Sets version for IPv6 address and address itself. Checking is not performed (could assign IPv4 instead ...) */ - void setIPv6(const char *value) throw() { Version = iana_address_version_t::IPv6; Value = value ? value : ""; } + void setIPv6(const char *value) { Version = iana_address_version_t::IPv6; Value = value ? value : ""; } /** Sets version for E164 address and address itself. Checking is not performed ... */ - void setE164(const char *value) throw() { Version = iana_address_version_t::E164; Value = value ? value : ""; } + void setE164(const char *value) { Version = iana_address_version_t::E164; Value = value ? value : ""; } /** @@ -477,7 +477,7 @@ typedef struct { * * @return String with class content */ - std::string asString() const throw() { + std::string asString() const { std::string result; result += Value.c_str(); // assume that all IANA addresses have a printable representation result += " ("; diff --git a/include/anna/dbms.mysql/BaseBind.hpp b/include/anna/dbms.mysql/BaseBind.hpp index a9a3b85..ab1cd27 100644 --- a/include/anna/dbms.mysql/BaseBind.hpp +++ b/include/anna/dbms.mysql/BaseBind.hpp @@ -37,7 +37,7 @@ protected: unsigned long a_length; BaseBind(const dbms::Data& data) ; - void setupBind(st_mysql_bind&, dbms::Data&) throw(RuntimeException); + void setupBind(st_mysql_bind&, dbms::Data&) noexcept(false); private: static const int MaxBlobSize = 2 << 16; diff --git a/include/anna/dbms.mysql/Connection.hpp b/include/anna/dbms.mysql/Connection.hpp index ea817c3..501ebab 100644 --- a/include/anna/dbms.mysql/Connection.hpp +++ b/include/anna/dbms.mysql/Connection.hpp @@ -41,13 +41,13 @@ public: Devuelve una cadena con la informacion referente a esta instancia. @return Una cadena con la informacion referente a esta instancia. */ - std::string asString() const throw(); + std::string asString() const ; /** Operador de conversion. \return El puntero al entorno asociado a esta base de datos. */ - operator st_mysql*() throw() { return a_mysql; } + operator st_mysql*() { return a_mysql; } private: Database& a_mysqlDatabase; @@ -55,12 +55,12 @@ private: Connection(Database& database, const std::string& name, const char* user, const char* password); - bool isAvailable() const throw(RuntimeException) { return a_mysql != NULL; } + bool isAvailable() const noexcept(false) { return a_mysql != NULL; } - void do_commit() throw(RuntimeException, DatabaseException); - void do_rollback() throw(); - void open() throw(DatabaseException); - void close() throw(); + void do_commit() noexcept(false); + void do_rollback() ; + void open() noexcept(false); + void close() ; friend class anna::dbms::mysql::Database; }; diff --git a/include/anna/dbms.mysql/Database.hpp b/include/anna/dbms.mysql/Database.hpp index b9ad79e..47d321d 100644 --- a/include/anna/dbms.mysql/Database.hpp +++ b/include/anna/dbms.mysql/Database.hpp @@ -49,7 +49,7 @@ public: * Devuelve el nombre de la máquina anfitriona indicado en el constructor. * \return El nombre de la máquina anfitriona indicado en el constructor. */ - const char* getHost() const throw() { return a_host; } + const char* getHost() const { return a_host; } /** Devuelve la cadena por la que podemos buscar el componente. @@ -61,21 +61,21 @@ public: private: char* a_host; - void do_initialize() throw(RuntimeException); + void do_initialize() noexcept(false); dbms::Connection* allocateConnection(const std::string& name, const char* user, const char* password) - throw(RuntimeException); + noexcept(false); dbms::Statement* allocateStatement(const char* name, const std::string& expression, const bool isCritical) - throw(RuntimeException); + noexcept(false); dbms::InputBind* allocateInputBind(const char* name, Data&) - throw(RuntimeException); - void deallocate(dbms::InputBind* inputBind) throw(); + noexcept(false); + void deallocate(dbms::InputBind* inputBind) ; dbms::OutputBind* allocateOutputBind(const char* name, Data&) - throw(RuntimeException); - void deallocate(dbms::OutputBind* outputBind) throw(); + noexcept(false); + void deallocate(dbms::OutputBind* outputBind) ; }; #ifdef ANNA_RDBMS_TRACE diff --git a/include/anna/dbms.mysql/InputBind.hpp b/include/anna/dbms.mysql/InputBind.hpp index 8f58e1e..f3f250b 100644 --- a/include/anna/dbms.mysql/InputBind.hpp +++ b/include/anna/dbms.mysql/InputBind.hpp @@ -32,19 +32,19 @@ public: virtual ~InputBind(); private: - void code() const throw(RuntimeException); + void code() const noexcept(false); - void codeShortBlock(dbms::Data&) throw(); - void codeDate(dbms::Data&) throw(); + void codeShortBlock(dbms::Data&) ; + void codeDate(dbms::Data&) ; static char asCharacter(const char byte) - throw() { + { return (byte >= 0 && byte <= 9) ? (byte + '0') : ((byte - 0xa) + 'A'); } /* Funciones virtuales puras */ - void prepare(anna::dbms::Statement*, anna::dbms::Connection*, const int pos) throw(RuntimeException); - void release(anna::dbms::Statement*) throw() {;} + void prepare(anna::dbms::Statement*, anna::dbms::Connection*, const int pos) noexcept(false); + void release(anna::dbms::Statement*) {;} friend class mysql::Statement; }; diff --git a/include/anna/dbms.mysql/OracleTranslator.hpp b/include/anna/dbms.mysql/OracleTranslator.hpp index 95573e1..6e1ead1 100644 --- a/include/anna/dbms.mysql/OracleTranslator.hpp +++ b/include/anna/dbms.mysql/OracleTranslator.hpp @@ -31,7 +31,7 @@ public: /** * Obtiene la instancia de este traductor de sentencias SQL. */ - static StatementTranslator* instantiate() throw() { return &st_this; } + static StatementTranslator* instantiate() { return &st_this; } private: char* a_buffer; @@ -43,8 +43,8 @@ private: a_buffer(NULL), a_size(-1) {;} - const char* apply(const char* statement) throw(RuntimeException); - void allocate(const char* statement) throw(); + const char* apply(const char* statement) noexcept(false); + void allocate(const char* statement) ; }; } diff --git a/include/anna/dbms.mysql/OutputBind.hpp b/include/anna/dbms.mysql/OutputBind.hpp index 72e9929..b8c2a29 100644 --- a/include/anna/dbms.mysql/OutputBind.hpp +++ b/include/anna/dbms.mysql/OutputBind.hpp @@ -43,19 +43,19 @@ private: Blob* a_blob; - void decodeLongBlob(dbms::Data&) const throw(RuntimeException, dbms::DatabaseException); - void decodeDate(dbms::Data&) throw(); + void decodeLongBlob(dbms::Data&) const noexcept(false); + void decodeDate(dbms::Data&) ; static unsigned char asByte(const char hex) - throw() { + { return (hex >= '0' && hex <= '9') ? (hex - '0') : ((hex - 'A') + 0x0a); } /* Funciones virtuales puras */ - void decode() const throw(RuntimeException); - void prepare(anna::dbms::Statement*, anna::dbms::Connection*, const int pos) throw(RuntimeException); - void release(anna::dbms::Statement*) throw() {;} - void do_write(const dbms::LongBlock&) const throw(RuntimeException, dbms::DatabaseException); + void decode() const noexcept(false); + void prepare(anna::dbms::Statement*, anna::dbms::Connection*, const int pos) noexcept(false); + void release(anna::dbms::Statement*) {;} + void do_write(const dbms::LongBlock&) const noexcept(false); friend class Statement; }; diff --git a/include/anna/dbms.mysql/ResultCode.hpp b/include/anna/dbms.mysql/ResultCode.hpp index 1c27be9..6b4c0e7 100644 --- a/include/anna/dbms.mysql/ResultCode.hpp +++ b/include/anna/dbms.mysql/ResultCode.hpp @@ -39,10 +39,10 @@ public: private: class ErrorDecoder : public dbms::ResultCode::ErrorDecoder { - bool notFound(const int errorCode) const throw(); - bool successful(const int errorCode) const throw(); - bool locked(const int errorCode) const throw(); - bool lostConnection(const int errorCode) const throw(); + bool notFound(const int errorCode) const ; + bool successful(const int errorCode) const ; + bool locked(const int errorCode) const ; + bool lostConnection(const int errorCode) const ; }; static ErrorDecoder st_errorDecoder; diff --git a/include/anna/dbms.mysql/Statement.hpp b/include/anna/dbms.mysql/Statement.hpp index 48c9f86..5c18b68 100644 --- a/include/anna/dbms.mysql/Statement.hpp +++ b/include/anna/dbms.mysql/Statement.hpp @@ -44,21 +44,21 @@ public: Operador de conversion. \return El puntero MYSQL_STMT de esta sentencia. */ - operator st_mysql_stmt*() throw() { return a_mysqlStmt; } + operator st_mysql_stmt*() { return a_mysqlStmt; } /** * Obtiene el array asociado a los valores de entrada. * \return El array asociado a los valores de entrada. * \warning Exclusivamente uso interno. */ - st_mysql_bind* getBindParams() throw() { return a_params; } + st_mysql_bind* getBindParams() { return a_params; } /** * Obtiene el array asociado a los valores de salida. * \return El array asociado a los valores de salida. * \warning Exclusivamente uso interno. */ - st_mysql_bind* getBindResults() throw() { return a_results; } + st_mysql_bind* getBindResults() { return a_results; } private: st_mysql_stmt* a_mysqlStmt; @@ -78,11 +78,11 @@ private: a_params(NULL), a_results(NULL) {} - st_mysql_bind* create(const int size, const char* whatis) throw(RuntimeException); + st_mysql_bind* create(const int size, const char* whatis) noexcept(false); - void prepare(dbms::Connection* connection) throw(RuntimeException, DatabaseException); - dbms::ResultCode execute(dbms::Connection* connection) throw(RuntimeException, DatabaseException); - bool fetch() throw(RuntimeException, DatabaseException); + void prepare(dbms::Connection* connection) noexcept(false); + dbms::ResultCode execute(dbms::Connection* connection) noexcept(false); + bool fetch() noexcept(false); friend class Database; }; diff --git a/include/anna/dbms.mysql/internal/sccs.hpp b/include/anna/dbms.mysql/internal/sccs.hpp index 4c8a529..a16b018 100644 --- a/include/anna/dbms.mysql/internal/sccs.hpp +++ b/include/anna/dbms.mysql/internal/sccs.hpp @@ -17,7 +17,7 @@ namespace mysql { class sccs { public: - static void activate() throw(); + static void activate() ; }; } diff --git a/include/anna/dbms.oracle/BaseBind.hpp b/include/anna/dbms.oracle/BaseBind.hpp index c99699c..37251f5 100644 --- a/include/anna/dbms.oracle/BaseBind.hpp +++ b/include/anna/dbms.oracle/BaseBind.hpp @@ -65,7 +65,7 @@ protected: BaseBind(const dbms::Data& data) ; - oci_param getOCIParam(Database&, Connection*, dbms::Data&) throw(RuntimeException); + oci_param getOCIParam(Database&, Connection*, dbms::Data&) noexcept(false); private: const Data::Type::_v a_type; diff --git a/include/anna/dbms.oracle/Connection.hpp b/include/anna/dbms.oracle/Connection.hpp index 2259d9e..340b5f9 100644 --- a/include/anna/dbms.oracle/Connection.hpp +++ b/include/anna/dbms.oracle/Connection.hpp @@ -42,13 +42,13 @@ public: Devuelve una cadena con la informacion referente a esta instancia. @return Una cadena con la informacion referente a esta instancia. */ - std::string asString() const throw(); + std::string asString() const ; /** Operador de conversion. \return El puntero al contexto asociado a este conexion. */ - operator OCISvcCtx*() throw() { return a_context; } + operator OCISvcCtx*() { return a_context; } private: Database& a_oracleDatabase; @@ -57,11 +57,11 @@ private: OCIServer* a_server; Connection(Database& database, const std::string& name, const char* user, const char* password); - bool isAvailable() const throw(RuntimeException) { return a_context != NULL && a_session != NULL && a_server != NULL; } - void do_commit() throw(RuntimeException, DatabaseException); - void do_rollback() throw(); - void open() throw(DatabaseException); - void close() throw(); + bool isAvailable() const noexcept(false) { return a_context != NULL && a_session != NULL && a_server != NULL; } + void do_commit() noexcept(false); + void do_rollback() ; + void open() noexcept(false); + void close() ; friend class anna::dbms::oracle::Database; }; diff --git a/include/anna/dbms.oracle/Database.hpp b/include/anna/dbms.oracle/Database.hpp index 39d9d5f..f9a3431 100644 --- a/include/anna/dbms.oracle/Database.hpp +++ b/include/anna/dbms.oracle/Database.hpp @@ -51,13 +51,13 @@ public: Devuelve el manejador de error asociado a esta base de datos. \return El manejador de error asociado a esta base de datos. */ - OCIError* getErrorHandler() throw() { return a_error; } + OCIError* getErrorHandler() { return a_error; } /** Operador de conversion. \return El puntero al entorno asociado a esta base de datos. */ - operator OCIEnv*() throw() { return a_env; } + operator OCIEnv*() { return a_env; } /** Devuelve la cadena por la que podemos buscar el componente. @@ -74,7 +74,7 @@ public: * * \warning Metodo exclusivamente de uso interno. */ - static char getDecimalPoint() throw() { return st_decimalPoint; } + static char getDecimalPoint() { return st_decimalPoint; } private: OCIEnv* a_env; @@ -82,23 +82,23 @@ private: static char st_decimalPoint; - void do_initialize() throw(RuntimeException); + void do_initialize() noexcept(false); dbms::Connection* allocateConnection(const std::string& name, const char* user, const char* password) - throw(RuntimeException); + noexcept(false); dbms::Statement* allocateStatement(const char* name, const std::string& expression, const bool isCritical) - throw(RuntimeException); + noexcept(false); dbms::InputBind* allocateInputBind(const char* name, Data&) - throw(RuntimeException); - void deallocate(dbms::InputBind* inputBind) throw(); + noexcept(false); + void deallocate(dbms::InputBind* inputBind) ; dbms::OutputBind* allocateOutputBind(const char* name, Data&) - throw(RuntimeException); - void deallocate(dbms::OutputBind* outputBind) throw(); + noexcept(false); + void deallocate(dbms::OutputBind* outputBind) ; - static void initializeDecimalPoint() throw(RuntimeException); + static void initializeDecimalPoint() noexcept(false); }; #ifdef ANNA_RDBMS_TRACE diff --git a/include/anna/dbms.oracle/Descriptor.hpp b/include/anna/dbms.oracle/Descriptor.hpp index af2395d..6d48df2 100644 --- a/include/anna/dbms.oracle/Descriptor.hpp +++ b/include/anna/dbms.oracle/Descriptor.hpp @@ -38,7 +38,7 @@ struct Descriptor { } virtual ~Descriptor(); - void allocate(Database&, Connection*, const int type) throw(RuntimeException); + void allocate(Database&, Connection*, const int type) noexcept(false); }; } diff --git a/include/anna/dbms.oracle/InputBind.hpp b/include/anna/dbms.oracle/InputBind.hpp index 3b0b6ee..9ac5e88 100644 --- a/include/anna/dbms.oracle/InputBind.hpp +++ b/include/anna/dbms.oracle/InputBind.hpp @@ -36,16 +36,16 @@ public: private: OCIBind* a_ociBind; - void code() const throw(RuntimeException); - void prepare(dbms::Statement*, dbms::Connection*, const int pos) throw(RuntimeException, DatabaseException); - void release(dbms::Statement*) throw() { a_ociBind = NULL; } + void code() const noexcept(false); + void prepare(dbms::Statement*, dbms::Connection*, const int pos) noexcept(false); + void release(dbms::Statement*) { a_ociBind = NULL; } - void codeFloat(dbms::Data&) const throw(); - void codeShortBlock(dbms::Data&) const throw(); - void codeDate(dbms::Data&) const throw(RuntimeException, DatabaseException); + void codeFloat(dbms::Data&) const ; + void codeShortBlock(dbms::Data&) const ; + void codeDate(dbms::Data&) const noexcept(false); static char asCharacter(const char byte) - throw() { + { return (byte >= 0 && byte <= 9) ? (byte + '0') : ((byte - 0xa) + 'A'); } diff --git a/include/anna/dbms.oracle/OutputBind.hpp b/include/anna/dbms.oracle/OutputBind.hpp index ce41a22..034d87d 100644 --- a/include/anna/dbms.oracle/OutputBind.hpp +++ b/include/anna/dbms.oracle/OutputBind.hpp @@ -31,19 +31,19 @@ public: private: OCIDefine* a_ociDefine; - void decode() const throw(anna::RuntimeException); - void prepare(dbms::Statement*, dbms::Connection*, const int pos) throw(DatabaseException); - void release(dbms::Statement*) throw() { a_ociDefine = NULL; } + void decode() const noexcept(false); + void prepare(dbms::Statement*, dbms::Connection*, const int pos) noexcept(false); + void release(dbms::Statement*) { a_ociDefine = NULL; } - void decodeFloat(dbms::Data&) const throw(RuntimeException); - void decodeShortBlock(dbms::Data&) const throw(RuntimeException); - void decodeLongBlock(dbms::Data&) const throw(RuntimeException); - void decodeDate(dbms::Data&) const throw(RuntimeException, DatabaseException); + void decodeFloat(dbms::Data&) const noexcept(false); + void decodeShortBlock(dbms::Data&) const noexcept(false); + void decodeLongBlock(dbms::Data&) const noexcept(false); + void decodeDate(dbms::Data&) const noexcept(false); - void do_write(const dbms::LongBlock&) const throw(RuntimeException, dbms::DatabaseException); + void do_write(const dbms::LongBlock&) const noexcept(false); static unsigned char asByte(const char hex) - throw() { + { return (hex >= '0' && hex <= '9') ? (hex - '0') : ((hex - 'A') + 0x0a); } diff --git a/include/anna/dbms.oracle/ResultCode.hpp b/include/anna/dbms.oracle/ResultCode.hpp index b9f8fd5..0593f0e 100644 --- a/include/anna/dbms.oracle/ResultCode.hpp +++ b/include/anna/dbms.oracle/ResultCode.hpp @@ -35,10 +35,10 @@ public: private: class ErrorDecoder : public dbms::ResultCode::ErrorDecoder { - bool notFound(const int errorCode) const throw(); - bool successful(const int errorCode) const throw(); - bool locked(const int errorCode) const throw() { return errorCode == 54; } - bool lostConnection(const int errorCode) const throw(); + bool notFound(const int errorCode) const ; + bool successful(const int errorCode) const ; + bool locked(const int errorCode) const { return errorCode == 54; } + bool lostConnection(const int errorCode) const ; }; static ErrorDecoder st_errorDecoder; diff --git a/include/anna/dbms.oracle/Statement.hpp b/include/anna/dbms.oracle/Statement.hpp index d959c0b..976dac2 100644 --- a/include/anna/dbms.oracle/Statement.hpp +++ b/include/anna/dbms.oracle/Statement.hpp @@ -43,7 +43,7 @@ public: Operador de conversion. \return El puntero OCI de esta sentencia. */ - operator OCIStmt*() throw() { return a_ociStmt; } + operator OCIStmt*() { return a_ociStmt; } private: OCIStmt* a_ociStmt; @@ -60,9 +60,9 @@ private: a_ociStmt(NULL), a_ociError(NULL) {} - void prepare(dbms::Connection* connection) throw(RuntimeException, DatabaseException); - dbms::ResultCode execute(dbms::Connection* connection) throw(RuntimeException, DatabaseException); - bool fetch() throw(RuntimeException, DatabaseException); + void prepare(dbms::Connection* connection) noexcept(false); + dbms::ResultCode execute(dbms::Connection* connection) noexcept(false); + bool fetch() noexcept(false); friend class Database; }; diff --git a/include/anna/dbms.oracle/internal/sccs.hpp b/include/anna/dbms.oracle/internal/sccs.hpp index fd02966..3687f5c 100644 --- a/include/anna/dbms.oracle/internal/sccs.hpp +++ b/include/anna/dbms.oracle/internal/sccs.hpp @@ -17,7 +17,7 @@ namespace oracle { class sccs { public: - static void activate() throw(); + static void activate() ; }; } diff --git a/include/anna/dbms/Bind.hpp b/include/anna/dbms/Bind.hpp index 5bc3b7b..1e10e70 100644 --- a/include/anna/dbms/Bind.hpp +++ b/include/anna/dbms/Bind.hpp @@ -25,16 +25,16 @@ class Data; class Bind { public: - dbms::Data& getData() throw() { return a_data; } - const dbms::Data& getData() const throw() { return a_data; } + dbms::Data& getData() { return a_data; } + const dbms::Data& getData() const { return a_data; } virtual void prepare(Statement* statement, Connection* connection, const int pos) - throw(RuntimeException, DatabaseException) = 0; + noexcept(false) = 0; - virtual void release(Statement* statement) throw() = 0; - virtual void code() const throw(RuntimeException) = 0; - virtual void decode() const throw(RuntimeException) = 0; - virtual std::string asString() const throw(); + virtual void release(Statement* statement) = 0; + virtual void code() const noexcept(false) = 0; + virtual void decode() const noexcept(false) = 0; + virtual std::string asString() const ; protected: Bind(const char* name, dbms::Data& data) : a_name(name), a_data(data) {;} diff --git a/include/anna/dbms/Connection.hpp b/include/anna/dbms/Connection.hpp index 4744128..178e833 100644 --- a/include/anna/dbms/Connection.hpp +++ b/include/anna/dbms/Connection.hpp @@ -40,25 +40,25 @@ public: /** Devuelve la instancia de la base de datos asociada a esta conexion. */ - Database& getDatabase() const throw() { return a_database; } + Database& getDatabase() const { return a_database; } /** * Devuelve el usuario con el que fué realizada esta conexión. * \return el usuario con el que fué realizada esta conexión. */ - const std::string& getUser() const throw() { return a_user; } + const std::string& getUser() const { return a_user; } /** * Devuelve el password del usuario con el que fué realizada esta conexión. * \return el password del usuario con el que fué realizada esta conexión. */ - const std::string& getPassword() const throw() { return a_password; } + const std::string& getPassword() const { return a_password; } /** * Establece el password del usuario de esta conexión * \param password Codigo de acceso del usuario. */ - void setPassword(const char* password) throw() { a_password = password; } + void setPassword(const char* password) { a_password = password; } /** Establece el periodo de grabacion de esta conexion. Damos la posibilidad de que la conexion confirme @@ -70,7 +70,7 @@ public: \warning La invocacion a este metodo debera hacerse con una seccion critica activada sobre la esta conexion. */ - int setMaxCommitPending(const int maxCommitPending) throw() { + int setMaxCommitPending(const int maxCommitPending) { const int result = a_maxCommitPending; a_maxCommitPending = maxCommitPending; return result; @@ -81,14 +81,14 @@ public: \warning La invocacion a este metodo debera hacerse con una seccion critica activada sobre la esta conexion. */ - void resetRollbackPending() throw() { a_rollbackPending = false; } + void resetRollbackPending() { a_rollbackPending = false; } /** Activa de forma externa el indicador de que la conexion requiere una invocacion a #rollback. \warning La invocacion a este metodo debera hacerse con una seccion critica activada sobre la esta conexion. */ - void activateRollbackPending() throw() { a_rollbackPending = true; } + void activateRollbackPending() { a_rollbackPending = true; } /** Ejecuta la sentencia recibida como parametro. Si la sentencia no tiene variables de salida consideraria @@ -106,20 +106,20 @@ public: connection.execute (someStatement); \endcode */ - ResultCode execute(Statement* statement) throw(RuntimeException, DatabaseException); + ResultCode execute(Statement* statement) noexcept(false); /** Devuelve una cadena con la informacion referente a esta instancia. @return Una cadena con la informacion referente a esta instancia. */ - virtual std::string asString() const throw(); + virtual std::string asString() const ; /** Devuelve un documento XML con la informacion referente a esta instancia. \param parent Nodo XML del que debe colgar la informacion. @return un documento XML con la informacion referente a esta instancia. */ - virtual xml::Node* asXML(xml::Node* parent) const throw(); + virtual xml::Node* asXML(xml::Node* parent) const ; protected: /** @@ -151,23 +151,23 @@ protected: /** Metodo que fija los cambios realizados en la ejecucion de los comandos SQL. */ - void commit() throw(RuntimeException, DatabaseException); + void commit() noexcept(false); /** Metodo que debemos re-escribir para descartar los cambios realizados sobre las tablas mediante esta conexion. */ - void rollback() throw(); + void rollback() ; /** Metodo que debemos re-escribir para hacer efectiva esta conexion. */ - virtual void open() throw(DatabaseException) = 0; + virtual void open() noexcept(false) = 0; /** Metodo que debemos re-escribir para cerrar la conexion. */ - virtual void close() throw() = 0; + virtual void close() = 0; private: int a_commitPending; // Numero de sentencias a las que no se han fijado cambios. @@ -177,13 +177,13 @@ private: Connection(const Connection&); - void initialize() throw(RuntimeException, DatabaseException); - void lock() throw(RuntimeException); - void unlock() throw(); + void initialize() noexcept(false); + void lock() noexcept(false); + void unlock() ; - virtual bool do_beginTransaction() throw(RuntimeException, DatabaseException) { return false;} - virtual void do_commit() throw(RuntimeException, DatabaseException) = 0; - virtual void do_rollback() throw() = 0; + virtual bool do_beginTransaction() noexcept(false) { return false;} + virtual void do_commit() noexcept(false) = 0; + virtual void do_rollback() = 0; friend class Database; }; diff --git a/include/anna/dbms/Data.hpp b/include/anna/dbms/Data.hpp index 03de108..9ddafed 100644 --- a/include/anna/dbms/Data.hpp +++ b/include/anna/dbms/Data.hpp @@ -42,30 +42,30 @@ public: Devuelve el tamano maximo de este dato que coincidiria con el indicado en el constructor. \return El tamano maximo de este dato que coincidiria con el indicado en el constructor. */ - int getMaxSize() const throw() { return a_maxSize; } + int getMaxSize() const { return a_maxSize; } /** Devuelve el tipo de dato. \return El tipo de datos. */ - Type::_v getType() const throw() { return a_type; } + Type::_v getType() const { return a_type; } /** Devuelve el area de memoria asociada a esta variable. */ - void* getBuffer() throw() { return a_buffer; } + void* getBuffer() { return a_buffer; } /** Devuelve el indicador de nulo de esta instancia. \return El indicador de nulo de esta instancia. */ - bool isNull() const throw() { return a_isNull; } + bool isNull() const { return a_isNull; } /** Devuelve el valor que indica si este dato puede tomar valores nulos. \return El valor que indica si este dato puede tomar valores nulos. */ - bool isNulleable() const throw() { return a_isNulleable; } + bool isNulleable() const { return a_isNulleable; } /** Establece el indicador de nulo de esta instancia. @@ -73,7 +73,7 @@ public: \warning Slo tendr�efecto en caso de haber indicado en el constructor que el dato puede tomar valores nulos. */ - void setNull(const bool isNull) throw() { if(a_isNulleable == true) a_isNull = isNull; } + void setNull(const bool isNull) { if(a_isNulleable == true) a_isNull = isNull; } /** Incorpora el método clear para todos tipos de datos con lo que podemos obtener información @@ -83,7 +83,7 @@ public: en otro caso se asignará un valor adecuado dependiendo del tipo del dato, cero para los números, "" para las cadenas, etc. */ - void clear() throw() { + void clear() { setNull(true); do_clear(); } @@ -92,7 +92,7 @@ public: Devuelve una cadena con la informacion referente a esta instancia. @return Una cadena con la informacion referente a esta instancia. */ - virtual std::string asString() const throw(); + virtual std::string asString() const ; protected: /** @@ -128,7 +128,7 @@ protected: Establece el area de memoria asociada a esta variable. \param buffer Direccion de memoria donde comienza el contenido esta variable. */ - void setBuffer(void* buffer) throw() { a_buffer = buffer; } + void setBuffer(void* buffer) { a_buffer = buffer; } private: const Type::_v a_type; @@ -137,7 +137,7 @@ private: void* a_buffer; bool a_isNull; - virtual void do_clear() throw() = 0; + virtual void do_clear() = 0; }; } diff --git a/include/anna/dbms/Database.hpp b/include/anna/dbms/Database.hpp index bbe46c5..f218085 100644 --- a/include/anna/dbms/Database.hpp +++ b/include/anna/dbms/Database.hpp @@ -49,7 +49,7 @@ public: Type() : value(Local) {;} Type(const _v v) : value(v) {;} Type(const Type& v) : value(v.value) {;} - operator int () const throw() { return value; } + operator int () const { return value; } }; typedef std::vector ::const_iterator const_connection_iterator; /**::iterator connection_iterator; /**(this)->a_value)); } + Second getSecondValue() const { return Second((Data::isNull() == true) ? 0 : mktime(&const_cast (this)->a_value)); } /** * Devuelve el formato indicado en el constructor de la clase. * \return El formato indicado en el constructor de la clase. */ - const char* getFormat() const throw() { return a_format; } + const char* getFormat() const { return a_format; } /** * Devuelve el año contenido por esta fecha. * \return El año contenido por esta fecha. */ - int getYear() const throw() { return a_value.tm_year + 1900; } + int getYear() const { return a_value.tm_year + 1900; } /** * Devuelve el mes contenido por esta fecha. * \return El mes contenido por esta fecha. */ - int getMonth() const throw() { return a_value.tm_mon + 1; } + int getMonth() const { return a_value.tm_mon + 1; } /** * Devuelve el dia del mes contenido por esta fecha. * \return El dia del mes contenido por esta fecha. */ - int getDay() const throw() { return a_value.tm_mday; } + int getDay() const { return a_value.tm_mday; } /** * Devuelve la hora del dia contenida en la fecha. * \return La hora del dia contenida en la fecha. * \warning Verifique que el tipo 'Date' de su RDBMS es capaz de contener horas, minutos y segundos. */ - int getHour() const throw() { return a_value.tm_hour; } + int getHour() const { return a_value.tm_hour; } /** * Devuelve el minuto de la hora contenida en la fecha. * \return El minuto de la hora contenida en la fecha. * \warning Verifique que el tipo 'Date' de su RDBMS es capaz de contener horas, minutos y segundos. */ - int getMinute() const throw() { return a_value.tm_min; } + int getMinute() const { return a_value.tm_min; } /** * Devuelve el segundo de la hora contenida en la fecha. * \return El segundo de la hora contenida en la fecha. * \warning Verifique que el tipo 'Date' de su RDBMS es capaz de contener horas, minutos y segundos. */ - int getSecond() const throw() { return a_value.tm_sec; } + int getSecond() const { return a_value.tm_sec; } /** * Establece el año de esta fecha * \param year Año de la fecha. Debe ser mayor de 1900. */ - void setYear(const int year) throw(RuntimeException) { set("Year", a_value.tm_year, year - 1900, 0, -1); } + void setYear(const int year) noexcept(false) { set("Year", a_value.tm_year, year - 1900, 0, -1); } /** * Establece mes de esta fecha. * \param month Mes de la fecha. Debe estar comprendido entre 1 y 12. */ - void setMonth(const int month) throw(RuntimeException) { set("Month", a_value.tm_mon, month - 1, 0, 11); } + void setMonth(const int month) noexcept(false) { set("Month", a_value.tm_mon, month - 1, 0, 11); } /** * Establece el dia del mes de esta fecha. * \param day Dia del mes. Debe estar comprendido entre 1 y 31. */ - void setDay(const int day) throw(RuntimeException) { set("Day", a_value.tm_mday, day, 1, 31); } + void setDay(const int day) noexcept(false) { set("Day", a_value.tm_mday, day, 1, 31); } /** * Establece la hora de esta fecha. * \param hour Hora del dia. Debe estar comprendida entre 0 y 23. * \warning Verifique que el tipo 'Date' de su RDBMS es capaz de contener horas, minutos y segundos. */ - void setHour(const int hour) throw(RuntimeException) { set("Hour", a_value.tm_hour, hour, 0, 23); } + void setHour(const int hour) noexcept(false) { set("Hour", a_value.tm_hour, hour, 0, 23); } /** * Establece el minuto de esta fecha. * \param minute Minuto de la hora del dia. Debe estar comprendida entre 0 y 59. * \warning Verifique que el tipo 'Date' de su RDBMS es capaz de contener horas, minutos y segundos. */ - void setMinute(const int minute) throw(RuntimeException) { set("Minute", a_value.tm_min, minute, 0, 59); } + void setMinute(const int minute) noexcept(false) { set("Minute", a_value.tm_min, minute, 0, 59); } /** * Establece el segundo de esta fecha. * \param second Segungo de la hora del dia. Debe estar comprendida entre 0 y 60. * \warning Verifique que el tipo 'Date' de su RDBMS es capaz de contener horas, minutos y segundos. */ - void setSecond(const int second) throw(RuntimeException) { set("Second", a_value.tm_sec, second, 0, 60); } + void setSecond(const int second) noexcept(false) { set("Second", a_value.tm_sec, second, 0, 60); } /** Interpreta la cadena recibida segun el formato indicado en el constructor y la asigna a esta instancia, pero requiere que al invocar al constructor de esta fecha se indique el formato usado para traducir. \param str Cadena de la que copiar. */ - void setValue(const char* str) throw(RuntimeException); + void setValue(const char* str) noexcept(false); /** Interpreta la cadena recibida segun el formato indicado en el constructor y la asigna a esta instancia, pero requiere que al invocar al constructor de esta fecha se indique el formato usado para traducir. \param str Cadena de la que copiar. */ - void setValue(const std::string& str) throw(RuntimeException) { setValue(str.c_str()); } + void setValue(const std::string& str) noexcept(false) { setValue(str.c_str()); } /** * Establece esta fecha con los segundos transcurridos desde el 1/1/1970. * \param second Numeros de segundos transcurridos desde el 1 de Enero de 1970. * \see anna::functions::second */ - void setValue(const Second &second) throw(RuntimeException); + void setValue(const Second &second) noexcept(false); /** Operador de copia. @@ -304,13 +304,13 @@ public: \return La instancia de esta fecha. \warning Solo copia el contenido de la fecha recibida, no cambia el formato de interpretacion de la fecha origen. */ - Date& operator = (const Date& date) throw(RuntimeException); + Date& operator = (const Date& date) noexcept(false); /** Devuelve una cadena con la informacion referente a esta instancia. \return Una cadena con la informacion referente a esta instancia. */ - virtual std::string asString() const throw(); + virtual std::string asString() const ; protected: char* a_format; @@ -326,8 +326,8 @@ protected: explicit Date(const Type::_v type, const bool isNulleable, const char* format); private: - void set(const char* what, int& variable, const int value, const int min, const int max) throw(RuntimeException); - void do_clear() throw() { anna_memset(&a_value, 0, sizeof(a_value)); } + void set(const char* what, int& variable, const int value, const int min, const int max) noexcept(false); + void do_clear() { anna_memset(&a_value, 0, sizeof(a_value)); } }; } diff --git a/include/anna/dbms/Delivery.hpp b/include/anna/dbms/Delivery.hpp index 6cd4603..baf758e 100644 --- a/include/anna/dbms/Delivery.hpp +++ b/include/anna/dbms/Delivery.hpp @@ -44,13 +44,13 @@ public: \warning Recordar que el numero maximo de conexiones a una base de datos esta limitado por Database::maxConnection. */ void createConnections(Database& database, const char* prefixName, const char* user, const char* password, const int n) - throw(RuntimeException, DatabaseException); + noexcept(false); /** Incorpora al conexion recibida como parametro a la agrupacion logica. \param connection Conexion que vamos a incorporar a la agrupacion logica. */ - void addConnection(Connection* connection) throw(RuntimeException) { + void addConnection(Connection* connection) noexcept(false) { this->add(connection); a_iiConnection = this->begin(); } @@ -62,13 +62,13 @@ public: cualquier otro thread que intente acceder a ella queda bloqueado a la espera de que terminemos de trabajar sobre ella. */ - Connection& getConnection() throw(RuntimeException); + Connection& getConnection() noexcept(false); private: iterator a_iiConnection; - void do_initialize() throw() { a_iiConnection = begin(); } - comm::Resource* do_apply() throw(RuntimeException); + void do_initialize() { a_iiConnection = begin(); } + comm::Resource* do_apply() noexcept(false); static Connection* connection(iterator& ii) { return (Connection*) comm::Delivery::resource(ii); } }; diff --git a/include/anna/dbms/FailRecoveryHandler.hpp b/include/anna/dbms/FailRecoveryHandler.hpp index 7519854..eb1709e 100644 --- a/include/anna/dbms/FailRecoveryHandler.hpp +++ b/include/anna/dbms/FailRecoveryHandler.hpp @@ -30,7 +30,7 @@ protected: \warning Este metodo se invocara automaticamente desde anna::dbms::Database::recover. */ - virtual void apply(Connection& connection, const int tryCounter) throw(RuntimeException) = 0; + virtual void apply(Connection& connection, const int tryCounter) noexcept(false) = 0; friend class Database; }; diff --git a/include/anna/dbms/Float.hpp b/include/anna/dbms/Float.hpp index 427668e..095e25e 100644 --- a/include/anna/dbms/Float.hpp +++ b/include/anna/dbms/Float.hpp @@ -49,26 +49,26 @@ public: \return el contenido del campo de tipo Float. \warning Si el metodo Data::isNull devolvio \em true el resultado de este metodo no esta definido. */ - //float getFloatValue () const throw () { return getValue (); } + //float getFloatValue () const { return getValue (); } /** * Devuelve el valor asociado a este campo. * \return Devuelve el valor asociado a este campo. */ - float getValue() const throw() { return a_value; } + float getValue() const { return a_value; } /** * Devuelve el formato que indica la forma en la que el número será representado sobre * una cadena, en caso de que fuera necesario. */ - const char* getFormat() const throw() { return a_format; } + const char* getFormat() const { return a_format; } /** Operador de copia. \param other Float del que copiar. \return La instancia de esta cadena. */ - Float& operator = (const Float& other) throw(RuntimeException) { + Float& operator = (const Float& other) noexcept(false) { if(this != &other) { setNull(other.isNull()); a_value = other.a_value; @@ -82,7 +82,7 @@ public: \param value Float del que copiar. \return La instancia de esta cadena. */ - Float& operator = (const float value) throw(RuntimeException) { + Float& operator = (const float value) noexcept(false) { a_value = value; setNull(false); return *this; @@ -93,19 +93,19 @@ public: \warning Si la columna asociada tiene un valor NULL, devolvera 0.0. \return El contenido de esta cadena. */ - operator float() const throw() { return getValue(); } + operator float() const { return getValue(); } /** Devuelve una cadena con la informacion referente a esta instancia. \return Una cadena con la informacion referente a esta instancia. */ - std::string asString() const throw(); + std::string asString() const ; private: float a_value; const char* a_format; - void do_clear() throw() { a_value = 0.0; } + void do_clear() { a_value = 0.0; } }; } diff --git a/include/anna/dbms/InputBind.hpp b/include/anna/dbms/InputBind.hpp index 069fb22..595c4c6 100644 --- a/include/anna/dbms/InputBind.hpp +++ b/include/anna/dbms/InputBind.hpp @@ -22,7 +22,7 @@ protected: private: // Éste metodo no sera invocado nunca. A partir de un Input nunca hay que // convertir de C++ -> RDBMS - void decode() const throw(RuntimeException) {;} + void decode() const noexcept(false) {;} }; } diff --git a/include/anna/dbms/Integer.hpp b/include/anna/dbms/Integer.hpp index ce98691..361fba0 100644 --- a/include/anna/dbms/Integer.hpp +++ b/include/anna/dbms/Integer.hpp @@ -44,7 +44,7 @@ public: Devuelve el valor entero asociado a esta instancia. \return El valor entero asociado a esta instancia. */ - int getValue() const throw() { return a_value; } + int getValue() const { return a_value; } /** Operador de asignacin entero. @@ -52,7 +52,7 @@ public: \return La referencia a esta instancia. */ Integer& operator = (const int i) - throw() { + { a_value = i; Data::setNull(false); return *this; @@ -64,7 +64,7 @@ public: \return La referencia a esta instancia. */ Integer& operator = (const Integer& other) - throw() { + { if(this != &other) { setNull(other.isNull()); a_value = other.a_value; @@ -77,18 +77,18 @@ public: Operador de conversion. \return El valor entero asociado a esta instancia. */ - operator int () const throw() { return a_value; } + operator int () const { return a_value; } /** Devuelve una cadena con la informacion referente a esta instancia. @return Una cadena con la informacion referente a esta instancia. */ - std::string asString() const throw(); + std::string asString() const ; private: int a_value; - void do_clear() throw() { a_value = 0; } + void do_clear() { a_value = 0; } }; } diff --git a/include/anna/dbms/LongBlock.hpp b/include/anna/dbms/LongBlock.hpp index d0cb9c0..2dab54f 100644 --- a/include/anna/dbms/LongBlock.hpp +++ b/include/anna/dbms/LongBlock.hpp @@ -61,58 +61,58 @@ public: Devuelve el tamao actual de este dato. \return El tamao actual de este dato. */ - int getSize() const throw() { return a_value.getSize(); } + int getSize() const { return a_value.getSize(); } /** Devuelve el contenido de la este bloque de memoria. \return Devuelve el contenido de la este bloque de memoria. \warning Si el metodo Data::isNull devolvio \em true el resultado de este metodo no esta definido. */ - const anna::DataBlock& getValue() const throw() { return a_value; } + const anna::DataBlock& getValue() const { return a_value; } /** Devuelve el contenido de la este bloque de memoria. \return Devuelve el contenido de la este bloque de memoria. \warning Si el metodo Data::isNull devolvio \em true el resultado de este metodo no esta definido. */ - anna::DataBlock& getValue() throw() { return a_value; } + anna::DataBlock& getValue() { return a_value; } /** Operador de asignacin. \param other Bloque del que copiar. \return La instancia de este bloque de memoria. */ - LongBlock& operator = (const LongBlock& other) throw(RuntimeException); + LongBlock& operator = (const LongBlock& other) noexcept(false); /** Operador de asignacin. \param value Valor que queremos a asignar. \return La instancia de esta cadena. */ - LongBlock& operator = (const anna::DataBlock& value) throw(RuntimeException); + LongBlock& operator = (const anna::DataBlock& value) noexcept(false); /** Operador de conversion. \return El anna::DataBlock asociado a esta instancia. */ - operator anna::DataBlock& () throw() { return a_value; } + operator anna::DataBlock& () { return a_value; } /** Operador de conversion. \return El anna::DataBlock asociado a esta instancia. */ - operator const anna::DataBlock& () const throw() { return a_value; } + operator const anna::DataBlock& () const { return a_value; } /** Devuelve una cadena con la informacion referente a esta instancia. \return Una cadena con la informacion referente a esta instancia. */ - std::string asString() const throw(); + std::string asString() const ; protected: anna::DataBlock a_value; - void do_clear() throw() { a_value.clear(); } + void do_clear() { a_value.clear(); } }; } diff --git a/include/anna/dbms/OutputBind.hpp b/include/anna/dbms/OutputBind.hpp index e0c7c70..76c78fa 100644 --- a/include/anna/dbms/OutputBind.hpp +++ b/include/anna/dbms/OutputBind.hpp @@ -33,7 +33,7 @@ public: \warning Este metodo solo puede ser usado para variables de tipo dbms::Data::Type::LongBlock y siempre y cuando hayamos abierto el BLOB con una sentencia SQL de seleccion. */ - void write() const throw(RuntimeException, dbms::DatabaseException); + void write() const noexcept(false); protected: OutputBind(const char* name, dbms::Data& value) : Bind(name, value) {;} @@ -41,9 +41,9 @@ protected: private: // este metodo no sera invocado nunca. A partir de un Output nunca hay que // convertir de C++ -> RDBMS - void code() const throw(RuntimeException) {;} + void code() const noexcept(false) {;} - virtual void do_write(const dbms::LongBlock&) const throw(RuntimeException, dbms::DatabaseException) = 0; + virtual void do_write(const dbms::LongBlock&) const noexcept(false) = 0; }; } diff --git a/include/anna/dbms/ResultCode.hpp b/include/anna/dbms/ResultCode.hpp index 6489594..ef23bf3 100644 --- a/include/anna/dbms/ResultCode.hpp +++ b/include/anna/dbms/ResultCode.hpp @@ -54,13 +54,13 @@ public: Devuelve el codigo de error del ultimo comando ejecutado contra la base de datos. @return El codigo de error del ultimo comando ejecutado contra la base de datos. */ - int getErrorCode() const throw() { return a_errorCode; } + int getErrorCode() const { return a_errorCode; } /** Devuelve el texto del error del ultimo comando ejecutado contra la base de datos. @return El texto del error del ultimo comando ejecutado contra la base de datos. */ - const char* getErrorText() const throw() { return (a_errorText != NULL) ? a_errorText : ""; } + const char* getErrorText() const { return (a_errorText != NULL) ? a_errorText : ""; } // Operadores /** @@ -69,7 +69,7 @@ public: @return Una instancia de si mismo. */ ResultCode& operator = (const ResultCode& resultCode) - throw() { + { if(this != &resultCode) { a_errorDecoder = resultCode.a_errorDecoder; set(resultCode.a_errorCode, resultCode.a_errorText); @@ -84,7 +84,7 @@ public: @return \em true si las condiciones de busqueda de la ultimo operacion no han sido satisfechas por ningun registro o \em false en otro caso. */ - bool notFound() const throw(anna::RuntimeException); + bool notFound() const noexcept(false); /** Devuelve \em true si la ultima operacion solicitada fue realizada correctamente @@ -92,7 +92,7 @@ public: @return \em true si la ultima operacion solicitada fue realizada correctamente o \em false en otro caso. */ - bool successful() const throw(anna::RuntimeException); + bool successful() const noexcept(false); /** Devuelve \em true Si el registro obtenenido en una sentencia de seleccion con indicador @@ -102,19 +102,19 @@ public: de modo exclusivo ha sido bloqueada previamente por otro proceso y/o contexto de base de datos o \em false en otro caso. */ - bool locked() const throw(anna::RuntimeException); + bool locked() const noexcept(false); /** Devuelve \em true si se perdio la conexion la base de datos o \em false en otro caso. @return \em true si se perdio la conexion la base de datos o \em false en otro caso. */ - bool lostConnection() const throw(anna::RuntimeException); + bool lostConnection() const noexcept(false); /** Devuelve una cadena con la informacion sobre esta clase. \return Una cadena con la informacion sobre esta clase. */ - std::string asString() const throw(); + std::string asString() const ; protected: static const int MaxErrorLen = 512; @@ -125,10 +125,10 @@ protected: */ class ErrorDecoder { public: - virtual bool notFound(const int errorCode) const throw() = 0; - virtual bool successful(const int errorCode) const throw() = 0; - virtual bool locked(const int errorCode) const throw() = 0; - virtual bool lostConnection(const int errorCode) const throw() = 0; + virtual bool notFound(const int errorCode) const = 0; + virtual bool successful(const int errorCode) const = 0; + virtual bool locked(const int errorCode) const = 0; + virtual bool lostConnection(const int errorCode) const = 0; }; /** @@ -152,7 +152,7 @@ protected: \param errorText Texto asociado al error de ultima operacion realizada contra la base de datos. */ void set(const int errorCode, const char* errorText) - throw() { + { a_errorCode = errorCode; copy(errorText); } @@ -162,7 +162,7 @@ private: char* a_errorText; const ErrorDecoder* a_errorDecoder; - void copy(const char* text) throw(); + void copy(const char* text) ; }; } diff --git a/include/anna/dbms/Sentence.hpp b/include/anna/dbms/Sentence.hpp index 39d045e..7c7ec4a 100644 --- a/include/anna/dbms/Sentence.hpp +++ b/include/anna/dbms/Sentence.hpp @@ -42,7 +42,7 @@ public: activar una seccion critica sobre esta instancia. \param connection Conexion usada para ejecutar la sentencia. Debe tener activa una seccion critica. */ - virtual dbms::ResultCode execute(dbms::Connection& connection) throw(RuntimeException) { + virtual dbms::ResultCode execute(dbms::Connection& connection) noexcept(false) { return execute(connection, a_dbStatement); } @@ -51,27 +51,27 @@ public: \return El nombre de la sentencia SQL asociada a esta instancia. \warning Si todavia no tiene nombre asociado devolvera una cadena vacia. */ - const std::string& getName() const throw(); + const std::string& getName() const ; /** Inicializa el estado de esta instancia \param database Instancia de la base de datos usada para definir las sentencias SQL que componen esta instancia. */ - void initialize(dbms::Database& database) throw(RuntimeException); + void initialize(dbms::Database& database) noexcept(false); /** Transfiere un registro desde la base de datos a las variables del entorno C++. \return \em false si no hay mas registros o \em true en caso contrario. */ - bool fetch() throw(RuntimeException); + bool fetch() noexcept(false); /** Transfiere un registro desde la base de datos a las variables del entorno C++. \param resultCode Variable que contiene el resultado de invocar a anna::dbms::Sentence::execute \return \em false si no hay mas registros o \em true en caso contrario. */ - bool fetch(const ResultCode& resultCode) throw(RuntimeException) { + bool fetch(const ResultCode& resultCode) noexcept(false) { return (resultCode.successful() == true) ? fetch() : false; } @@ -79,14 +79,14 @@ public: Devuelve una cadena con la informacion referente a esta instancia. \return una cadena con la informacion referente a esta instancia. */ - virtual std::string asString() const throw(); + virtual std::string asString() const ; /** Devuelve un documento XML con la informacion referente a esta instancia. \param parent Nodo XML del que dependerá la información referente a esta instancia. \return un documento XML con la informacion referente a esta instancia. */ - virtual xml::Node* asXML(xml::Node* parent) const throw(); + virtual xml::Node* asXML(xml::Node* parent) const ; protected: /** @@ -102,13 +102,13 @@ protected: \param connection Conexion usada para ejecutar la sentencia. Debe tener activa una seccion critica. \param statement Sentencia a ejecutar. */ - dbms::ResultCode execute(dbms::Connection& connection, dbms::Statement* statement) throw(RuntimeException); + dbms::ResultCode execute(dbms::Connection& connection, dbms::Statement* statement) noexcept(false); /** Metodo que debe inicializar las sentencias asociadas a esta instancia (valores de entrada y salida). \return Retorna la instancia de la sentencia asociada a esta instancia debidamente inicializada. */ - virtual dbms::Statement* do_initialize(dbms::Database&) throw(RuntimeException) = 0; + virtual dbms::Statement* do_initialize(dbms::Database&) noexcept(false) = 0; private: const Mode::_v a_mode; diff --git a/include/anna/dbms/ShortBlock.hpp b/include/anna/dbms/ShortBlock.hpp index cf22c7b..8966cf7 100644 --- a/include/anna/dbms/ShortBlock.hpp +++ b/include/anna/dbms/ShortBlock.hpp @@ -63,46 +63,46 @@ public: Devuelve el tamao actual de este dato. \return El tamao actual de este dato. */ - int getSize() const throw() { return a_value.getSize(); } + int getSize() const { return a_value.getSize(); } /** Devuelve el contenido de la este bloque de memoria. \return Devuelve el contenido de la este bloque de memoria. \warning Si el metodo Data::isNull devolvio \em true el resultado de este metodo no esta definido. */ - const anna::DataBlock& getValue() const throw() { return a_value; } + const anna::DataBlock& getValue() const { return a_value; } /** Operador de asignacin. \param other Bloque del que copiar. \return La instancia de este bloque de memoria. */ - ShortBlock& operator = (const ShortBlock& other) throw(RuntimeException); + ShortBlock& operator = (const ShortBlock& other) noexcept(false); /** Operador de asignacin. \param value Valor que queremos a asignar. \return La instancia de esta cadena. */ - ShortBlock& operator = (const anna::DataBlock& value) throw(RuntimeException); + ShortBlock& operator = (const anna::DataBlock& value) noexcept(false); /** Operador de conversion. \return El anna::DataBlock asociado a esta instancia. */ - operator anna::DataBlock& () throw() { return a_value; } + operator anna::DataBlock& () { return a_value; } /** Operador de conversion. \return El anna::DataBlock asociado a esta instancia. */ - operator const anna::DataBlock& () const throw() { return a_value; } + operator const anna::DataBlock& () const { return a_value; } /** Devuelve una cadena con la informacion referente a esta instancia. \return Una cadena con la informacion referente a esta instancia. */ - std::string asString() const throw(); + std::string asString() const ; protected: anna::DataBlock a_value; diff --git a/include/anna/dbms/Statement.hpp b/include/anna/dbms/Statement.hpp index df20293..bd24559 100644 --- a/include/anna/dbms/Statement.hpp +++ b/include/anna/dbms/Statement.hpp @@ -54,13 +54,13 @@ public: Devuelve el nombre logico de esta sentencia. \return El nombre logico de esta sentencia. */ - const std::string& getName() const throw() { return a_name; } + const std::string& getName() const { return a_name; } /** Devuelve la expresion SQL recibida en el constructor. \return La expresion SQL recibida en el constructor. */ - const std::string& getExpression() const throw() { return a_expression; } + const std::string& getExpression() const { return a_expression; } /** Devuelve el indicador de criticidad, si vale \em true indica que si la ejecucion de esta sentencia @@ -69,13 +69,13 @@ public: Solo aplicara en sentencias que no sean de seleccion. \return El indicador de criticidad de esta sentencia. */ - bool isCritical() const throw() { return a_isCritical; } + bool isCritical() const { return a_isCritical; } /** Devuelve la instancia de la base de datos asociada a esta sentencia. \return La instancia de la base de datos asociada a la sentencia. */ - Database& getDatabase() const throw() { return a_database; } + Database& getDatabase() const { return a_database; } /** Establece el parametro de entrada de la sentencia SQL.Cada una de las variables de entrada indicadas @@ -97,7 +97,7 @@ public: \param data Variable que deseamos asociar como variable de entrada. La correspondencia entre esta y la sentencia SQL vendra dada por el orden de declaracion. */ - void bindInput(const char* name, Data& data) throw(); + void bindInput(const char* name, Data& data) ; /** Establece el parametro de salida de la sentencia SQL.Cada una de las variables de salida indicadas @@ -124,13 +124,13 @@ public: \warning Solo las sentencias SQL del tipo \em select usan las variables de salida. */ - const dbms::OutputBind* bindOutput(const char* name, Data& data) throw(); + const dbms::OutputBind* bindOutput(const char* name, Data& data) ; /** Establece el valor del indicador que activa/desactiva la necesidad de invocar al \em commit y/o \em rollback despues de ejecutar esta sentencia. */ - void setRequiresCommit(const bool requiresCommit) throw() { a_requiresCommit = requiresCommit; } + void setRequiresCommit(const bool requiresCommit) { a_requiresCommit = requiresCommit; } /** Devuelve \em true si la sentencia requiere la invocacion a \em commit o \em rollback @@ -138,56 +138,56 @@ public: de salida (insert, update o delete) o bien porque se haya activado el indicador correspondiente mediante la llamada #setRequiresCommit */ - bool requiresCommit() const throw() { return (a_requiresCommit == true) || (a_outputBinds.empty() == true); } + bool requiresCommit() const { return (a_requiresCommit == true) || (a_outputBinds.empty() == true); } /** Devuelve el iterador que apunta a la primera variable de entrada. \return el iterador que apunta a la primera variable de entrada. */ - input_iterator input_begin() throw() { return a_inputBinds.begin(); } + input_iterator input_begin() { return a_inputBinds.begin(); } /** Devuelve el iterador que apunta a la primera variable de entrada. \return el iterador que apunta a la primera variable de entrada. */ - input_iterator input_end() throw() { return a_inputBinds.end(); } + input_iterator input_end() { return a_inputBinds.end(); } /** Devuelve el numero de variables de entrada asociado a esta sentencia SQL. \return el numero de variables de entrada asociado a esta sentencia SQL. */ - int input_size() const throw() { return a_inputBinds.size(); } + int input_size() const { return a_inputBinds.size(); } /** Devuelve el iterador que apunta a la primera variable de salida. \return el iterador que apunta a la primera variable de salida. */ - output_iterator output_begin() throw() { return a_outputBinds.begin(); } + output_iterator output_begin() { return a_outputBinds.begin(); } /** Devuelve el iterador que apunta a la primera variable de salida. \return el iterador que apunta a la primera variable de salida. */ - output_iterator output_end() throw() { return a_outputBinds.end(); } + output_iterator output_end() { return a_outputBinds.end(); } /** Devuelve el numero de variables de entrada asociado a esta sentencia SQL. \return el numero de variables de entrada asociado a esta sentencia SQL. */ - int output_size() const throw() { return a_outputBinds.size(); } + int output_size() const { return a_outputBinds.size(); } /** Devuelve un documento XML con la informacion referente a esta instancia. \param parent Nodo XML del que debe colgar la informacion. @return un documento XML con la informacion referente a esta instancia. */ - virtual xml::Node* asXML(xml::Node* parent) const throw(); + virtual xml::Node* asXML(xml::Node* parent) const ; /** Devuelve una cadena con la informacion referente a esta instancia. @return Una cadena con la informacion referente a esta instancia. */ - virtual std::string asString() const throw(); + virtual std::string asString() const ; /** Transfiere la informacion de una fila de la sentencia SQL de seleccion a las @@ -196,19 +196,19 @@ public: \return \em true si el registro ha sido transferido a las variables de salida o \em false si habiamos llegado al ultimo registro de la seleccion. */ - virtual bool fetch() throw(RuntimeException, DatabaseException) = 0; + virtual bool fetch() noexcept(false) = 0; /** Devuelve la variable de entrada apuntada por el iterador recibido como parametro. \return la variable de entrada apuntada por el iterador recibido como parametro. */ - static Data& input(input_iterator& ii) throw(); + static Data& input(input_iterator& ii) ; /** Devuelve la variable de salida apuntada por el iterador recibido como parametro. \return la variable de salida apuntada por el iterador recibido como parametro. */ - static Data& output(output_iterator& ii) throw(); + static Data& output(output_iterator& ii) ; protected: /** @@ -256,13 +256,13 @@ protected: Devuelve la referencia de entrada apuntada por el iterador recibido como parametro. \return la referencia de entrada apuntada por el iterador recibido como parametro. */ - static InputBind* inputBind(input_iterator& ii) throw() { return *ii; } + static InputBind* inputBind(input_iterator& ii) { return *ii; } /** Devuelve la referencia de salida apuntada por el iterador recibido como parametro. \return la referencia de salida apuntada por el iterador recibido como parametro. */ - static OutputBind* outputBind(output_iterator& ii) throw() { return *ii; } + static OutputBind* outputBind(output_iterator& ii) { return *ii; } private: Database& a_database; @@ -276,10 +276,10 @@ private: bool a_requiresCommit; Statement(const Statement&); - void measureTiming(const Microsecond & init, const Microsecond & end) throw() { a_measureTiming += (end - init); } + void measureTiming(const Microsecond & init, const Microsecond & end) { a_measureTiming += (end - init); } - virtual void prepare(Connection* connection) throw(RuntimeException, DatabaseException) = 0; - virtual ResultCode execute(Connection* connection) throw(RuntimeException, DatabaseException) = 0; + virtual void prepare(Connection* connection) noexcept(false) = 0; + virtual ResultCode execute(Connection* connection) noexcept(false) = 0; friend class Connection; friend class Database; diff --git a/include/anna/dbms/StatementTranslator.hpp b/include/anna/dbms/StatementTranslator.hpp index 8610aaa..dc28a5a 100644 --- a/include/anna/dbms/StatementTranslator.hpp +++ b/include/anna/dbms/StatementTranslator.hpp @@ -46,7 +46,7 @@ class StatementTranslator { * Devuelve el nombre lógico de este traductor. * \return el nombre lógico de este traductor. */ - const char* getName() const throw() { return a_name; } + const char* getName() const { return a_name; } protected: /** @@ -68,7 +68,7 @@ protected: * pueda ser interpretada correctamente por el motor de base de datos sobre el que * se va a ejecutar. */ - virtual const char* apply(const char* statement) throw(RuntimeException) = 0; + virtual const char* apply(const char* statement) noexcept(false) = 0; private: const char* a_name; diff --git a/include/anna/dbms/String.hpp b/include/anna/dbms/String.hpp index a591eed..cc96f88 100644 --- a/include/anna/dbms/String.hpp +++ b/include/anna/dbms/String.hpp @@ -56,7 +56,7 @@ public: \return El contenido de la cadena. \warning Si el metodo Data::isNull devolvio \em true el resultado de este metodo no esta definido. */ - const char* getValue() const throw() { return a_value; } + const char* getValue() const { return a_value; } /** Operador de copia. @@ -64,7 +64,7 @@ public: indicado en el constructor obtendremos una excepcin. \return La instancia de esta cadena. */ - String& operator = (const String& str) throw(RuntimeException); + String& operator = (const String& str) noexcept(false); /** Operador de asignacin. @@ -72,7 +72,7 @@ public: indicado en el constructor obtendremos una excepcin. \return La instancia de esta cadena. */ - String& operator = (const char* str) throw(RuntimeException); + String& operator = (const char* str) noexcept(false); /** Operador de asignacin. @@ -80,31 +80,31 @@ public: indicado en el constructor obtendremos una excepcin. \return La instancia de esta cadena. */ - String& operator = (const std::string& str) throw(RuntimeException) { return operator= (str.c_str()); } + String& operator = (const std::string& str) noexcept(false) { return operator= (str.c_str()); } /** Operador de conversion. si el contenido de la columna sociada fue nulo este metodo devolvera NULL. \return El contenido de esta cadena. */ - operator const char*() const throw() { return (Data::isNull() == true) ? NULL : a_value; } + operator const char*() const { return (Data::isNull() == true) ? NULL : a_value; } /** Elimina los espacios a la derecha de la cadena recibida. \return La misma cadena recibida pero con los espacios eliminados. */ - static char* strip(char *str) throw(); + static char* strip(char *str) ; /** Devuelve una cadena con la informacion referente a esta instancia. \return Una cadena con la informacion referente a esta instancia. */ - virtual std::string asString() const throw(); + virtual std::string asString() const ; private: char* a_value; - void do_clear() throw() { a_value [0] = 0; } + void do_clear() { a_value [0] = 0; } }; } diff --git a/include/anna/dbms/TimeStamp.hpp b/include/anna/dbms/TimeStamp.hpp index 9f53aea..360a7d5 100644 --- a/include/anna/dbms/TimeStamp.hpp +++ b/include/anna/dbms/TimeStamp.hpp @@ -139,20 +139,20 @@ public: * Devuelve la parte fraccionaria de los segundos asociados a este objeto. * \return La parte fraccionaria de los segundos asociados a este objeto. */ - int getFractionalSecond() const throw() { return a_fractionalSecond; } + int getFractionalSecond() const { return a_fractionalSecond; } /** * Establece la parte fraccionaria de los segundos de este objeto. * \param fsec Parte fraccionaria de los segundos. */ - void setFractionalSecond(const int fsec) throw() { a_fractionalSecond = fsec; } + void setFractionalSecond(const int fsec) { a_fractionalSecond = fsec; } /** * Interpreta el contenido de la fecha y lo transfiere al buffer. * \return El buffer que contiene esta fecha interpretada con el formato indicado en el contructor. * \warning El resultado sera NULL en caso de no poder interpretar correctamente la fecha. */ - virtual const char* getCStringValue() const throw(); + virtual const char* getCStringValue() const ; /** Operador de copia. @@ -160,7 +160,7 @@ public: \return La instancia de esta fecha. \warning Solo copia el contenido de la fecha recibida, no cambia el formato de interpretacion de la fecha origen. */ - TimeStamp& operator = (const TimeStamp& timeStamp) throw(RuntimeException) { + TimeStamp& operator = (const TimeStamp& timeStamp) noexcept(false) { Date::operator= (timeStamp); a_fractionalSecond = timeStamp.a_fractionalSecond; return *this; @@ -172,13 +172,13 @@ public: \return La instancia de esta fecha. \warning Solo copia el contenido de la fecha recibida, no cambia el formato de interpretacion de la fecha origen. */ - TimeStamp& operator = (const Date& date) throw(RuntimeException) { Date::operator= (date); a_fractionalSecond = 0; return *this; } + TimeStamp& operator = (const Date& date) noexcept(false) { Date::operator= (date); a_fractionalSecond = 0; return *this; } private: char a_anotherBuffer [MaxDateSize + 1]; int a_fractionalSecond; - void do_clear() throw() { a_fractionalSecond = 0; a_anotherBuffer [0] = 0; } + void do_clear() { a_fractionalSecond = 0; a_anotherBuffer [0] = 0; } }; } diff --git a/include/anna/dbms/functions.hpp b/include/anna/dbms/functions.hpp index e782d34..685b429 100644 --- a/include/anna/dbms/functions.hpp +++ b/include/anna/dbms/functions.hpp @@ -73,7 +73,7 @@ public: * \code * //static * void axe::storage::functions::verifyDataScheme (dbms::Connection& connection) - * throw (RuntimeException) + * noexcept(false) * { * anna::dbms::functions::verifyDataScheme (connection, "axe_dataScheme", "v1.3"); * } @@ -87,7 +87,7 @@ public: * \param columnDate Nombre de la columna que contiene la fecha de instalación de cada parche. */ static void verifyDataScheme(dbms::Connection& connection, const char* tableName, const char* requiredPatch, const char* columnID = "id", const char* columnDate = "installation_date") - throw(RuntimeException); + noexcept(false); }; } diff --git a/include/anna/dbms/internal/sccs.hpp b/include/anna/dbms/internal/sccs.hpp index d518c6a..df3bd38 100644 --- a/include/anna/dbms/internal/sccs.hpp +++ b/include/anna/dbms/internal/sccs.hpp @@ -15,7 +15,7 @@ namespace dbms { class sccs { public: - static void activate() throw(); + static void activate() ; }; } diff --git a/include/anna/dbos/Accesor.hpp b/include/anna/dbos/Accesor.hpp index a719c51..0533649 100644 --- a/include/anna/dbos/Accesor.hpp +++ b/include/anna/dbos/Accesor.hpp @@ -45,14 +45,14 @@ public: Devuelve el identificador de este accesor. \return El identificador de este accesor. */ - Id getId() const throw() { return a_id; } + Id getId() const { return a_id; } /** Devuelve la instancia de la sentencia \em statement asociada a este cargador. \return La instancia de la sentencia \em statement asociada a este cargador. Puede ser NULL. */ dbms::Statement* getStatement() - throw(RuntimeException) { + noexcept(false) { return (a_statement == NULL && a_database != NULL) ? (a_statement = initialize(*a_database)) : a_statement; } @@ -60,7 +60,7 @@ public: * Devuelve \em true si el accesor fue inicializado con base de datos o \em false en otro caso. * \return \em true si el accesor fue inicializado con base de datos o \em false en otro caso. */ - bool hasDataBase() const throw() { return a_database != NULL; } + bool hasDataBase() const { return a_database != NULL; } /** Devuelve la instancia de la base de datos asociada a este cargador. @@ -68,13 +68,13 @@ public: \warning Si el accesor fue inicializado sin base de datos lo resultados no están definidos. */ - dbms::Database& getDatabase() throw() { return *a_database; } + dbms::Database& getDatabase() { return *a_database; } /** Devuelve la conexion que esta usando actualmente este cargador. \return la conexion que esta usando actualmente este cargador. */ - dbms::Connection& getConnection() throw(RuntimeException) { + dbms::Connection& getConnection() noexcept(false) { if(a_connection == NULL) { std::string msg(asString()); msg += " | No available database connection"; @@ -88,7 +88,7 @@ public: Devuelve la representacion en forma de cadena de la clave primaria establecida. @return La representacion en forma de cadena de la clave primaria establecida. */ - virtual std::string asString() const throw() = 0; + virtual std::string asString() const = 0; /** Metodo de debemos re-escribir para devolver el nombre completo del selector de recursos. @@ -96,7 +96,7 @@ public: a la que pertenece la clase. \return Una cadena con el nombre de este selector. */ - virtual const char* getClassName() const throw() = 0; + virtual const char* getClassName() const = 0; protected: /** @@ -149,7 +149,7 @@ protected: definir este metodo. \param database Instancia de la base de datos indicada en el constructor. */ - virtual dbms::Statement* initialize(dbms::Database& database) throw(RuntimeException) = 0; + virtual dbms::Statement* initialize(dbms::Database& database) noexcept(false) = 0; private: dbms::Database* a_database; @@ -159,9 +159,9 @@ private: bool a_emodeIsNull; Exception::Mode::_v a_exceptionMode; - void setStatement(dbms::Statement* statement) throw() { a_statement = statement; } + void setStatement(dbms::Statement* statement) { a_statement = statement; } - virtual bool load(dbms::Connection*, const StorageArea*) throw(RuntimeException, dbms::DatabaseException); + virtual bool load(dbms::Connection*, const StorageArea*) noexcept(false); friend class StorageArea; }; diff --git a/include/anna/dbos/AutoObject.hpp b/include/anna/dbos/AutoObject.hpp index 6c3992e..e5059b2 100644 --- a/include/anna/dbos/AutoObject.hpp +++ b/include/anna/dbos/AutoObject.hpp @@ -30,7 +30,7 @@ namespace dbos { \code void Application::getServerSocketsData (vector & serverSocketsData) const - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod ("anna::Application", "getServerSocketsData", ANNA_FILE_LOCATION)); @@ -61,7 +61,7 @@ namespace dbos { \code void Application::getServerSocketsData (vector & serverSocketsData) const - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod ("anna::Application", "getServerSocketsData", ANNA_FILE_LOCATION)); @@ -106,14 +106,14 @@ public: Permite invocar a metodos de la clase T. \return La instancia de la clase T asociada a esta instancia. */ - T* operator -> () const throw() { return a_t; } + T* operator -> () const { return a_t; } /** Operador copia. \param t Referencia al objeto que vamos a tratar. \return La instancia de la clase T asociada a esta instancia. */ - T* operator = (T* t) throw() { + T* operator = (T* t) { if(a_t != t) { T::release(a_t); a_t = t; @@ -127,7 +127,7 @@ public: \param other Referencia al objeto que vamos a tratar. \return La instancia de la clase T asociada a esta instancia. */ - T* operator = (const AutoObject & other) throw(RuntimeException) { + T* operator = (const AutoObject & other) noexcept(false) { return (this != &other) ? (*this = T::duplicate(other.a_t)) : a_t; } @@ -135,7 +135,7 @@ public: Operador de conversion. \return La instancia de la clase T asociada a esta instancia. */ - operator T*() const throw() { return a_t; } + operator T*() const { return a_t; } private: T* a_t; diff --git a/include/anna/dbos/AutoSet.hpp b/include/anna/dbos/AutoSet.hpp index 5882bb1..41df950 100644 --- a/include/anna/dbos/AutoSet.hpp +++ b/include/anna/dbos/AutoSet.hpp @@ -120,14 +120,14 @@ public: Permite invocar a metodos de la clase T. \return La instancia de la clase T asociada a esta instancia. */ - Set * operator -> () const throw() { return a_t; } + Set * operator -> () const { return a_t; } /** Operador copia. \return La instancia de la clase T asociada a esta instancia. */ Set * operator = (Set* t) - throw() { + { if(a_t == t) return t; @@ -141,7 +141,7 @@ public: Operador de conversion. \return La instancia de la clase T asociada a esta instancia. */ - operator Set *() const throw() { return a_t; } + operator Set *() const { return a_t; } private: Set * a_t; diff --git a/include/anna/dbos/Creator.hpp b/include/anna/dbos/Creator.hpp index 2f806cd..0917211 100644 --- a/include/anna/dbos/Creator.hpp +++ b/include/anna/dbos/Creator.hpp @@ -27,7 +27,7 @@ public: a la que pertenece la clase. \return Una cadena con el nombre de este selector. */ - virtual const char* getClassName() const throw() { return "anna::dbos::Creator"; } + virtual const char* getClassName() const { return "anna::dbos::Creator"; } protected: /** @@ -48,10 +48,10 @@ protected: Devuelve el indice usado para ubicar en memoria el objeto que vamos a cargar. @return El indice usado para ubicar en memoria el objeto que vamos a cargar. */ - virtual Index getIndex() const throw(RuntimeException) = 0; + virtual Index getIndex() const noexcept(false) = 0; private: - dbms::Statement* initialize(dbms::Database&) throw(RuntimeException) { return NULL;} + dbms::Statement* initialize(dbms::Database&) noexcept(false) { return NULL;} friend class StorageArea; }; diff --git a/include/anna/dbos/CrossedLoader.hpp b/include/anna/dbos/CrossedLoader.hpp index c1516ec..0022734 100644 --- a/include/anna/dbos/CrossedLoader.hpp +++ b/include/anna/dbos/CrossedLoader.hpp @@ -47,7 +47,7 @@ public: a la que pertenece la clase. \return Una cadena con el nombre de este selector. */ - virtual const char* getClassName() const throw() { return "anna::dbos::CrossedLoader"; } + virtual const char* getClassName() const { return "anna::dbos::CrossedLoader"; } protected: /** @@ -74,7 +74,7 @@ protected: @return \em true si se ha localizado la información la clave primaria del objeto en su lista de pares o \em false en otro caso. */ - virtual bool seek() const throw() { return false; } + virtual bool seek() const { return false; } /** * Este método debe ser reescrito para que se pueda actualizar la lista de pares (clave_alternativa, clave_principal) @@ -83,7 +83,7 @@ protected: * \param loader Instancia del cargador principal que habrá compuesto la clave principal con los suministrados por * esta instancia. */ - virtual void download(Loader& loader) throw() {;} + virtual void download(Loader& loader) {;} friend class StorageArea; }; diff --git a/include/anna/dbos/Eraser.hpp b/include/anna/dbos/Eraser.hpp index 3994714..abfc1f1 100644 --- a/include/anna/dbos/Eraser.hpp +++ b/include/anna/dbos/Eraser.hpp @@ -27,13 +27,13 @@ public: Devuelve la instancia establecida por #setObject. \return La instancia establecida por #setObject. Puede ser NULL. */ - Object* getObject() throw() { return a_object; } + Object* getObject() { return a_object; } /** Establece la instancia del objeto sobre el que vamos a actuar. \param object Instancia del objeto sobre el que vamos a actuar. */ - void setObject(Object* object) throw() { a_object = object; } + void setObject(Object* object) { a_object = object; } /** Metodo de debemos re-escribir para devolver el nombre completo del selector de recursos. @@ -41,7 +41,7 @@ public: a la que pertenece la clase. \return Una cadena con el nombre de este selector. */ - virtual const char* getClassName() const throw() { return "anna::dbos::Eraser"; } + virtual const char* getClassName() const { return "anna::dbos::Eraser"; } protected: /** @@ -58,7 +58,7 @@ protected: private: Object* a_object; - Index getIndex() const throw() { return 0; } // No se usa + Index getIndex() const { return 0; } // No se usa }; } diff --git a/include/anna/dbos/Loader.hpp b/include/anna/dbos/Loader.hpp index ec71709..7304d94 100644 --- a/include/anna/dbos/Loader.hpp +++ b/include/anna/dbos/Loader.hpp @@ -33,7 +33,7 @@ public: a la que pertenece la clase. \return Una cadena con el nombre de este selector. */ - virtual const char* getClassName() const throw() { return "anna::dbos::Loader"; } + virtual const char* getClassName() const { return "anna::dbos::Loader"; } protected: /** @@ -54,7 +54,7 @@ protected: Devuelve el indice usado para ubicar en memoria el objeto que vamos a cargar. @return El indice usado para ubicar en memoria el objeto que vamos a cargar. */ - virtual Index getIndex() const throw(RuntimeException) = 0; + virtual Index getIndex() const noexcept(false) = 0; /** * Este método debe ser reescrito para poder obtener los datos de la clave principal usada para localizar @@ -63,7 +63,7 @@ protected: * \param crossedLoader Instancia del cargador alternativo que habrá calculado la clave principal en * a lo clave alternativa contenida en él. */ - virtual void upload(CrossedLoader& crossedLoader) throw(RuntimeException) {;} + virtual void upload(CrossedLoader& crossedLoader) noexcept(false) {;} friend class StorageArea; }; diff --git a/include/anna/dbos/Object.hpp b/include/anna/dbos/Object.hpp index fc4e38c..c86cdb0 100644 --- a/include/anna/dbos/Object.hpp +++ b/include/anna/dbos/Object.hpp @@ -38,7 +38,7 @@ public: Devuelve el indice asociado a este objeto \return el indice asociado a este objeto */ - Index getIndex() const throw() { return a_index; } + Index getIndex() const { return a_index; } /** * Devuelve \em true si este objeto ya existe en el medio físico (fué cargado desde allí o fue creado y grabado posteriormente) o @@ -46,7 +46,7 @@ public: * \return \em true si este objeto ya existe en el medio físico (fué cargado desde allí o fue creado y grabado posteriormente) o * \em false si este objeto sólo existe en la memoria intermedia. */ - bool isStored() const throw() { return a_isStored; } + bool isStored() const { return a_isStored; } protected: /** @@ -61,20 +61,20 @@ protected: \param loader Cargador que contiene la informacion con la que debemos inicializar este objeto. */ - virtual void initialize(Loader& loader) throw(RuntimeException, dbms::DatabaseException) = 0; + virtual void initialize(Loader& loader) noexcept(false) = 0; /** Actualiza la informacion de este objeto con la nueva informacion obtenida del medio fisico. \param creator Creador que contiene la informacion con la que debemos inicializar este objeto. */ - virtual void create(Creator& creator) throw(RuntimeException, dbms::DatabaseException) {;} + virtual void create(Creator& creator) noexcept(false) {;} /** Libera los recursos reservados por este objeto. Este metodo solo se invocara cuando el objeto vaya a ser sacado definitivamente del area de almacenamiento. */ - virtual void destroy() throw() {;} + virtual void destroy() {;} /** Devuelve \em true si el registro del medio fisico ha cambiado respecto al registro @@ -86,7 +86,7 @@ protected: \return \em true si el registro del medio fisico ha cambiado respecto al registro cargado en memoria o \em false en otro caso. */ - virtual bool hasChanges(Loader& loader) throw(RuntimeException, dbms::DatabaseException) { + virtual bool hasChanges(Loader& loader) noexcept(false) { return true; } @@ -94,13 +94,13 @@ protected: Devuelve \em true si el objeto requiere comenzar el proceso de comprobacion de recarga de datos \em false en otro caso. */ - virtual bool enableUpdate() const throw() { return true; } + virtual bool enableUpdate() const { return true; } private: Index a_index; bool a_isStored; - void setIndex(const Index index) throw() { a_index = index; } + void setIndex(const Index index) { a_index = index; } friend class StorageArea; }; diff --git a/include/anna/dbos/ObjectFacade.hpp b/include/anna/dbos/ObjectFacade.hpp index 18577f0..922da40 100644 --- a/include/anna/dbos/ObjectFacade.hpp +++ b/include/anna/dbos/ObjectFacade.hpp @@ -54,13 +54,13 @@ public: \return Un numerico que puede ser usado en la definicion del area de almacenamiento. \see Database::createStorageArea */ - static StorageId getStorageAreaId() throw() { return (StorageId) anna_ptrnumber_cast(&st_storageArea); } + static StorageId getStorageAreaId() { return (StorageId) anna_ptrnumber_cast(&st_storageArea); } /** Devuelve el area de almacenamiento asociado a esta clase. \return Devuelve el area de almacenamiento asociado a esta clase. */ - static StorageArea* getStorageArea() throw() { return st_storageArea; } + static StorageArea* getStorageArea() { return st_storageArea; } /** Establece el area de almacenamiento asociado a esta clase, que deberiaser creado mediante la invocacin al metodo @@ -70,7 +70,7 @@ public: \warning El area de almacenamiento debe establecerse antes de invocar a cualquier otro metodo de esta clase. */ - static void setStorageArea(StorageArea* storageArea) throw() { + static void setStorageArea(StorageArea* storageArea) { (st_storageArea = storageArea)->setSizeof(sizeof(T)); } @@ -96,7 +96,7 @@ public: cuando dejemos de usar la instancia. */ static T* instance(dbms::Connection& connection, Loader& loader) - throw(RuntimeException, dbms::DatabaseException) { + noexcept(false) { if(st_storageArea == NULL) { std::string msg(loader.asString()); msg += " | ObjectFacade uninitialized "; @@ -125,7 +125,7 @@ public: cuando dejemos de usar la instancia. */ static T* instance(Loader& loader) - throw(RuntimeException, dbms::DatabaseException) { + noexcept(false) { if(st_storageArea == NULL) { std::string msg(loader.asString()); msg += " | ObjectFacade uninitialized "; @@ -158,7 +158,7 @@ public: cuando dejemos de usar la instancia. */ static T* instance(dbms::Connection& connection, CrossedLoader& crossedLoader, Loader& loader) - throw(RuntimeException, dbms::DatabaseException) { + noexcept(false) { if(st_storageArea == NULL) { std::string msg(loader.asString()); msg += " | ObjectFacade uninitialized "; @@ -187,7 +187,7 @@ public: cuando dejemos de usar la instancia. */ static T* create(dbms::Connection& connection, Creator& creator) - throw(RuntimeException, dbms::DatabaseException) { + noexcept(false) { if(st_storageArea == NULL) { std::string msg(creator.asString()); msg += " | ObjectFacade uninitialized "; @@ -214,7 +214,7 @@ public: cuando dejemos de usar la instancia. */ static T* find(Loader& loader) - throw(RuntimeException) { + noexcept(false) { if(st_storageArea == NULL) { std::string msg(loader.asString()); msg += " | ObjectFacade uninitialized "; @@ -238,7 +238,7 @@ public: objetos ofrecidos por esta clase no tendra ningun efecto. */ static void release(T*& t) - throw() { + { if(st_storageArea == NULL) return; @@ -253,7 +253,7 @@ public: Descarga todos los objetos contenidos en el area de almacenamiento. */ static void clear() - throw(RuntimeException) { + noexcept(false) { if(st_storageArea == NULL) throw RuntimeException("ObjectFacade uninitialized ", ANNA_FILE_LOCATION); @@ -272,7 +272,7 @@ public: cuando dejemos de usar la instancia. */ static T* duplicate(const T* t) - throw(RuntimeException) { + noexcept(false) { if(st_storageArea == NULL) throw RuntimeException("ObjectFacade uninitialized ", ANNA_FILE_LOCATION); @@ -288,7 +288,7 @@ public: \em false en otro caso. */ static bool isLoaded(const Loader& loader) - throw(RuntimeException) { + noexcept(false) { if(st_storageArea == NULL) throw RuntimeException("ObjectFacade uninitialized ", ANNA_FILE_LOCATION); @@ -303,7 +303,7 @@ public: \param recorder Grabador usado para transferir los datos al medio fisico. */ static void apply(dbms::Connection& connection, Recorder& recorder) - throw(RuntimeException, dbms::DatabaseException) { + noexcept(false) { if(st_storageArea == NULL) { std::string msg(recorder.asString()); msg += " | ObjectFacade uninitialized"; @@ -323,7 +323,7 @@ public: \warning Si la cuanta de utilizacion de T es 1 se liberaria en otro caso se devolveria una excepcion. */ static void apply(dbms::Connection& connection, Eraser& eraser) - throw(RuntimeException, dbms::DatabaseException) { + noexcept(false) { if(st_storageArea == NULL) { std::string msg(eraser.asString()); msg += " | ObjectFacade uninitialized"; @@ -345,7 +345,7 @@ public: al metodo #release para esta instancia. */ static void erase(T*& t) - throw(RuntimeException) { + noexcept(false) { if(st_storageArea == NULL) return; @@ -356,13 +356,13 @@ public: Devuelve el puntero sobre el que estaria posicionado el iterador recibido como parametro. \return El puntero sobre el que estaria posicionado el iterador recibido como parametro. */ - static T* data(StorageArea::iterator& ii) throw() { return static_cast (StorageArea::data(ii)); } + static T* data(StorageArea::iterator& ii) { return static_cast (StorageArea::data(ii)); } /** Devuelve el puntero sobre el que estaria posicionado el iterador recibido como parametro. \return El puntero sobre el que estaria posicionado el iterador recibido como parametro. */ - static const T* data(StorageArea::const_iterator& ii) throw() { return static_cast (StorageArea::data(ii)); } + static const T* data(StorageArea::const_iterator& ii) { return static_cast (StorageArea::data(ii)); } /** Metodo creador de nuevas instancias de la clase T. @@ -370,7 +370,7 @@ public: \warning Solo deberia ser llamado desde anna::comm::StorageArea cuando sea preciso crear nuevas instancias de objetos. */ - static Object* allocator() throw() { return new T; } + static Object* allocator() { return new T; } protected: static StorageArea* st_storageArea; diff --git a/include/anna/dbos/Recorder.hpp b/include/anna/dbos/Recorder.hpp index 696e665..ad37f2f 100644 --- a/include/anna/dbos/Recorder.hpp +++ b/include/anna/dbos/Recorder.hpp @@ -27,7 +27,7 @@ public: a la que pertenece la clase. \return Una cadena con el nombre de este selector. */ - virtual const char* getClassName() const throw() { return "anna::dbos::Recorder"; } + virtual const char* getClassName() const { return "anna::dbos::Recorder"; } protected: /** @@ -39,7 +39,7 @@ protected: Recorder(dbms::Database& database, const Id id = 0) : Accesor(database, id) {;} private: - Index getIndex() const throw() { return 0; } // No se usa + Index getIndex() const { return 0; } // No se usa }; } diff --git a/include/anna/dbos/Repository.hpp b/include/anna/dbos/Repository.hpp index 57a90ea..59f138d 100644 --- a/include/anna/dbos/Repository.hpp +++ b/include/anna/dbos/Repository.hpp @@ -78,7 +78,7 @@ public: finalizacin de esta instancia de base de datos. */ StorageArea* createStorageArea(const StorageId index, const char* name, const Size maxSize, ObjectAllocator objectAllocator, const int errorCode, const StorageArea::AccessMode::_v aamm = StorageArea::AccessMode::ReadOnly) - throw(RuntimeException); + noexcept(false); /** Devuelve la instancia del area de almacenamiento asociada al indice recibido. @@ -88,58 +88,58 @@ public: \return La instancia del area de almacenamiento asociada al indice recibido. Puede ser NULL si el indice no fue usado para crear un area mediate #createStorageArea. */ - StorageArea* findStorageArea(const StorageId index) throw(); + StorageArea* findStorageArea(const StorageId index) ; /** Elimina todos los objetos cargados en las areas de almacenamiento definidas. */ - void clear() throw(RuntimeException); + void clear() noexcept(false); /** Devuelve un iterator al comienzo de la lista de areas de almacenamiento de esta base de datos. \return Un iterator al comienzo de la lista de areas de almacenamiento de esta base de datos. */ - const_storage_iterator storage_begin() const throw() { return a_storageAreas.begin(); } + const_storage_iterator storage_begin() const { return a_storageAreas.begin(); } /** Devuelve un iterator al final de la lista de areas de almacenamiento de esta base de datos. \return Un iterator al final de la lista de areas de almacenamiento de esta base de datos. */ - const_storage_iterator storage_end() const throw() { return a_storageAreas.end(); } + const_storage_iterator storage_end() const { return a_storageAreas.end(); } /** Devuelve el objeto sobre el que esta posicionado el iterator recibido como parametro. \param ii Iterator que deberia estar comprendido entre #const_storage_begin y #const_storage_end. \return El objeto sobre el que esta posicionado el iterator recibido como parametro. */ - static const StorageArea* storageArea(const_storage_iterator& ii) throw() { return ii->second; } + static const StorageArea* storageArea(const_storage_iterator& ii) { return ii->second; } /** Devuelve un documento XML con la informacion referente a esta instancia. \param parent Nodo XML del que dependende la informacion. @return un documento XML con la informacion referente a esta instancia. */ - xml::Node* asXML(xml::Node* parent) const throw(); + xml::Node* asXML(xml::Node* parent) const ; protected: /** Devuelve un iterator al comienzo de la lista de areas de almacenamiento de esta base de datos. \return Un iterator al comienzo de la lista de areas de almacenamiento de esta base de datos. */ - storage_iterator storage_begin() throw() { return a_storageAreas.begin(); } + storage_iterator storage_begin() { return a_storageAreas.begin(); } /** Devuelve un iterator al final de la lista de areas de almacenamiento de esta base de datos. \return Un iterator al final de la lista de areas de almacenamiento de esta base de datos. */ - storage_iterator storage_end() throw() { return a_storageAreas.end(); } + storage_iterator storage_end() { return a_storageAreas.end(); } /** Devuelve el objeto sobre el que esta posicionado el iterator recibido como parametro. \param ii Iterator que deberia estar comprendido entre #const_storage_begin y #const_storage_end. \return El objeto sobre el que esta posicionado el iterator recibido como parametro. */ - static StorageArea* storageArea(storage_iterator& ii) throw() { return ii->second; } + static StorageArea* storageArea(storage_iterator& ii) { return ii->second; } private: std::string a_name; diff --git a/include/anna/dbos/Set.hpp b/include/anna/dbos/Set.hpp index a4325b9..8aa8e25 100644 --- a/include/anna/dbos/Set.hpp +++ b/include/anna/dbos/Set.hpp @@ -85,61 +85,61 @@ public: Devuelve el inicio del vector de objetos contenidos en el conjunto. \return El inicio del vector de objetos contenidos en el conjunto. */ - const_iterator begin() const throw() { return a_objects.begin(); } + const_iterator begin() const { return a_objects.begin(); } /** Devuelve el inicio del vector de objetos contenidos en el conjunto. \return El inicio del vector de objetos contenidos en el conjunto. */ - iterator begin() throw() { return a_objects.begin(); } + iterator begin() { return a_objects.begin(); } /** Devuelve el final del vector de objetos contenidos en el conjunto. \return El final del vector de objetos contenidos en el conjunto. */ - const_iterator end() const throw() { return a_objects.end(); } + const_iterator end() const { return a_objects.end(); } /** Devuelve el final del vector de objetos contenidos en el conjunto. \return El final del vector de objetos contenidos en el conjunto. */ - iterator end() throw() { return a_objects.end(); } + iterator end() { return a_objects.end(); } /** Crea un nuevo puntero de la clase T dentro de este conjunto. */ - T* append() throw(RuntimeException) { return a_objects.create(); } + T* append() noexcept(false) { return a_objects.create(); } /** Saca de este conjunto la instancia recibida como parametro y libera su memoria asociada. La operacion se ignoraria si el puntero recibido como parametro es nulo o no pertenece al conjunto. \param t Instancia que del objeto a eliminar. */ - void remove(T*& t) throw(RuntimeException) { a_objects.release(t); t = NULL; } + void remove(T*& t) noexcept(false) { a_objects.release(t); t = NULL; } /** Devuelve el nmero de elementos contenidos en el conjunto. \return El nmero de elementos contenidos en el conjunto. */ - int size() const throw() { return a_objects.size(); } + int size() const { return a_objects.size(); } /** Devuelve el puntero sobre el que esta posicionado el iterador recibido como parametro. \return El puntero sobre el que esta posicionado el iterador recibido como parametro. */ - static T* data(iterator& ii) throw() { return Container::data(ii); } + static T* data(iterator& ii) { return Container::data(ii); } /** Devuelve el puntero sobre el que esta posicionado el iterador recibido como parametro. \return El puntero sobre el que esta posicionado el iterador recibido como parametro. */ - static const T* data(const_iterator& ii) throw() { return Container::data(ii); } + static const T* data(const_iterator& ii) { return Container::data(ii); } private: Container a_objects; void initialize(Loader& loader) - throw(RuntimeException, dbms::DatabaseException) { + noexcept(false) { T* object; dbms::Statement* statement = loader.getStatement(); @@ -157,7 +157,7 @@ private: } void destroy() - throw() { + { for(iterator ii = begin(), maxii = end(); ii != maxii; ii ++) data(ii)->destroy(); diff --git a/include/anna/dbos/SetFacade.hpp b/include/anna/dbos/SetFacade.hpp index babadc9..308fad8 100644 --- a/include/anna/dbos/SetFacade.hpp +++ b/include/anna/dbos/SetFacade.hpp @@ -28,7 +28,7 @@ namespace dbos { La clase \em T debe tener definidos los siquientes metodos: \li anna::dbos::Object::instantiate: Interpreta la informacin la del medio fisico para adecuarla a la clase C++. - \li void destroy () throw (): Libera los recursos reservados por este objeto + \li void destroy () : Libera los recursos reservados por este objeto \see dbos_declare_set \see dbos_prepare_set @@ -45,14 +45,14 @@ public: \param t Instancia del conjunto. \return El numero de elementos que contiene el conjunto. */ - static int size(Set* t) throw() { return (t == NULL) ? 0 : t->size(); } + static int size(Set* t) { return (t == NULL) ? 0 : t->size(); } /** Iterator al primer elemento del conjunto. Se puede usar sin tener que preocuparse por el valor de la instancia del conjunto, ya que si este es NULL devolveria 0. \return Un iterador del primer elemento del conjunto. */ - static iterator begin(Set* t) throw() { + static iterator begin(Set* t) { return (t == NULL) ? iterator(0) : t->begin(); } @@ -61,7 +61,7 @@ public: el valor de la instancia del conjunto, ya que si este es NULL devolveria 0. \return Un iterador del primer elemento del conjunto. */ - static iterator end(Set* t) throw() { + static iterator end(Set* t) { return (t == NULL) ? iterator(0) : t->end(); } @@ -70,7 +70,7 @@ public: el valor de la instancia del conjunto, ya que si este es NULL devolveria 0. \return Un iterador del primer elemento del conjunto. */ - static const_iterator begin(const Set* t) throw() { + static const_iterator begin(const Set* t) { return (t == NULL) ? const_iterator(0) : t->begin(); } @@ -79,20 +79,20 @@ public: el valor de la instancia del conjunto, ya que si este es NULL devolveria 0. \return Un iterador del primer elemento del conjunto. */ - static const_iterator end(const Set* t) throw() { + static const_iterator end(const Set* t) { return (t == NULL) ? const_iterator(0) : t->end(); } /** Devuelve el objeto referenciado por el iterator recibido como parametro. \return El objeto referenciado por el iterator recibido como parametro. */ - static T* data(iterator ii) throw() { return Set::data(ii); } + static T* data(iterator ii) { return Set::data(ii); } /** Devuelve el objeto referenciado por el iterator recibido como parametro. \return El objeto referenciado por el iterator recibido como parametro. */ - static const T* data(const_iterator ii) throw() { return Set::data(ii); } + static const T* data(const_iterator ii) { return Set::data(ii); } protected: /** diff --git a/include/anna/dbos/StorageArea.hpp b/include/anna/dbos/StorageArea.hpp index e9bda03..9523df2 100644 --- a/include/anna/dbos/StorageArea.hpp +++ b/include/anna/dbos/StorageArea.hpp @@ -93,7 +93,7 @@ public: \param v Codigo a traducir a literal. \return el literal correspondiente al codigo recibido. */ - static const char* asString(const _v v) throw(); + static const char* asString(const _v v) ; }; /** @@ -145,13 +145,13 @@ public: * Devuelve el código de error asociado a la excepción cuando no se encuentra un registro buscado. * \return el código de error asociado a la excepción cuando no se encuentra un registro buscado. */ - int getErrorCode() const throw() { return a_errorCode; } + int getErrorCode() const { return a_errorCode; } /* * Devuelve el nombre de la este área de almacenamiento. * \return el nombre de la este área de almacenamiento. */ - const std::string& getName() const throw() { return a_name; } + const std::string& getName() const { return a_name; } /** Carga la informacion de un objeto contenida en un medio fisico y la interpreta para adecuarla a @@ -173,7 +173,7 @@ public: \warning Cada llamada a este método deberia tener su correspondiente liberacion invocando a #release cuando dejemos de usar la instancia. */ - Object* instance(dbms::Connection& connection, Loader& loader) throw(RuntimeException, dbms::DatabaseException) { + Object* instance(dbms::Connection& connection, Loader& loader) noexcept(false) { return instance(&connection, loader); } @@ -197,7 +197,7 @@ public: \warning Cada llamada a este método deberia tener su correspondiente liberacion invocando a #release cuando dejemos de usar la instancia. */ - Object* instance(dbms::Connection* connection, Loader& loader) throw(RuntimeException, dbms::DatabaseException); + Object* instance(dbms::Connection* connection, Loader& loader) noexcept(false); /** Carga la informacion de un objeto contenida en un medio fisico y la interpreta para adecuarla a @@ -222,7 +222,7 @@ public: cuando dejemos de usar la instancia. */ Object* instance(dbms::Connection& connection, CrossedLoader& crossedLoader, Loader& loader) - throw(RuntimeException, dbms::DatabaseException) { + noexcept(false) { return instance(&connection, crossedLoader, loader); } @@ -249,7 +249,7 @@ public: cuando dejemos de usar la instancia. */ Object* instance(dbms::Connection* connection, CrossedLoader& crossedLoader, Loader& loader) - throw(RuntimeException, dbms::DatabaseException); + noexcept(false); /** Carga la informacion de un objeto contenida en un medio fisico y la interpreta para adecuarla a @@ -270,7 +270,7 @@ public: \warning Para usar este método se requiere haber re-escrito el método virtual Loader::load para que no intente obtener los datos desde la base de datos. */ - Object* instance(Loader& loader) throw(RuntimeException, dbms::DatabaseException) { + Object* instance(Loader& loader) noexcept(false) { return instance(NULL, loader); } @@ -292,7 +292,7 @@ public: cuando dejemos de usar la instancia. \li No puede usarse en las áreas de almacenamiento definidas como AccessMode::ReadOnly. */ - Object* create(dbms::Connection& connection, Creator& creator) throw(RuntimeException, dbms::DatabaseException) { + Object* create(dbms::Connection& connection, Creator& creator) noexcept(false) { return create(&connection, creator); } @@ -314,7 +314,7 @@ public: cuando dejemos de usar la instancia. \li No puede usarse en las áreas de almacenamiento definidas como AccessMode::ReadOnly. */ - Object* create(dbms::Connection* connection, Creator& creator) throw(RuntimeException, dbms::DatabaseException); + Object* create(dbms::Connection* connection, Creator& creator) noexcept(false); /** Crea un objeto en el área de almacenamiento y lo prepara para ser transferido al medio fisico @@ -331,7 +331,7 @@ public: cuando dejemos de usar la instancia. \li No puede usarse en las áreas de almacenamiento definidas como AccessMode::ReadOnly. */ - Object* create(Creator& creator) throw(RuntimeException, dbms::DatabaseException) { return create(NULL, creator); } + Object* create(Creator& creator) noexcept(false) { return create(NULL, creator); } /** Devuelve la informacion de un objeto cargado desde el medio fisico. @@ -349,7 +349,7 @@ public: \warning Cada llamada a este método deberia tener su correspondiente liberacion invocando a #release cuando dejemos de usar la instancia. */ - Object* find(Loader& loader) throw(RuntimeException); + Object* find(Loader& loader) noexcept(false); /** Devuelve de una copia del objeto recibido como parámetro e incrementa la cuenta de utilizacion @@ -362,7 +362,7 @@ public: \warning Cada llamada a este método deberia tener su correspondiente liberacion invocando a #release cuando dejemos de usar la instancia. */ - Object* duplicate(const Object* object) throw(RuntimeException); + Object* duplicate(const Object* object) noexcept(false); /** Permite conocer si un determinado objeto esta alojado en el área de almacenamiento. No @@ -374,7 +374,7 @@ public: \return \em true Si el objeto identificado por el Loader esta en el área de almacenamiento o \em false en otro caso. */ - bool isLoaded(const Loader& loader) throw(RuntimeException); + bool isLoaded(const Loader& loader) noexcept(false); /** Transfiere la informacion del objeto recibido como parámetro al medio fisico usando el Recorder @@ -383,7 +383,7 @@ public: \param connection Conexion usada si fuera necesario acceder al medio fisico. \param recorder Grabador usado para transferir los datos al medio fisico. */ - void apply(dbms::Connection& connection, Recorder& recorder) throw(RuntimeException, dbms::DatabaseException); + void apply(dbms::Connection& connection, Recorder& recorder) noexcept(false); /** Elimina la informacion del objeto recibido como parámetro del medio fisico usando el Eraser @@ -394,7 +394,7 @@ public: \warning Si la cuenta de utilizacion del objeto es 1 se liberaría en otro caso se devolvería una excepción. */ - void apply(dbms::Connection& connection, Eraser& eraser) throw(RuntimeException, dbms::DatabaseException); + void apply(dbms::Connection& connection, Eraser& eraser) noexcept(false); /** Habilita la reutilizacion del espacio de memoria ocupado por un objeto instanciado mediate #instance. @@ -409,7 +409,7 @@ public: \warning Si el objeto recibido como parámetro no fue reservado mediate #instance no tiene ningun efecto. */ - void release(Object** object) throw(RuntimeException); + void release(Object** object) noexcept(false); /** Elimina toda la informacion referente al objeto recibido como parámetro, siempre y cuando @@ -421,7 +421,7 @@ public: ningun efecto. \li La instancia a liberar solo puede tener 1 en su cuenta de utilizacion. */ - void erase(Object** object) throw(RuntimeException); + void erase(Object** object) noexcept(false); /** Marca el objeto recibido como pendiente de recarga de datos. @@ -432,87 +432,87 @@ public: ningun efecto. \li La instancia a marcar solo deberia tener una unica instancia en uso. */ - void dirty(Object* object) throw(RuntimeException); + void dirty(Object* object) noexcept(false); /** Establece el tamanho de las instancias de los objetos contenidos en este área de almacenamiento. \param _sizeof Numero de bytes ocupado por cada una de las instancias. */ - void setSizeof(const Size _sizeof) throw() { a_sizeof = _sizeof + sizeof(Instance); } + void setSizeof(const Size _sizeof) { a_sizeof = _sizeof + sizeof(Instance); } /** Devuelve el numero maximo de bytes teorico que puede llegar a reservar este área de almacenamiento. \return el numero maximo de bytes teorico que puede llegar a reservar este área de almacenamiento. */ - Size getMaxSizeOf() const throw() { return a_maxSize * a_sizeof; } + Size getMaxSizeOf() const { return a_maxSize * a_sizeof; } /** Devuelve el numero de bytes teorico que puede llegar a reservar este área de almacenamiento. \return el numero de bytes teorico que puede llegar a reservar este área de almacenamiento. */ - Size getSizeOf() const throw() { return a_directory.size() * a_sizeof; } + Size getSizeOf() const { return a_directory.size() * a_sizeof; } /** Devuelve un iterator al primero de los objetos contenido en el área del almacenamiento. \return Un iterator al primero de los objetos contenido en el área del almacenamiento. */ - iterator begin() throw() { return a_directory.begin(); } + iterator begin() { return a_directory.begin(); } /** Devuelve un iterator al primero de los objetos contenido en el área del almacenamiento. \return Un iterator al primero de los objetos contenido en el área del almacenamiento. */ - const_iterator begin() const throw() { return a_directory.begin(); } + const_iterator begin() const { return a_directory.begin(); } /** Devuelve un iterator al fin de los objetos contenidos en el área del almacenamiento. \return Un iterator al fin de los objetos contenidos en el área del almacenamiento. */ - iterator end() throw() { return a_directory.end(); } + iterator end() { return a_directory.end(); } /** Devuelve un iterator al fin de los objetos contenidos en el área del almacenamiento. \return Un iterator al fin de los objetos contenidos en el área del almacenamiento. */ - const_iterator end() const throw() { return a_directory.end(); } + const_iterator end() const { return a_directory.end(); } /** Devuelve el puntero sobre el que esta posicionado el iterador recibido como parámetro. \return El puntero sobre el que esta posicionado el iterador recibido como parámetro. */ - static Object* data(iterator ii) throw() { return ii->second->object; } + static Object* data(iterator ii) { return ii->second->object; } /** Devuelve el puntero sobre el que esta posicionado el iterador recibido como parámetro. \return El puntero sobre el que esta posicionado el iterador recibido como parámetro. */ - static const Object* data(const_iterator ii) throw() { return ii->second->object; } + static const Object* data(const_iterator ii) { return ii->second->object; } /** Devuelve una cadena con la informacion referente a este área de almacenamiento. \return Una cadena con la informacion referente a este área de almacenamiento. */ - std::string asString() const throw(); + std::string asString() const ; /** Devuelve un documento XML con la informacion referente a esta instancia. \param parent Nodo XML del que dependende la informacion. @return un documento XML con la informacion referente a esta instancia. */ - xml::Node* asXML(xml::Node* parent) const throw(); + xml::Node* asXML(xml::Node* parent) const ; protected: /** Descarga del área de almacenamiento todos los objetos que estuviera cargados. Este método se invoca desde anna::dbos::Repository::clear */ - void clear() throw(RuntimeException); + void clear() noexcept(false); /** Devuelve un literal con el entero recibido tratado como una cantidad en bytes. \return un literal con el entero recibido tratado como un cantidad en bytes */ - static std::string asMemorySize(const Size size) throw(); + static std::string asMemorySize(const Size size) ; private: typedef std::map ::value_type value_type; @@ -528,13 +528,13 @@ private: Holes() : a_size(0) {;} - bool insert(Instance* instance, const Mode::_v mode) throw(); - void erase(Instance* instance) throw(); - Instance* front() throw() { return a_holes.front(); } - int size() const throw() { return a_size; } - int empty() const throw() { return a_holes.empty(); } - void pop_front() throw() { a_holes.pop_front(); a_size --; } - void clear() throw() { a_holes.clear(); a_size = 0; } + bool insert(Instance* instance, const Mode::_v mode) ; + void erase(Instance* instance) ; + Instance* front() { return a_holes.front(); } + int size() const { return a_size; } + int empty() const { return a_holes.empty(); } + void pop_front() { a_holes.pop_front(); a_size --; } + void clear() { a_holes.clear(); a_size = 0; } private: hole_container a_holes; @@ -563,8 +563,8 @@ private: class Block { public: Block(ObjectAllocator objectAllocator, const Size maxSize); - Instance* getInstance() throw() { return (a_size < a_maxSize) ? &a_instances [a_size ++] : NULL; } - void reset() throw() { a_size = 0; } + Instance* getInstance() { return (a_size < a_maxSize) ? &a_instances [a_size ++] : NULL; } + void reset() { a_size = 0; } private: Instance* a_instances; @@ -593,10 +593,10 @@ private: typedef inprogress_container::iterator inprogress_iterator; inprogress_container a_inprogress; - inprogress_iterator inprogress_begin () const throw () { return a_inprogress.begin (); } - inprogress_iterator inprogress_end () const throw () { return a_inprogress.end (); } - static DBIndex index (inprogress_iterator ii) throw () { return *ii; } - bool isInProgress (const DBIndex index) const throw (); + inprogress_iterator inprogress_begin () const { return a_inprogress.begin (); } + inprogress_iterator inprogress_end () const { return a_inprogress.end (); } + static DBIndex index (inprogress_iterator ii) { return *ii; } + bool isInProgress (const DBIndex index) const ; */ /* @@ -606,15 +606,15 @@ private: StorageArea(const char* name, const Size maxSize, ObjectAllocator, const AccessMode::_v, const int errorCode); StorageArea(const StorageArea&); - Object* reload(dbms::Connection*, Loader&, Instance*) throw(RuntimeException, dbms::DatabaseException); - void checkIncoherence(Instance*) throw(); - bool quickReusing(Instance*) throw(); - void verifyStatus(StorageArea::Instance*, const bool ignoreDirty = false) throw(RuntimeException); - Instance* allocate() throw(); - Instance* reuse() throw(); + Object* reload(dbms::Connection*, Loader&, Instance*) noexcept(false); + void checkIncoherence(Instance*) ; + bool quickReusing(Instance*) ; + void verifyStatus(StorageArea::Instance*, const bool ignoreDirty = false) noexcept(false); + Instance* allocate() ; + Instance* reuse() ; - static Instance* instance(iterator& ii) throw() { return ii->second; } - static std::string asString(const Instance*) throw(); + static Instance* instance(iterator& ii) { return ii->second; } + static std::string asString(const Instance*) ; friend class Repository; }; diff --git a/include/anna/dbos/internal/sccs.hpp b/include/anna/dbos/internal/sccs.hpp index e4699c5..1dca2ee 100644 --- a/include/anna/dbos/internal/sccs.hpp +++ b/include/anna/dbos/internal/sccs.hpp @@ -15,7 +15,7 @@ namespace dbos { class sccs { public: - static void activate() throw(); + static void activate() ; }; } diff --git a/include/anna/diameter.comm/ApplicationMessageOamModule.hpp b/include/anna/diameter.comm/ApplicationMessageOamModule.hpp index d8f6fa6..f3498b5 100644 --- a/include/anna/diameter.comm/ApplicationMessageOamModule.hpp +++ b/include/anna/diameter.comm/ApplicationMessageOamModule.hpp @@ -138,20 +138,20 @@ public: anna_declare_enum(Counter); }; - /* virtual */std::string getDefaultInternalCounterDescription(const int & counterType) const throw() { return Counter::asCString((Counter::_v)counterType); } + /* virtual */std::string getDefaultInternalCounterDescription(const int & counterType) const { return Counter::asCString((Counter::_v)counterType); } // map stack id with a scope id - void createStackCounterScope(int /* scope id */, unsigned int /* stack id */) throw(anna::RuntimeException); + void createStackCounterScope(int /* scope id */, unsigned int /* stack id */) noexcept(false); // translate message code into offset and invoke parent class count method. The message applicationId will be used as stack id // resultCode shall be -1 for non-answers - void count (int messageCode, int resultCode, unsigned int stackId, const int & type, const int & amount = 1) throw(anna::RuntimeException); + void count (int messageCode, int resultCode, unsigned int stackId, const int & type, const int & amount = 1) noexcept(false); // Number of different counter types for each message - int getCounterTypes() const throw() { return a_counter_types; } + int getCounterTypes() const { return a_counter_types; } // -1 if multistack - int monoStackScopeId() const throw() { + int monoStackScopeId() const { return ((a_stackMap.size() != 1) ? -1 : a_stackMap.begin()->second); } diff --git a/include/anna/diameter.comm/ClassCode.hpp b/include/anna/diameter.comm/ClassCode.hpp index 4dfa88a..2999644 100644 --- a/include/anna/diameter.comm/ClassCode.hpp +++ b/include/anna/diameter.comm/ClassCode.hpp @@ -39,14 +39,14 @@ struct ClassCode { \param v Class type code to translate. \return Class type string representation. */ - //static std::string asString(const _v v) throw(); + //static std::string asString(const _v v) ; /** Class type text representation \param v Class type code to translate. \return Class type text representation. */ - static std::string asText(const _v v) throw(); + static std::string asText(const _v v) ; }; } diff --git a/include/anna/diameter.comm/ClientSession.hpp b/include/anna/diameter.comm/ClientSession.hpp index 0b4b437..f653ee5 100644 --- a/include/anna/diameter.comm/ClientSession.hpp +++ b/include/anna/diameter.comm/ClientSession.hpp @@ -51,7 +51,7 @@ class Server; class ClientSession : public Session { // Helper: - static std::string getKey(const std::string & addr, int port, int socketId) throw() { + static std::string getKey(const std::string & addr, int port, int socketId) { return (anna::functions::asString("%s:%d|%d", addr.c_str(), port, socketId)); } @@ -63,7 +63,7 @@ public: ClientSession(); - /* virtual */void initialize() throw(); + /* virtual */void initialize() ; /** * Default watchdog period for the diameter client-session health. @@ -73,49 +73,49 @@ public: /** Client session key:
:| */ - std::string getKey() const throw() { return ClientSession::getKey(getAddress(), getPort(), getSocketId()); } + std::string getKey() const { return ClientSession::getKey(getAddress(), getPort(), getSocketId()); } /** Diameter server address (IPv4 or hostname) \return Diameter server address */ - /* virtual */const std::string& getAddress() const throw(); + /* virtual */const std::string& getAddress() const ; /** Diameter server listen port \return Diameter server listen port */ - /* virtual */int getPort() const throw(); + /* virtual */int getPort() const ; /** Diameter parent server. \return Diameter parent server. */ - const Server *getParent() const throw() { return a_parent; } + const Server *getParent() const { return a_parent; } /** Diameter server created at diameter::comm::Engine::createClientSession. \return Diameter server */ - anna::comm::Server * getServer() throw() { return a_server; } + anna::comm::Server * getServer() { return a_server; } /** Disables server resource (avoid the use of the server) */ - void disable() throw() { a_server->disable(); } + void disable() { a_server->disable(); } /** Sets auto recovery indicator. When a connection is lost, by default it will be recovered automatically. \param autoRecovery Auto recovery indicator. TRue by default. */ - void setAutoRecovery(bool autoRecovery = true) throw() { a_autoRecovery = autoRecovery; a_server->setAutoRecovery(autoRecovery); } + void setAutoRecovery(bool autoRecovery = true) { a_autoRecovery = autoRecovery; a_server->setAutoRecovery(autoRecovery); } /** Gets the auto recovery indicator for the client connection (client-session). @return Auto recovery indicator. */ - bool getAutoRecovery() const throw() { return a_autoRecovery; } + bool getAutoRecovery() const { return a_autoRecovery; } /** Sets the milliseconds wait to achieve a client connection to server by mean connect primitive. @@ -124,14 +124,14 @@ public: \param maxConnectionDelay Milliseconds wait to get connection */ - void setMaxConnectionDelay(const anna::Millisecond & maxConnectionDelay) throw() { a_server->setMaxConnectionDelay(maxConnectionDelay); } + void setMaxConnectionDelay(const anna::Millisecond & maxConnectionDelay) { a_server->setMaxConnectionDelay(maxConnectionDelay); } /** Gets the milliseconds wait to achieve a client connection to server by mean connect primitive. \return Milliseconds wait to get connection */ - const anna::Millisecond & getMaxConnectionDelay() throw() { return a_server->getMaxConnectionDelay(); } + const anna::Millisecond & getMaxConnectionDelay() { return a_server->getMaxConnectionDelay(); } /** * Sets CER and DWR diameter messages to be used over created client-sessions @@ -139,40 +139,40 @@ public: * @param cer Capabilities-Exchange-Request message (encoded) for the client-sessions bind. * @param dwr Device-Watchdog-Request message (encoded) for the client-sessions keep-alive. */ - void setCERandDWR(const anna::DataBlock & cer, const anna::DataBlock & dwr) throw(anna::RuntimeException); + void setCERandDWR(const anna::DataBlock & cer, const anna::DataBlock & dwr) noexcept(false); // Internal - void bind() throw(anna::RuntimeException); + void bind() noexcept(false); - /* virtual */const Response* send(const Message* message) throw(anna::RuntimeException); - /* virtual */bool unbind(bool forceDisconnect /* se usa en timer, para el actionTimer del tipo SessionUnbind, etc. */ = false) throw(anna::RuntimeException); // returns true if done at call time (no pendings or ignore pendings, except Disconnecting state by mean DPR/DPA) + /* virtual */const Response* send(const Message* message) noexcept(false); + /* virtual */bool unbind(bool forceDisconnect /* se usa en timer, para el actionTimer del tipo SessionUnbind, etc. */ = false) noexcept(false); // returns true if done at call time (no pendings or ignore pendings, except Disconnecting state by mean DPR/DPA) /** Deny resource for delivery restriction */ - void hide() throw() { a_hidden = true; } + void hide() { a_hidden = true; } /** Allow resource for delivery permission */ - void show() throw() { a_hidden = false; } + void show() { a_hidden = false; } /** Returns true when client session resource is hidden for application messages delivery */ - bool hidden() const throw() { return a_hidden; } + bool hidden() const { return a_hidden; } /** Returns true when client session resource is shown for application messages delivery */ - bool shown() const throw() { return !a_hidden; } + bool shown() const { return !a_hidden; } /** Class string representation \return String with relevant information for this instance. */ - /* virtual */std::string asString() const throw(); + /* virtual */std::string asString() const ; /** @@ -180,7 +180,7 @@ public: \param parent Parent XML node on which hold this instance information. \return XML document with relevant information for this instance. */ - /* virtual */anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); + /* virtual */anna::xml::Node* asXML(anna::xml::Node* parent) const ; private: @@ -210,19 +210,19 @@ private: }; }; WatchdogState::_v a_watchdogState; - void setWatchdogState(WatchdogState::_v wState) throw(); + void setWatchdogState(WatchdogState::_v wState) ; - /* virtual */void expire(anna::timex::Engine *timeController) throw(anna::RuntimeException); - void setWatchdogPeriod(const anna::Millisecond & watchdogPeriod) throw(); + /* virtual */void expire(anna::timex::Engine *timeController) noexcept(false); + void setWatchdogPeriod(const anna::Millisecond & watchdogPeriod) ; - /*virtual*/ void timerStopped() throw(); - /*virtual*/ void timerStarted() throw(); + /*virtual*/ void timerStopped() ; + /*virtual*/ void timerStarted() ; // Activity: - /* virtual */void updateIncomingActivityTime() throw(); - /* virtual */void updateOutgoingActivityTime() throw(); - void countSendings(const diameter::CommandId & cid, unsigned int aid, bool ok) throw(); + /* virtual */void updateIncomingActivityTime() ; + /* virtual */void updateOutgoingActivityTime() ; + void countSendings(const diameter::CommandId & cid, unsigned int aid, bool ok) ; // Handlers: /** @@ -230,60 +230,60 @@ private: When notified, ANNA.diameter.comm generates an diameter::comm::ClientSession::eventResponse for every request with pending answers. */ - void eventPeerShutdown() throw(); + void eventPeerShutdown() ; /** Handler about a request retransmission over the session. \param request Message retransmitted */ - void eventRequestRetransmission(Message *request) throw(); + void eventRequestRetransmission(Message *request) ; /** Handler for diameter server (client-session) responses \param response Answer container object for corresponding diameter request */ - void eventResponse(const Response& response) throw(anna::RuntimeException); + void eventResponse(const Response& response) noexcept(false); /** Handler for diameter server (client-session) requests \param request Request data block object for corresponding diameter reception */ - void eventRequest(const anna::DataBlock& request) throw(anna::RuntimeException); - //void eventRequest(const Message& request) throw(anna::RuntimeException); + void eventRequest(const anna::DataBlock& request) noexcept(false); + //void eventRequest(const Message& request) noexcept(false); /** Handler for diameter server (client-session) responses out of context \param response Answer data block object without context match */ - void eventUnknownResponse(const anna::DataBlock& response) throw(anna::RuntimeException); + void eventUnknownResponse(const anna::DataBlock& response) noexcept(false); /** Handler for diameter server (client-session) Disconnect-Peer-Answer messages \param response Answer data block object without context match */ - void eventDPA(const anna::DataBlock& response) throw(anna::RuntimeException); + void eventDPA(const anna::DataBlock& response) noexcept(false); /** * Handlers for receptions */ - /* virtual */void receive(const anna::comm::Message& message) throw(anna::RuntimeException); - /* virtual */void finalize() throw(); - void recover() throw(); + /* virtual */void receive(const anna::comm::Message& message) noexcept(false); + /* virtual */void finalize() ; + void recover() ; - /* virtual */void expireResponse(Response*) throw(); - /* virtual */void setState(State::_v state) throw(); + /* virtual */void expireResponse(Response*) ; + /* virtual */void setState(State::_v state) ; - void sendDWAToServer(const anna::DataBlock& dwrDB) throw(anna::RuntimeException); // non-usual behaviour, but DWR could be received from server + void sendDWAToServer(const anna::DataBlock& dwrDB) noexcept(false); // non-usual behaviour, but DWR could be received from server // helpers - static const char* asText(const WatchdogState::_v) throw(); + static const char* asText(const WatchdogState::_v) ; friend class Server; diff --git a/include/anna/diameter.comm/ClientSessionReceiver.hpp b/include/anna/diameter.comm/ClientSessionReceiver.hpp index d7e6cf3..73a5205 100644 --- a/include/anna/diameter.comm/ClientSessionReceiver.hpp +++ b/include/anna/diameter.comm/ClientSessionReceiver.hpp @@ -36,17 +36,17 @@ class ClientSessionReceiver : public anna::comm::Receiver { public: virtual ~ClientSessionReceiver() {;} - static const char* className() throw() { return "diameter.comm.ClientSessionReceiver"; } - void setReference(ClientSession *s) throw() { a_session = s; } + static const char* className() { return "diameter.comm.ClientSessionReceiver"; } + void setReference(ClientSession *s) { a_session = s; } // base class virtuals - void eventBreakConnection(const anna::comm::ClientSocket&) throw(); - void eventCreateConnection(const anna::comm::Server*) throw(); + void eventBreakConnection(const anna::comm::ClientSocket&) ; + void eventCreateConnection(const anna::comm::Server*) ; private: ClientSessionReceiver() : anna::comm::Receiver("diameter.comm.ClientSessionReceiver") { a_session = NULL; } - void initialize() throw(anna::RuntimeException) {;} - void apply(anna::comm::ClientSocket&, const anna::comm::Message&) throw(anna::RuntimeException); + void initialize() noexcept(false) {;} + void apply(anna::comm::ClientSocket&, const anna::comm::Message&) noexcept(false); anna::diameter::comm::ClientSession *a_session; diff --git a/include/anna/diameter.comm/Engine.hpp b/include/anna/diameter.comm/Engine.hpp index 6a7d133..e8febc4 100644 --- a/include/anna/diameter.comm/Engine.hpp +++ b/include/anna/diameter.comm/Engine.hpp @@ -79,17 +79,17 @@ class LocalServer; * private: * anna::Recycler a_entities; * - * anna::diameter::comm::Entity* allocateEntity () throw () { return a_entities.create (); } + * anna::diameter::comm::Entity* allocateEntity () { return a_entities.create (); } * - * void releaseEntity (anna::diameter::comm::Entity* entity) throw () { + * void releaseEntity (anna::diameter::comm::Entity* entity) { * MyEntity* aux = static_cast (entity); * a_entities.release (aux); * } * * - * anna::diameter::comm::LocalServer* allocateLocalServer () throw () { return a_localServers.create (); } + * anna::diameter::comm::LocalServer* allocateLocalServer () { return a_localServers.create (); } * - * void releaseLocalServer (anna::diameter::comm::LocalServer* localServer) throw () { + * void releaseLocalServer (anna::diameter::comm::LocalServer* localServer) { * MyLocalServer* aux = static_cast (localServer); * a_localServers.release (aux); * } @@ -106,7 +106,7 @@ public: @param originRealmName Used to configure the Origin-Realm for outgoing messages. If not configured or empty string provided, host domainname will be set. */ - void setOriginRealmName(const std::string & originRealmName) throw(); + void setOriginRealmName(const std::string & originRealmName) ; /** Diameter application origin host @@ -114,21 +114,21 @@ public: @param originHostName Used to configure the Origin-Host for outgoing messages. If not configured or empty string provided, hostname (system name) will be set. */ - void setOriginHostName(const std::string & originHostName) throw(); + void setOriginHostName(const std::string & originHostName) ; /** Gets the configured diameter application node origin realm @return Diameter application node origin realm */ - const std::string & getOriginRealmName() const throw() { return a_originRealm; } + const std::string & getOriginRealmName() const { return a_originRealm; } /** Gets the configured diameter application origin host @return Diameter application node origin host */ - const std::string & getOriginHostName() const throw() { return a_originHost; } + const std::string & getOriginHostName() const { return a_originHost; } /** @@ -141,13 +141,13 @@ public: * * @param autoRecovery Auto recovery indicator. True by default. */ - void raiseAutoRecovery(bool autoRecovery = true) throw(anna::RuntimeException); + void raiseAutoRecovery(bool autoRecovery = true) noexcept(false); /** * Returns automatic bind indicator for client-sessions. By default \em true will be used. * \return Value for automatic connection bind. */ - bool getAutoBind() const throw() { return a_autoBind; } + bool getAutoBind() const { return a_autoBind; } /** * Sets automatic connection bind indicator for client-sessions. If not asigned, it will be \em true. @@ -156,7 +156,7 @@ public: * In order to change bind timer, first client-session must be created without autobind, modify time * parameter and then invoking bind. */ - void setAutoBind(const bool autoBind) throw() { a_autoBind = autoBind; } + void setAutoBind(const bool autoBind) { a_autoBind = autoBind; } /** Sets the milliseconds wait to achieve a client connection to server by mean connect primitive. @@ -165,7 +165,7 @@ public: \param maxConnectionDelay Milliseconds wait to get connection */ - void setMaxConnectionDelay(const anna::Millisecond & maxConnectionDelay) throw() { a_maxConnectionDelay = maxConnectionDelay; } + void setMaxConnectionDelay(const anna::Millisecond & maxConnectionDelay) { a_maxConnectionDelay = maxConnectionDelay; } /** Gets the milliseconds wait to achieve a client connection to server by mean connect primitive. @@ -174,14 +174,14 @@ public: \return Milliseconds wait to get connection */ - const anna::Millisecond & getMaxConnectionDelay() throw() { return a_maxConnectionDelay; } + const anna::Millisecond & getMaxConnectionDelay() { return a_maxConnectionDelay; } /** * Binds engine entities. * * @return Returns true if all client-session were successfully bound */ - bool bind() throw(anna::RuntimeException); + bool bind() noexcept(false); /** * Sets CER and DWR diameter messages to be used over created client-sessions. @@ -190,7 +190,7 @@ public: * @param cer Capabilities-Exchange-Request message (encoded) for the client-sessions bind. * @param dwr Device-Watchdog-Request message (encoded) for the client-sessions keep-alive. */ - void setClientCERandDWR(const anna::DataBlock & cer, const anna::DataBlock & dwr) throw(anna::RuntimeException); + void setClientCERandDWR(const anna::DataBlock & cer, const anna::DataBlock & dwr) noexcept(false); /** * Sets CER and DWR diameter messages to be used over created client-sessions. If empty string is provided for CER and/or DWR, default version will be configured. @@ -199,7 +199,7 @@ public: * @param cer Capabilities-Exchange-Request xml message path file for the client-sessions bind. If empty string is provided (default), a default version for CER will be encoded. * @param dwr Device-Watchdog-Request xml message path file for the client-sessions keep-alive. If empty string is provided (default), a default version for DWR will be encoded. */ - void setClientCERandDWR(const std::string & cer = "", const std::string & dwr = "") throw(anna::RuntimeException); + void setClientCERandDWR(const std::string & cer = "", const std::string & dwr = "") noexcept(false); /** * Sets the watchdog period (DWR) for client-sessions. @@ -207,20 +207,20 @@ public: * * @param wp Watchdog period. */ - void setWatchdogPeriod(const anna::Millisecond & wp) throw(anna::RuntimeException); + void setWatchdogPeriod(const anna::Millisecond & wp) noexcept(false); /** * Gets the number of client-sessions per server. * \return numberOfClientSessionsPerServer Number of client-sessions per server. */ - int getNumberOfClientSessionsPerServer() const throw() { return a_numberOfClientSessionsPerServer; } + int getNumberOfClientSessionsPerServer() const { return a_numberOfClientSessionsPerServer; } /** * Sets the number of client-sessions per server. * Its recommended to set this global configuration although it is possible to configure each client-session separately. * \param numberOfClientSessionsPerServer Number of client-sessions per server. */ - void setNumberOfClientSessionsPerServer(int numberOfClientSessionsPerServer) throw() { a_numberOfClientSessionsPerServer = numberOfClientSessionsPerServer; } + void setNumberOfClientSessionsPerServer(int numberOfClientSessionsPerServer) { a_numberOfClientSessionsPerServer = numberOfClientSessionsPerServer; } /** @@ -235,13 +235,13 @@ public: * * \warning If no client-session found, an exception is launched by default. */ - ClientSession* findClientSession(const std::string & addr, int port, int socketId, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException); + ClientSession* findClientSession(const std::string & addr, int port, int socketId, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false); /** * Same as #findClientSession, but providing client session key (
:|) */ - ClientSession* findClientSession(const std::string & key, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException); + ClientSession* findClientSession(const std::string & key, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false); /** @@ -255,7 +255,7 @@ public: * * \warning If no server found, an exception is launched by default. */ - Server* findServer(const std::string & addr, int port, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException); + Server* findServer(const std::string & addr, int port, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false); /** * Returns entity instance identified by internal index. @@ -267,7 +267,7 @@ public: * * \warning If no entity found, an exception is launched by default. */ - Entity* findEntity(const socket_v & socketList, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException); + Entity* findEntity(const socket_v & socketList, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false); /** * Returns entity instance identified by internal index. @@ -282,7 +282,7 @@ public: * * \warning If no entity found, an exception is launched by default. */ - Entity* findEntity(const std::string & addr1, int port1, const std::string & addr2, int port2, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException); + Entity* findEntity(const std::string & addr1, int port1, const std::string & addr2, int port2, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false); /** * Creates a diameter entity with provided parameters. @@ -298,7 +298,7 @@ public: * indicates that 'ClassCode::Bind' has been correctly performed for any included client-session. */ Entity* createEntity(const socket_v & socketList, const std::string & description = "") - throw(anna::RuntimeException); + noexcept(false); /** * Creates a standard (dual) diameter entity with provided parameters. @@ -317,7 +317,7 @@ public: * indicates that 'ClassCode::Bind' has been correctly performed for any included client-session. */ Entity* createEntity(const std::string & addr1, int port1, const std::string & addr2, int port2, const std::string & description = "") - throw(anna::RuntimeException); + noexcept(false); /** @@ -331,7 +331,7 @@ public: * * \warning If no local server found, an exception is launched by default. */ - LocalServer* findLocalServer(const std::string & addr, int port, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException); + LocalServer* findLocalServer(const std::string & addr, int port, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false); /** * Returns server-session instance identified by INetAddress serialization provided. @@ -343,7 +343,7 @@ public: * * \warning If no server-session found, an exception is launched by default. */ - ServerSession* findServerSession(int socketId, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException); + ServerSession* findServerSession(int socketId, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false); /** * Creates a diameter local server with provided parameters. @@ -362,7 +362,7 @@ public: * \return The local server created or exception when is already created. */ LocalServer *createLocalServer(const std::string & addr, int port = Session::DefaultPort, int maxConnections = -1, const anna::Millisecond & allowedInactivityTime = ServerSession::DefaultAllowedInactivityTime, int category = 1, const std::string & description = "") - throw(anna::RuntimeException); + noexcept(false); /** @@ -371,7 +371,7 @@ public: @param destroy Free all engine entity resources */ - void close(bool destroy = false) throw(anna::RuntimeException) { closeEntities(destroy); closeLocalServers(destroy); } + void close(bool destroy = false) noexcept(false) { closeEntities(destroy); closeLocalServers(destroy); } /** @@ -380,7 +380,7 @@ public: Optionally all entities resources may be freed passing true; in this case, close is immediately performed: @param destroy Free all engine entity resources */ - void closeEntities(bool destroy = false) throw(anna::RuntimeException); + void closeEntities(bool destroy = false) noexcept(false); /** @@ -390,7 +390,7 @@ public: * \param entity Diameter entity to be closed. * \param destroy Deletes entity over the engine and all its resources. */ - void closeEntity(Entity* entity, bool destroy = false) throw(anna::RuntimeException); + void closeEntity(Entity* entity, bool destroy = false) noexcept(false); /** @@ -399,7 +399,7 @@ public: @param destroy Free all engine local servers resources and server sessions within them. */ - void closeLocalServers(bool destroy = false) throw(anna::RuntimeException); + void closeLocalServers(bool destroy = false) noexcept(false); /** * Close local server socket and its children server sessions. @@ -410,49 +410,49 @@ public: * \param localServer Local server to be closed. * \param destroy Deletes local server over engine and all its resources (server sessions within it). */ - void closeLocalServer(LocalServer * localServer, bool destroy = false) throw(anna::RuntimeException); + void closeLocalServer(LocalServer * localServer, bool destroy = false) noexcept(false); /** Gets the number of requests messages over-the-air for entities. @return OTA messages. */ - int getOTARequestsForEntities() const throw(); + int getOTARequestsForEntities() const ; /** Gets the number of requests messages over-the-air for local servers. @return OTA messages. */ - int getOTARequestsForLocalServers() const throw(); + int getOTARequestsForLocalServers() const ; /** Gets the number of requests messages over-the-air for entities plus local servers. @return OTA messages. */ - int getOTARequests() const throw() { return (getOTARequestsForEntities() + getOTARequestsForLocalServers()); } + int getOTARequests() const { return (getOTARequestsForEntities() + getOTARequestsForLocalServers()); } /** Returns idle state (no pending answers) for entities. @return Idle state. */ - bool idleForEntities() const throw() { return (getOTARequestsForEntities() == 0); } + bool idleForEntities() const { return (getOTARequestsForEntities() == 0); } /** Returns idle state (no pending answers). @return Idle state. */ - bool idleForLocalServers() const throw() { return (getOTARequestsForLocalServers() == 0); } + bool idleForLocalServers() const { return (getOTARequestsForLocalServers() == 0); } /** Returns idle state (no pending answers for entities or local servers). @return Idle state. */ - bool idle() const throw() { return (getOTARequests() == 0); } + bool idle() const { return (getOTARequests() == 0); } /** Sent a message to all the engine entities. @@ -463,8 +463,8 @@ public: @return Returns true (success) only when broadcast is success over all the engine entities. If any entity fails, then false is returned. Broadcast try to send all over the resources in spite of any fail. */ - bool broadcastEntities(const Message*message) throw(anna::RuntimeException); - bool broadcastEntities(const Message& message) throw(anna::RuntimeException) { return broadcastEntities(&message); } + bool broadcastEntities(const Message*message) noexcept(false); + bool broadcastEntities(const Message& message) noexcept(false) { return broadcastEntities(&message); } /** Sent a message through all the engine local servers. @@ -475,22 +475,22 @@ public: @return Returns true (success) only when broadcast is success over all the engine local servers. If any local server fails, then false is returned. Broadcast try to send all over the resources in spite of any fail. */ - bool broadcastLocalServers(const Message*message) throw(anna::RuntimeException); - bool broadcastLocalServers(const Message& message) throw(anna::RuntimeException) { return broadcastLocalServers(&message); } + bool broadcastLocalServers(const Message*message) noexcept(false); + bool broadcastLocalServers(const Message& message) noexcept(false) { return broadcastLocalServers(&message); } /** * Class string representation * * @return String with class content */ - virtual std::string asString(void) const throw(); + virtual std::string asString(void) const ; /** Class XML representation. \param parent XML node over which we will put instance information. \return XML documentcon with class content. */ - virtual anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); + virtual anna::xml::Node* asXML(anna::xml::Node* parent) const ; /** @@ -498,70 +498,70 @@ public: Applications must decide to do any other tasks at this idle/isolated situation. Default implementation do nothing. */ - virtual void availabilityLostForLocalServers(Engine *) const throw() {;} + virtual void availabilityLostForLocalServers(Engine *) const {;} /** When there is any bound server session over the engine, this virtual method will be invoked. Applications must decide to do be ready for incoming traffic. Default implementation do nothing. */ - virtual void availabilityRecoveredForLocalServers(Engine *) const throw() {;} + virtual void availabilityRecoveredForLocalServers(Engine *) const {;} /** When there is not bound entity over the engine, this virtual method will be invoked. Many applications must change communicator status to Unavailable when no engines are available. Default implementation do nothing. */ - virtual void availabilityLostForEntities(Engine *) const throw() {;} + virtual void availabilityLostForEntities(Engine *) const {;} /** When there is any bound entity over the engine, this virtual method will be invoked. Many applications must recover communicator status to Available when any engine are available. Default implementation do nothing. */ - virtual void availabilityRecoveredForEntities(Engine *) const throw() {;} + virtual void availabilityRecoveredForEntities(Engine *) const {;} /** When there is not bound server-session over the local server, this virtual method will be invoked. Default implementation do nothing. */ - virtual void availabilityLost(LocalServer *) const throw() {;} + virtual void availabilityLost(LocalServer *) const {;} /** When there is any bound server-session over the local server, this virtual method will be invoked. Default implementation do nothing. */ - virtual void availabilityRecovered(LocalServer *) const throw() {;} + virtual void availabilityRecovered(LocalServer *) const {;} /** When there is not bound server over the entity, this virtual method will be invoked. Default implementation do nothing. */ - virtual void availabilityLost(Entity *) const throw() {;} + virtual void availabilityLost(Entity *) const {;} /** When there is any bound server over the entity, this virtual method will be invoked. Default implementation do nothing. */ - virtual void availabilityRecovered(Entity *) const throw() {;} + virtual void availabilityRecovered(Entity *) const {;} /** When there is not bound client-session over the server, this virtual method will be invoked. Default implementation do nothing. */ - virtual void availabilityLost(Server *) const throw() {;} + virtual void availabilityLost(Server *) const {;} /** When there is any bound client-session over the server, this virtual method will be invoked. Default implementation do nothing. */ - virtual void availabilityRecovered(Server *) const throw() {;} + virtual void availabilityRecovered(Server *) const {;} /** When a subyacent client session is going to be bound, this method is invoked before. Default implementation do nothing. */ - virtual void bindingClientSession(const ClientSession *) const throw() {;} + virtual void bindingClientSession(const ClientSession *) const {;} /** * Class user should implement this method in order to define Disconnect-Peer-Answer for last received DPR. @@ -573,14 +573,14 @@ public: * @param dpa DPA datablock passed as reference * @param dpr Corresponding DPR received (sequence values must be taken into account in order to build DPA) */ - virtual void readDPA(anna::DataBlock &dpa, const anna::DataBlock & dpr) throw(); + virtual void readDPA(anna::DataBlock &dpa, const anna::DataBlock & dpr) ; /** * Sets optional CEA from file, when default is not enough * * @param &ceaPathfile Path file for the CEA xml message provided */ - void setCEA(const std::string &ceaPathfile) throw() { a_ceaPathfile = ceaPathfile; } + void setCEA(const std::string &ceaPathfile) { a_ceaPathfile = ceaPathfile; } /** * Class user should implement this method in order to define Capabilities-Exchange-Answer for received CER over server socket. @@ -611,7 +611,7 @@ public: * @param cea CEA datablock passed as reference. Empty cea implies to discard CER received. * @param cer Corresponding CER received (sequence values must be taken into account in order to build CEA) */ - virtual void readCEA(anna::DataBlock &cea, const anna::DataBlock & cer) throw(); + virtual void readCEA(anna::DataBlock &cea, const anna::DataBlock & cer) ; /** * Class user should implement this method in order to define Device-Watchdog-Answer for received DWR over server socket. @@ -622,7 +622,7 @@ public: * @param dwa DWA datablock passed as reference * @param dwr Corresponding DWR received (sequence values must be taken into account in order to build DWA) */ - virtual void readDWA(anna::DataBlock &dwa, const anna::DataBlock & dwr) throw(); + virtual void readDWA(anna::DataBlock &dwa, const anna::DataBlock & dwr) ; /** * DRA basics: CER information is gathered on every server session managed by the diameter comm engine. You could send the message to a @@ -635,13 +635,13 @@ public: * * @return transactional response reference, or NULL if answer is sent */ - const Response* sendRealmHost(const Message* message, const std::string &destinationRealm, const std::string &destinationHost = "") throw(anna::RuntimeException); + const Response* sendRealmHost(const Message* message, const std::string &destinationRealm, const std::string &destinationHost = "") noexcept(false); /** Reset engine statistics. At the moment, only diameter servers processing time is observed. */ - void resetStatistics() throw(); + void resetStatistics() ; /** @@ -650,7 +650,7 @@ public: * but it is recommended to start the component and set its state as 'running' from the point of view of the * application. */ - void lazyInitialize() throw(RuntimeException); + void lazyInitialize() noexcept(false); protected: @@ -669,16 +669,16 @@ protected: Engine(const char *className, const stack::Dictionary *baseProtocolDictionary); // INTERNAL CREATORS AND CLOSE METHODS - Server *createServer(Entity*, const socket_t&) throw(anna::RuntimeException); - void closeServer(Server*, bool) throw(anna::RuntimeException); - ClientSession *createClientSession(Server*, int) throw(anna::RuntimeException); - void closeClientSession(ClientSession*, bool) throw(anna::RuntimeException); + Server *createServer(Entity*, const socket_t&) noexcept(false); + void closeServer(Server*, bool) noexcept(false); + ClientSession *createClientSession(Server*, int) noexcept(false); + void closeClientSession(ClientSession*, bool) noexcept(false); // INTERNAL ALLOCATORS - Server* allocateServer() throw(); - void releaseServer(Server*) throw(); - ClientSession* allocateClientSession() throw(); - void releaseClientSession(ClientSession*) throw(); + Server* allocateServer() ; + void releaseServer(Server*) ; + ClientSession* allocateClientSession() ; + void releaseClientSession(ClientSession*) ; /** @@ -688,14 +688,14 @@ protected: \see anna::Recycler */ - virtual Entity* allocateEntity() throw() { return NULL; } + virtual Entity* allocateEntity() { return NULL; } /** Invoked to free entities. \see anna::Recycler */ - virtual void releaseEntity(Entity*) throw() {;} + virtual void releaseEntity(Entity*) {;} /** @@ -705,14 +705,14 @@ protected: \see anna::Recycler */ - virtual LocalServer* allocateLocalServer() throw() { return NULL; } + virtual LocalServer* allocateLocalServer() { return NULL; } /** Invoked to free local servers. \see anna::Recycler */ - virtual void releaseLocalServer(LocalServer*) throw() {;} + virtual void releaseLocalServer(LocalServer*) {;} // Gets the base protocol codec engine used internally. // This engine is initializaed on constructor with the base protocol dictionary. @@ -720,7 +720,7 @@ protected: // regarding configuration changes (validation depth/mode, fix mode, etc.). // // @return Pointer to the internal base protocol codec engine - codec::Engine *getBaseProtocolCodecEngine() const throw() { return const_cast(&a_baseProtocolCodecEngine); } + codec::Engine *getBaseProtocolCodecEngine() const { return const_cast(&a_baseProtocolCodecEngine); } private: @@ -749,24 +749,24 @@ private: // Availability bool a_availableForEntities; // any of the entities must be bound - void availabilityLostForEntities() throw(); - void availabilityRecoveredForEntities() throw(); - bool refreshAvailabilityForEntities() throw(); // return true if change + void availabilityLostForEntities() ; + void availabilityRecoveredForEntities() ; + bool refreshAvailabilityForEntities() ; // return true if change bool a_availableForLocalServers; // any of the local servers must be bound - void availabilityLostForLocalServers() throw(); - void availabilityRecoveredForLocalServers() throw(); - bool refreshAvailabilityForLocalServers() throw(); // return true if change + void availabilityLostForLocalServers() ; + void availabilityRecoveredForLocalServers() ; + bool refreshAvailabilityForLocalServers() ; // return true if change - void eraseDeprecatedIdleEntities() throw(); + void eraseDeprecatedIdleEntities() ; // Component: - void do_initialize() throw(anna::RuntimeException); - void do_stop() throw(); + void do_initialize() noexcept(false); + void do_stop() ; // Integrity: - void checkEntityCollision(const socket_v &) throw(anna::RuntimeException); - void assertBaseProtocolHealth() throw(anna::RuntimeException); // checks the dictionary + void checkEntityCollision(const socket_v &) noexcept(false); + void assertBaseProtocolHealth() noexcept(false); // checks the dictionary ////////////////////////// @@ -780,45 +780,45 @@ private: typedef clientSession_container::const_iterator const_clientSession_iterator; clientSession_container a_clientSessions; anna::Recycler a_clientSessionsRecycler; - clientSession_iterator clientSession_find(const clientSession_key&) throw(); - clientSession_iterator clientSession_begin() throw() { return a_clientSessions.begin(); } - clientSession_iterator clientSession_end() throw() { return a_clientSessions.end(); } - static ClientSession* clientSession(clientSession_iterator ii) throw() { return ii->second; } - const_clientSession_iterator clientSession_begin() const throw() { return a_clientSessions.begin(); } - const_clientSession_iterator clientSession_end() const throw() { return a_clientSessions.end(); } - static const ClientSession* clientSession(const_clientSession_iterator ii) throw() { return ii->second; } + clientSession_iterator clientSession_find(const clientSession_key&) ; + clientSession_iterator clientSession_begin() { return a_clientSessions.begin(); } + clientSession_iterator clientSession_end() { return a_clientSessions.end(); } + static ClientSession* clientSession(clientSession_iterator ii) { return ii->second; } + const_clientSession_iterator clientSession_begin() const { return a_clientSessions.begin(); } + const_clientSession_iterator clientSession_end() const { return a_clientSessions.end(); } + static const ClientSession* clientSession(const_clientSession_iterator ii) { return ii->second; } typedef socket_t server_key; - server_key getServerKey(const std::string & addr, int port) const throw(); + server_key getServerKey(const std::string & addr, int port) const ; typedef std::map server_container; typedef server_container::value_type server_value_type; typedef server_container::iterator server_iterator; typedef server_container::const_iterator const_server_iterator; server_container a_servers; anna::Recycler a_serversRecycler; - server_iterator server_find(const server_key&) throw(); - server_iterator server_begin() throw() { return a_servers.begin(); } - server_iterator server_end() throw() { return a_servers.end(); } - static Server* server(server_iterator ii) throw() { return ii->second; } - const_server_iterator server_begin() const throw() { return a_servers.begin(); } - const_server_iterator server_end() const throw() { return a_servers.end(); } - static const Server* server(const_server_iterator ii) throw() { return ii->second; } + server_iterator server_find(const server_key&) ; + server_iterator server_begin() { return a_servers.begin(); } + server_iterator server_end() { return a_servers.end(); } + static Server* server(server_iterator ii) { return ii->second; } + const_server_iterator server_begin() const { return a_servers.begin(); } + const_server_iterator server_end() const { return a_servers.end(); } + static const Server* server(const_server_iterator ii) { return ii->second; } typedef std::string entity_key; // 'ADDR1:PORT1 ADDR2:PORT2 ADDR3:PORT3 ...' - entity_key getEntityKey(const socket_v &) const throw(); - entity_key getEntityKey(const std::string & addr1, int port1, const std::string & addr2, int port2) const throw(); + entity_key getEntityKey(const socket_v &) const ; + entity_key getEntityKey(const std::string & addr1, int port1, const std::string & addr2, int port2) const ; typedef std::map entity_container; typedef entity_container::value_type entity_value_type; typedef entity_container::iterator entity_iterator; typedef entity_container::const_iterator const_entity_iterator; entity_container a_entities; - entity_iterator entity_find(const entity_key&) throw(); - entity_iterator entity_begin() throw() { return a_entities.begin(); } - entity_iterator entity_end() throw() { return a_entities.end(); } - static Entity* entity(entity_iterator ii) throw() { return ii->second; } - const_entity_iterator entity_begin() const throw() { return a_entities.begin(); } - const_entity_iterator entity_end() const throw() { return a_entities.end(); } - static const Entity* entity(const_entity_iterator ii) throw() { return ii->second; } + entity_iterator entity_find(const entity_key&) ; + entity_iterator entity_begin() { return a_entities.begin(); } + entity_iterator entity_end() { return a_entities.end(); } + static Entity* entity(entity_iterator ii) { return ii->second; } + const_entity_iterator entity_begin() const { return a_entities.begin(); } + const_entity_iterator entity_end() const { return a_entities.end(); } + static const Entity* entity(const_entity_iterator ii) { return ii->second; } ////////////////////////// @@ -831,13 +831,13 @@ private: typedef localServer_container::iterator localServer_iterator; typedef localServer_container::const_iterator const_localServer_iterator; localServer_container a_localServers; - localServer_iterator localServer_find(const socket_t&) throw(); - localServer_iterator localServer_begin() throw() { return a_localServers.begin(); } - localServer_iterator localServer_end() throw() { return a_localServers.end(); } - static LocalServer* localServer(localServer_iterator ii) throw() { return ii->second; } - const_localServer_iterator localServer_begin() const throw() { return a_localServers.begin(); } - const_localServer_iterator localServer_end() const throw() { return a_localServers.end(); } - static const LocalServer* localServer(const_localServer_iterator ii) throw() { return ii->second; } + localServer_iterator localServer_find(const socket_t&) ; + localServer_iterator localServer_begin() { return a_localServers.begin(); } + localServer_iterator localServer_end() { return a_localServers.end(); } + static LocalServer* localServer(localServer_iterator ii) { return ii->second; } + const_localServer_iterator localServer_begin() const { return a_localServers.begin(); } + const_localServer_iterator localServer_end() const { return a_localServers.end(); } + static const LocalServer* localServer(const_localServer_iterator ii) { return ii->second; } // Server sessions are managed within LocalServer (not at engine) due to dynamic creation nature // Here we maintain the Destination-Realm / Destination-Host maps for DRA basics: @@ -851,7 +851,7 @@ private: typedef dr_dh_server_sessions_map_t::const_iterator dr_dh_server_sessions_it_t; typedef dr_dh_server_sessions_map_t::iterator dr_dh_server_sessions_nc_it_t; dr_dh_server_sessions_map_t a_dr_dh_server_sessions; - void manageDrDhServerSession(ServerSession *ss, bool register_or_desregister) throw(); + void manageDrDhServerSession(ServerSession *ss, bool register_or_desregister) ; friend class Session; friend class ClientSession; diff --git a/include/anna/diameter.comm/Entity.hpp b/include/anna/diameter.comm/Entity.hpp index 0dd1b90..b8ade9b 100644 --- a/include/anna/diameter.comm/Entity.hpp +++ b/include/anna/diameter.comm/Entity.hpp @@ -75,12 +75,12 @@ private: // Availability bool a_available; // any of the servers must be bound - void availabilityLost() throw(); - void availabilityRecovered() throw(); - bool refreshAvailability() throw(); // return true if change - void assertReady() throw(anna::RuntimeException); - void initialize() throw(); - void childIdle() const throw(); + void availabilityLost() ; + void availabilityRecovered() ; + bool refreshAvailability() ; // return true if change + void assertReady() noexcept(false); + void initialize() ; + void childIdle() const ; // Selected for remove bool a_deprecated; // entity has been selected as deprecated (will be removed when idle) @@ -94,14 +94,14 @@ private: // Activity anna::Millisecond a_lastIncomingActivityTime; // last unix timestamp (in milliseconds) when message reception was managed over this entity anna::Millisecond a_lastOutgoingActivityTime; // last unix timestamp (in milliseconds) when message sending was managed over this entity - void updateIncomingActivityTime() throw(); - void updateOutgoingActivityTime() throw(); + void updateIncomingActivityTime() ; + void updateOutgoingActivityTime() ; // Private close/destroy method - void close(bool destroy) throw(anna::RuntimeException); + void close(bool destroy) noexcept(false); // helpers - static const char* asText(const SessionBasedModelsType::_v) throw(); + static const char* asText(const SessionBasedModelsType::_v) ; public: @@ -119,14 +119,14 @@ public: * * @param maxServers Maximum number of servers managed by the entity. */ - void setMaxServers(int maxServers) throw() { a_maxServers = maxServers; } + void setMaxServers(int maxServers) { a_maxServers = maxServers; } /** * Gets the maximum number of servers managed by the entity. * * @return Maximum number of servers managed by the entity. */ - int getMaxServers() const throw() { return a_maxServers; } + int getMaxServers() const { return a_maxServers; } /** @@ -134,27 +134,27 @@ public: * * @param description Entity description. Empty by default. */ - void setDescription(const std::string &description) throw() { a_description = description; } + void setDescription(const std::string &description) { a_description = description; } /** * Gets the entity description. * * @return Entity description. */ - const std::string & getDescription() const throw() { return a_description; } + const std::string & getDescription() const { return a_description; } /** * Sets the diameter::comm::Engine * @param e Diameter::comm::Engine */ - void setEngine(Engine *e) throw() { a_engine = e; } + void setEngine(Engine *e) { a_engine = e; } /** * Gets the diameter::comm::Engine * @return Diameter::comm::Engine */ - Engine *getEngine() const throw() { return a_engine; } + Engine *getEngine() const { return a_engine; } /** * Add a server to the entity and create all the servers configured at #setSocketsPerDiameterServer within that server. @@ -163,21 +163,21 @@ public: * * @return Returns success on send operation over any server within the entity */ - void addServer(const socket_t & serverId) throw(anna::RuntimeException); + void addServer(const socket_t & serverId) noexcept(false); /** * Binds entity servers. * * @return Returns true if all client-session were successfully bound */ - bool bind() throw(anna::RuntimeException); + bool bind() noexcept(false); /** * Propagate auto recovery configuration to servers within entity * * @param autoRecovery Auto recovery indicator. True by default. */ - void raiseAutoRecovery(bool autoRecovery = true) throw(anna::RuntimeException); + void raiseAutoRecovery(bool autoRecovery = true) noexcept(false); /** Sets timeout for wait responses for any class code request for all entity servers @@ -185,27 +185,27 @@ public: \param v Diameter request type. \param millisecond Milliseconds for timeout */ - void setClassCodeTimeout(const ClassCode::_v v, const anna::Millisecond & millisecond) throw(); + void setClassCodeTimeout(const ClassCode::_v v, const anna::Millisecond & millisecond) ; /** Sets entity category. Used by application in order to categorize or clasify. @param category Entity category */ - void setCategory(int category) throw() { a_category = category; } + void setCategory(int category) { a_category = category; } /** Gets entity category. Used by application in order to categorize or clasify. @return Entity category */ - int getCategory() const throw() { return a_category; } + int getCategory() const { return a_category; } /** Gets the last used resource (server) during sending. Broadcast doesn't updates this information. */ - Server *getLastUsedResource() const throw() { return (a_lastUsedResource); } + Server *getLastUsedResource() const { return (a_lastUsedResource); } /** @@ -214,14 +214,14 @@ public: * * @param balance True or false to enable or disable. */ - void setBalance (bool balance) throw() { a_balance = balance; } + void setBalance (bool balance) { a_balance = balance; } /** * Gets the balance mode * * @return True if balance over entity servers is enabled, false if standard behaviour is configured (default). */ - bool getBalance() const throw() { return a_balance; } + bool getBalance() const { return a_balance; } // SIMPLE BALANCE or STANDARD documentation version @@ -269,20 +269,20 @@ public: and error counter will be generated in this case). Broadcast try to send all over the resources in spite of any fail. */ - bool send(const Message *message) throw(anna::RuntimeException); - bool send(const Message &message) throw(anna::RuntimeException) { return send(&message); } + bool send(const Message *message) noexcept(false); + bool send(const Message &message) noexcept(false) { return send(&message); } /** * Sets sessions based models type. * \param sessionBasedModelsType Session based models type: RoundRobin, SessionIdLowPart (default), SessionIdHighPart or SessionIdOptionalPart. */ - void setSessionBasedModelsType(const SessionBasedModelsType::_v sessionBasedModelsType) throw() { a_sessionBasedModelsType = sessionBasedModelsType; } + void setSessionBasedModelsType(const SessionBasedModelsType::_v sessionBasedModelsType) { a_sessionBasedModelsType = sessionBasedModelsType; } /** * Returns sessions based models type. * \return Session based models type: RoundRobin, SessionIdLowPart, SessionIdHighPart or SessionIdOptionalPart. */ - SessionBasedModelsType::_v getSessionBasedModelsType() const throw() { return a_sessionBasedModelsType; } + SessionBasedModelsType::_v getSessionBasedModelsType() const { return a_sessionBasedModelsType; } /** @@ -340,7 +340,7 @@ public: @return Socket-id used within range [0,maxClientSessions-1]. Value '-1' if round-robin is desired. If socket-id is return out of range, send procedure will throw an exception. */ - virtual int readSocketId(const Message *message, int maxClientSessions) const throw(); + virtual int readSocketId(const Message *message, int maxClientSessions) const ; /** @@ -352,24 +352,24 @@ public: @return Returns true (success) only when broadcast is success over all the entity servers. If any server fails, then false is returned. */ - bool broadcast(const Message *message) throw(anna::RuntimeException); - bool broadcast(const Message &message) throw(anna::RuntimeException) { return broadcast(&message); } + bool broadcast(const Message *message) noexcept(false); + bool broadcast(const Message &message) noexcept(false) { return broadcast(&message); } /** Returns true when any of the entity servers is Bound. False when all not-bound. */ - bool isAvailable() const throw() { return a_available; } + bool isAvailable() const { return a_available; } /** Returns true when the entity has been selected as deprecated */ - bool isDeprecated() const throw() { return a_deprecated; } + bool isDeprecated() const { return a_deprecated; } /** Sets the entity deprecated state */ - void setDeprecated(bool deprecated = true) throw() { a_deprecated = deprecated; } + void setDeprecated(bool deprecated = true) { a_deprecated = deprecated; } /** @@ -377,81 +377,81 @@ public: @return OTA messages. */ - int getOTARequests() const throw(); + int getOTARequests() const ; /** Returns idle state (no pending answers). @return Idle state. */ - bool idle() const throw() { return (getOTARequests() == 0); } + bool idle() const { return (getOTARequests() == 0); } - std::vector::iterator begin() throw() { return a_servers.begin(); } - std::vector::iterator end() throw() { return a_servers.end(); } - std::vector::const_iterator begin() const throw() { return a_servers.begin(); } - std::vector::const_iterator end() const throw() { return a_servers.end(); } + std::vector::iterator begin() { return a_servers.begin(); } + std::vector::iterator end() { return a_servers.end(); } + std::vector::const_iterator begin() const { return a_servers.begin(); } + std::vector::const_iterator end() const { return a_servers.end(); } /** Close all the entity servers (close client-sessions within them). Depending on client-session configuration ('OnDisconnect' behaviour), pending answers will be wait (graceful) or ignored (immediate-abrupt close). Resources are not destroyed. */ - void close() throw(anna::RuntimeException) { close(false /* no destroy */); } + void close() noexcept(false) { close(false /* no destroy */); } // helpers /** Number of currently configured servers */ - int getNumberOfServers() const throw() { return a_servers.size(); } + int getNumberOfServers() const { return a_servers.size(); } /** Number of maximum allowed servers */ - int getMaxServerss() const throw() { return a_maxServers; } + int getMaxServerss() const { return a_maxServers; } /** List of (address,port) pairs defining entity servers */ - socket_v getAddressPortList() const throw(); + socket_v getAddressPortList() const ; /** Deny resources for delivery restriction. Deny all its servers */ - void hide() throw(); + void hide() ; /** Allow resource for delivery permission. Allow all its servers */ - void show() throw(); + void show() ; /** Returns true when all its servers resources are hidden for application messages delivery */ - bool hidden() const throw(); + bool hidden() const ; /** Returns true when all its servers resources are shown for application messages delivery */ - bool shown() const throw(); + bool shown() const ; /** Class string representation \return String with relevant information for this instance. */ - std::string asString() const throw(); + std::string asString() const ; /** Class xml representation \param parent Parent XML node on which hold this instance information. \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 ; protected: @@ -461,7 +461,7 @@ protected: Default implementation traces warning event \param clientSession ClientSession from which shutdown has been received */ - virtual void eventPeerShutdown(const ClientSession* clientSession) throw(); + virtual void eventPeerShutdown(const ClientSession* clientSession) ; /** Handler about a request retransmission over the session. @@ -469,14 +469,14 @@ protected: \param clientSession ClientSession from which retransmission happened \param request Retransmitted request message */ - virtual void eventRequestRetransmission(const ClientSession* clientSession, Message *request) throw(); + virtual void eventRequestRetransmission(const ClientSession* clientSession, Message *request) ; /** Handler for diameter server (server) responses \param response Answer container object for corresponding diameter request */ - virtual void eventResponse(const Response& response) throw(anna::RuntimeException) = 0; + virtual void eventResponse(const Response& response) noexcept(false) = 0; /** Handler for diameter server (server) requests @@ -484,8 +484,8 @@ protected: \param clientSession ClientSession from which request has been received \param request Diameter request message received */ - virtual void eventRequest(ClientSession* clientSession, const anna::DataBlock &request) throw(anna::RuntimeException) = 0; - //virtual void eventRequest(ClientSession* clientSession, const Message& request) throw(anna::RuntimeException) = 0; + virtual void eventRequest(ClientSession* clientSession, const anna::DataBlock &request) noexcept(false) = 0; + //virtual void eventRequest(ClientSession* clientSession, const Message& request) noexcept(false) = 0; /** Handler for diameter session responses out of context @@ -493,7 +493,7 @@ protected: \param clientSession ClientSession from which request has been received \param response Answer data block object without context match */ - virtual void eventUnknownResponse(ClientSession *clientSession, const anna::DataBlock& response) throw(anna::RuntimeException) = 0; + virtual void eventUnknownResponse(ClientSession *clientSession, const anna::DataBlock& response) noexcept(false) = 0; /** Handler for diameter session Disconnect-Peer-Answer messages @@ -501,7 +501,7 @@ protected: \param clientSession ClientSession from which request has been received \param response Answer data block object without context match */ - virtual void eventDPA(ClientSession *clientSession, const anna::DataBlock& response) throw(anna::RuntimeException) = 0; + virtual void eventDPA(ClientSession *clientSession, const anna::DataBlock& response) noexcept(false) = 0; diff --git a/include/anna/diameter.comm/LocalServer.hpp b/include/anna/diameter.comm/LocalServer.hpp index e0ce97c..ba1d494 100644 --- a/include/anna/diameter.comm/LocalServer.hpp +++ b/include/anna/diameter.comm/LocalServer.hpp @@ -69,52 +69,52 @@ class LocalServer { // Statistics MessageStatistics a_messageStatistics; - void initializeStatisticResources() throw(); - void resetStatistics() throw(); + void initializeStatisticResources() ; + void resetStatistics() ; -// void eraseServerSession(const anna::comm::ClientSocket& clientSocket) throw(); -// void eraseServerSession(const serverSession_iterator &it) throw(); - void lostConnection() throw(); - void newConnection() throw(anna::RuntimeException); +// void eraseServerSession(const anna::comm::ClientSocket& clientSocket) ; +// void eraseServerSession(const serverSession_iterator &it) ; + void lostConnection() ; + void newConnection() noexcept(false); // Activity anna::Millisecond a_lastIncomingActivityTime; // last unix timestamp (in milliseconds) when message reception was managed over this entity anna::Millisecond a_lastOutgoingActivityTime; // last unix timestamp (in milliseconds) when message sending was managed over this entity - void updateIncomingActivityTime() throw(); - void updateOutgoingActivityTime() throw(); + void updateIncomingActivityTime() ; + void updateOutgoingActivityTime() ; // Availability bool a_available; // any of the server-sessions must be bound - void availabilityLost() throw(); - void availabilityRecovered() throw(); - bool refreshAvailability() throw(); // return true if change + void availabilityLost() ; + void availabilityRecovered() ; + bool refreshAvailability() ; // return true if change - void attach() throw(); // attach server socket to the communicator - void attachPlanning() throw(); // used when attach fails (socket already in use, etc.) + void attach() ; // attach server socket to the communicator + void attachPlanning() ; // used when attach fails (socket already in use, etc.) typedef int serverSession_key; - serverSession_key getServerSessionKey(const anna::comm::ClientSocket&) const throw(); // hash for Client Socket INetAddress serialization + serverSession_key getServerSessionKey(const anna::comm::ClientSocket&) const ; // hash for Client Socket INetAddress serialization typedef std::map serverSession_container; typedef serverSession_container::value_type serverSession_value_type; typedef serverSession_container::iterator serverSession_iterator; typedef serverSession_container::const_iterator const_serverSession_iterator; serverSession_container a_serverSessions; anna::Recycler a_serverSessionsRecycler; - serverSession_iterator serverSession_find(const serverSession_key&) throw(); - serverSession_iterator serverSession_begin() throw() { return a_serverSessions.begin(); } - serverSession_iterator serverSession_end() throw() { return a_serverSessions.end(); } - static ServerSession* serverSession(serverSession_iterator ii) throw() { return ii->second; } - const_serverSession_iterator serverSession_begin() const throw() { return a_serverSessions.begin(); } - const_serverSession_iterator serverSession_end() const throw() { return a_serverSessions.end(); } - static const ServerSession* serverSession(const_serverSession_iterator ii) throw() { return ii->second; } + serverSession_iterator serverSession_find(const serverSession_key&) ; + serverSession_iterator serverSession_begin() { return a_serverSessions.begin(); } + serverSession_iterator serverSession_end() { return a_serverSessions.end(); } + static ServerSession* serverSession(serverSession_iterator ii) { return ii->second; } + const_serverSession_iterator serverSession_begin() const { return a_serverSessions.begin(); } + const_serverSession_iterator serverSession_end() const { return a_serverSessions.end(); } + static const ServerSession* serverSession(const_serverSession_iterator ii) { return ii->second; } // INTERNAL CREATORS AND CLOSE METHODS - ServerSession *createServerSession(const anna::comm::ClientSocket&) throw(anna::RuntimeException); - void closeServerSession(ServerSession*) throw(anna::RuntimeException); + ServerSession *createServerSession(const anna::comm::ClientSocket&) noexcept(false); + void closeServerSession(ServerSession*) noexcept(false); // INTERNAL ALLOCATORS - ServerSession* allocateServerSession() throw(); - void releaseServerSession(ServerSession*) throw(); + ServerSession* allocateServerSession() ; + void releaseServerSession(ServerSession*) ; // Auxiliary serverSession_iterator a_deliveryIterator; @@ -135,14 +135,14 @@ public: * Sets the local server key * @param LocalServer key */ - void setKey(const socket_t &key) throw() { a_key = key; } + void setKey(const socket_t &key) { a_key = key; } /** Sets the server socket optional description @param description Server socket description */ - void setDescription(const std::string description) throw() { a_description = description; } + void setDescription(const std::string description) { a_description = description; } /** Set timeout to consider failed a request. @@ -151,14 +151,14 @@ public: Timers are internally managed and automatically activated. */ - void setClassCodeTimeout(const ClassCode::_v v, const anna::Millisecond & millisecond) throw(); + void setClassCodeTimeout(const ClassCode::_v v, const anna::Millisecond & millisecond) ; /** Sets the server socket optional category @param description Server socket category */ - void setCategory(int category) throw() { a_category = category; } + void setCategory(int category) { a_category = category; } /** Sets the maximum supported connections. @@ -168,7 +168,7 @@ public: @param maxConnections Number of maximum connections allowed */ - void setMaxConnections(int maxConnections) throw(anna::RuntimeException); + void setMaxConnections(int maxConnections) noexcept(false); /** Sets the maximum allowed inactivity time on server sessions born over the local server before being reset. @@ -176,13 +176,13 @@ public: @param allowedInactivityTime Inactivity time allowed */ - void setAllowedInactivityTime(const anna::Millisecond & allowedInactivityTime) throw() { a_allowedInactivityTime = allowedInactivityTime; } + void setAllowedInactivityTime(const anna::Millisecond & allowedInactivityTime) { a_allowedInactivityTime = allowedInactivityTime; } /** * Sets the diameter::comm::Engine * @param e Diameter::comm::Engine */ - void setEngine(Engine *e) throw() { a_engine = e; } + void setEngine(Engine *e) { a_engine = e; } // getters @@ -190,35 +190,35 @@ public: * Gets the diameter::comm::Engine * @return Diameter::comm::Engine */ - Engine *getEngine() const throw() { return a_engine; } + Engine *getEngine() const { return a_engine; } /** * Gets the local server key * @return LocalServer key */ - const socket_t & getKey() const throw() { return a_key; } + const socket_t & getKey() const { return a_key; } /** Gets the number of maximum accepted connections that server socket is configured to handle */ - int getMaxConnections() const throw() { return a_maxConnections; } + int getMaxConnections() const { return a_maxConnections; } /** Gets the number of current connections being established through server socket */ - int getCurrentConnections() const throw() { return a_currentConnections; } + int getCurrentConnections() const { return a_currentConnections; } /** Gets the maximum allowed inactivity time on server sessions born over the local server before being reset @return Inactivity time allowed */ - const anna::Millisecond & getAllowedInactivityTime() const throw() { return a_allowedInactivityTime; } + const anna::Millisecond & getAllowedInactivityTime() const { return a_allowedInactivityTime; } /** Returns true when any of the server-sessions is Bound. False when all not-bound. */ - bool isAvailable() const throw() { return a_available; } + bool isAvailable() const { return a_available; } // helpers @@ -229,38 +229,38 @@ public: @param lock Locks disabled state (make it permanent even if new connections margin is reached). Used during diameter agent isolation (lost of service, maintenance, etc.) */ - void disable(bool lock = false) throw(anna::RuntimeException); + void disable(bool lock = false) noexcept(false); /** Enables local server socket (listener) @param unlock Unlocks permanent disabled states */ - void enable(bool unlock = false) throw(anna::RuntimeException); + void enable(bool unlock = false) noexcept(false); /** Gets the number of requests messages over-the-air. @return OTA messages. */ - int getOTARequests() const throw(); + int getOTARequests() const ; /** Returns idle state (no pending answers). @return Idle state. */ - bool idle() const throw() { return (getOTARequests() == 0); } + bool idle() const { return (getOTARequests() == 0); } /** Close the local server means two things: close the server socket and close all the server sessions born from this local server freeing such server sessions resources. */ - void close() throw(anna::RuntimeException); + void close() noexcept(false); /** Performs coherent server socket close procedure zeroing margin between current established connections and maximum allowed. */ - void resetConnectionsMargin() throw(anna::RuntimeException) { setMaxConnections(a_currentConnections); } + void resetConnectionsMargin() noexcept(false) { setMaxConnections(a_currentConnections); } /** @@ -273,7 +273,7 @@ public: * * \warning If no server-session found, an exception is launched by default. */ - ServerSession* findServerSession(const anna::comm::ClientSocket &clientSocket, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException); + ServerSession* findServerSession(const anna::comm::ClientSocket &clientSocket, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false); /** * Returns server-session instance identified by socket id provided (hash over serialized client socket information). @@ -285,7 +285,7 @@ public: * * \warning If no server-session found, an exception is launched by default. */ - ServerSession* findServerSession(int socketId, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException); + ServerSession* findServerSession(int socketId, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false); /** @@ -302,14 +302,14 @@ public: the resources in spite of any fail. If a specific socket id is provided, only this socket is used without trying any other and returning false if fails. */ - bool send(const Message*, int socketId = -1 /* default uses readSocketId() */) throw(anna::RuntimeException); - bool send(const Message& message, int socketId = -1 /* default uses readSocketId() */) throw(anna::RuntimeException) { return send(&message, socketId); } + bool send(const Message*, int socketId = -1 /* default uses readSocketId() */) noexcept(false); + bool send(const Message& message, int socketId = -1 /* default uses readSocketId() */) noexcept(false) { return send(&message, socketId); } /** Gets the last used resource (server session) during sending. Broadcast doesn't updates this information. */ - ServerSession *getLastUsedResource() const throw() { return (a_lastUsedResource); } + ServerSession *getLastUsedResource() const { return (a_lastUsedResource); } /** Before sending a message over each local server, socketId could be specified to select @@ -323,7 +323,7 @@ public: @return Socket-id (hash over serialized client socket information). Value '-1' if round-robin is desired. If socket-id is unkonwn, send procedure will throw an exception. */ - virtual int readSocketId(const Message *message) const throw() { return -1; } + virtual int readSocketId(const Message *message) const { return -1; } /** Sent a message to all the server sessions. @@ -334,28 +334,28 @@ public: @return Returns true (success) only when broadcast is success over all the entity servers. If any server fails, then false is returned. */ - bool broadcast(const Message *message) throw(anna::RuntimeException); - bool broadcast(const Message &message) throw(anna::RuntimeException) { return broadcast(&message); } + bool broadcast(const Message *message) noexcept(false); + bool broadcast(const Message &message) noexcept(false) { return broadcast(&message); } /** Class string representation \return String with relevant information for this instance. */ - std::string asString() const throw(); + std::string asString() const ; /** Class xml representation \param parent Parent XML node on which hold this instance information. \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 ; // Statistics - void updateProcessingTimeStatisticConcept(const double &value, const anna::diameter::CommandId &cid) throw(); - void updateReceivedMessageSizeStatisticConcept(const double &value, const anna::diameter::CommandId &cid) throw(); -// int getProcessingTimeStatisticConcept() const throw() { return a_processing_time__StatisticConceptId; } -// int getReceivedMessageSizeStatisticConcept() const throw() { return a_received_message_size__StatisticConceptId; } + void updateProcessingTimeStatisticConcept(const double &value, const anna::diameter::CommandId &cid) ; + void updateReceivedMessageSizeStatisticConcept(const double &value, const anna::diameter::CommandId &cid) ; +// int getProcessingTimeStatisticConcept() const { return a_processing_time__StatisticConceptId; } +// int getReceivedMessageSizeStatisticConcept() const { return a_received_message_size__StatisticConceptId; } protected: @@ -366,7 +366,7 @@ protected: Default implementation traces warning event \param serverSession ServerSession from which shutdown has been received */ - virtual void eventPeerShutdown(const ServerSession* serverSession) throw(); + virtual void eventPeerShutdown(const ServerSession* serverSession) ; /** Handler about a request retransmission over the server-session. @@ -374,14 +374,14 @@ protected: \param serverSession ServerSession from which retransmission happened \param request Retransmitted request message */ - virtual void eventRequestRetransmission(const ServerSession* serverSession, Message *request) throw(); + virtual void eventRequestRetransmission(const ServerSession* serverSession, Message *request) ; /** Handler for diameter client responses \param response Answer container object for corresponding diameter request */ - virtual void eventResponse(const Response& response) throw(anna::RuntimeException) = 0; + virtual void eventResponse(const Response& response) noexcept(false) = 0; /** Handler for diameter client requests @@ -389,8 +389,8 @@ protected: \param serverSession ServerSession from which request has been received \param request Request data block object for corresponding diameter reception */ - virtual void eventRequest(ServerSession* serverSession, const anna::DataBlock& request) throw(anna::RuntimeException) = 0; - //void eventRequest(ServerSession* serverSession, const Message& request) throw(anna::RuntimeException); + virtual void eventRequest(ServerSession* serverSession, const anna::DataBlock& request) noexcept(false) = 0; + //void eventRequest(ServerSession* serverSession, const Message& request) noexcept(false); /** Handler for diameter client responses out of context @@ -398,7 +398,7 @@ protected: \param serverSession ServerSession from which request has been received \param response Answer data block object without context match */ - virtual void eventUnknownResponse(ServerSession* serverSession, const anna::DataBlock& response) throw(anna::RuntimeException) = 0; + virtual void eventUnknownResponse(ServerSession* serverSession, const anna::DataBlock& response) noexcept(false) = 0; /** Handler for diameter client Disconnect-Peer-Answer messages @@ -406,7 +406,7 @@ protected: \param serverSession ServerSession from which request has been received \param response Answer data block object without context match */ - virtual void eventDPA(ServerSession* serverSession, const anna::DataBlock& response) throw(anna::RuntimeException) = 0; + virtual void eventDPA(ServerSession* serverSession, const anna::DataBlock& response) noexcept(false) = 0; friend class anna::diameter::comm::Timer; diff --git a/include/anna/diameter.comm/Message.hpp b/include/anna/diameter.comm/Message.hpp index 9fc265a..6e9acf3 100644 --- a/include/anna/diameter.comm/Message.hpp +++ b/include/anna/diameter.comm/Message.hpp @@ -62,13 +62,13 @@ public: Devuelve el tipo de la clase de esta peticion indicada en el contructor. \return El tipo de la clase de esta peticion indicada en el contructor. */ - const ClassCode::_v & getClassCode() const throw() { return a_classCode; } + const ClassCode::_v & getClassCode() const { return a_classCode; } /** * Devuelve la acci�n a realizar en caso de que el temporizador asociado a esta petici�n expire. * \return la acci�n a realizar en caso de que el temporizador asociado a esta petici�n expire. */ - OnExpiry::_v getOnExpiry() const throw() { return a_onExpiry; } + OnExpiry::_v getOnExpiry() const { return a_onExpiry; } /** * Establece la acci�n a realizar en caso de que el temporizador asociado a esta petici�n expire. @@ -76,38 +76,38 @@ public: * * \warning Establecer el valor OnExpiry::Ignore podr�a causar p�rdida de memoria y uso innecesario de recursos. */ - void setOnExpiry(const OnExpiry::_v onExpiry) throw() { a_onExpiry = onExpiry; } + void setOnExpiry(const OnExpiry::_v onExpiry) { a_onExpiry = onExpiry; } // Internal use (CER message) - void setClassCode(const ClassCode::_v & classCode) throw() { a_classCode = classCode; } + void setClassCode(const ClassCode::_v & classCode) { a_classCode = classCode; } /** Class string representation \return String with relevant information for this instance. */ - virtual std::string asString() const throw(); + virtual std::string asString() const ; /** Class xml representation \param parent Parent XML node on which hold this instance information. \return XML document with relevant information for this instance. */ - virtual anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); + virtual anna::xml::Node* asXML(anna::xml::Node* parent) const ; // Helpers - HopByHop getHopByHop() const throw(); - EndToEnd getEndToEnd() const throw(); - HopByHop getRequestHopByHop() const throw() { return a_requestHopByHop; } - EndToEnd getRequestEndToEnd() const throw() { return a_requestEndToEnd; } - void setRequestHopByHop(HopByHop hbh) throw() { a_requestHopByHop = hbh; } - void setRequestEndToEnd(EndToEnd ete) throw() { a_requestEndToEnd = ete; } - CommandId getCommandId(bool &isRequest) const throw(); - CommandId getCommandId() const throw() { bool dummy; return getCommandId(dummy); } - ApplicationId getApplicationId() const throw(); - - bool fixRequestSequence(HopByHop hbh, EndToEnd ete) throw(); + HopByHop getHopByHop() const ; + EndToEnd getEndToEnd() const ; + HopByHop getRequestHopByHop() const { return a_requestHopByHop; } + EndToEnd getRequestEndToEnd() const { return a_requestEndToEnd; } + void setRequestHopByHop(HopByHop hbh) { a_requestHopByHop = hbh; } + void setRequestEndToEnd(EndToEnd ete) { a_requestEndToEnd = ete; } + CommandId getCommandId(bool &isRequest) const ; + CommandId getCommandId() const { bool dummy; return getCommandId(dummy); } + ApplicationId getApplicationId() const ; + + bool fixRequestSequence(HopByHop hbh, EndToEnd ete) ; // http://diameter-protocol.blogspot.com.es/2011/05/diameter-message-structure-and-message.html @@ -115,7 +115,7 @@ public: * In general, diameter nodes will sequence the End-To-End value when sending new requests. * A 'false' value stands for intermediate agents (must keep end-to-end during 4 minutes even upon reboots). */ - bool endToEndSequenced() const throw() { return a_endToEndSequenced; } + bool endToEndSequenced() const { return a_endToEndSequenced; } /** * By default, the diameter::comm message will sequence the end-to-end increasing the initial value created @@ -123,7 +123,7 @@ public: * * @see sequenceEndToEnd */ - void forwardEndToEnd() throw() { a_endToEndSequenced = false; } + void forwardEndToEnd() { a_endToEndSequenced = false; } /** * By default, the diameter::comm message will sequence the end-to-end increasing the initial value created @@ -131,29 +131,29 @@ public: * * @see forwardEndToEnd */ - void sequenceEndToEnd() throw() { a_endToEndSequenced = true; } + void sequenceEndToEnd() { a_endToEndSequenced = true; } // Statistics - void updateRequestTimestampMs(void) throw() { a_request_timestamp_ms = anna::functions::millisecond(); } - const anna::Millisecond & getRequestTimestampMs() const throw() { return (a_request_timestamp_ms); } + void updateRequestTimestampMs(void) { a_request_timestamp_ms = anna::functions::millisecond(); } + const anna::Millisecond & getRequestTimestampMs() const { return (a_request_timestamp_ms); } - int getRetries() const throw() { return a_retries; } - void setRetries(int value) throw() { a_retries = value; } + int getRetries() const { return a_retries; } + void setRetries(int value) { a_retries = value; } - int getRequestServerSessionKey() const throw() { return a_requestServerSessionKey; } + int getRequestServerSessionKey() const { return a_requestServerSessionKey; } /** Application specific socket id to keep origin track for request which came from a specific client, at asyncronous contexts (process with both diameter interfaces: client & entities) */ - void setRequestServerSessionKey(int value) throw() { a_requestServerSessionKey = value; } + void setRequestServerSessionKey(int value) { a_requestServerSessionKey = value; } - const std::string & getRequestClientSessionKey() const throw() { return a_requestClientSessionKey; } + const std::string & getRequestClientSessionKey() const { return a_requestClientSessionKey; } /** Application specific socket id to keep origin track for request which came from a specific server (entity), at asyncronous contexts (process with both diameter interfaces: client & entities) */ - void setRequestClientSessionKey(const std::string & value) throw() { a_requestClientSessionKey = value; } + void setRequestClientSessionKey(const std::string & value) { a_requestClientSessionKey = value; } /** Initializes class information */ - void initialize() throw() { + void initialize() { a_retries = 1; a_requestServerSessionKey = -1; // means unknown/unset a_requestClientSessionKey = ""; // means unknown/unset @@ -185,11 +185,11 @@ private: EndToEnd a_requestEndToEnd; // application backup for end-to-end in order to restore on answer receive bool a_endToEndSequenced; // end-to-end will be sequenced by default (true) - void send(ClientSession&) const throw(anna::RuntimeException); - void send(ServerSession&) const throw(anna::RuntimeException); - void restoreSequencesAfterFix() throw(); + void send(ClientSession&) const noexcept(false); + void send(ServerSession&) const noexcept(false); + void restoreSequencesAfterFix() ; - static const char* asText(const OnExpiry::_v) throw(); + static const char* asText(const OnExpiry::_v) ; friend class Session; friend class ClientSession; diff --git a/include/anna/diameter.comm/MessageStatistics.hpp b/include/anna/diameter.comm/MessageStatistics.hpp index 9c502e2..e6fa37c 100644 --- a/include/anna/diameter.comm/MessageStatistics.hpp +++ b/include/anna/diameter.comm/MessageStatistics.hpp @@ -38,9 +38,9 @@ class MessageStatistics { struct ConceptType { enum _v { SentRequestProcessingTime, ReceivedMessageSize }; }; - void initialize(const std::string &name) throw(anna::RuntimeException); - void process(const ConceptType::_v &conceptType, const anna::diameter::CommandId &cid, const double & value) throw(anna::RuntimeException); - anna::statistics::Accumulator *getAccumulator() const throw() { return a_accumulator; } + void initialize(const std::string &name) noexcept(false); + void process(const ConceptType::_v &conceptType, const anna::diameter::CommandId &cid, const double & value) noexcept(false); + anna::statistics::Accumulator *getAccumulator() const { return a_accumulator; } private: anna::statistics::Accumulator *a_accumulator; diff --git a/include/anna/diameter.comm/OamModule.hpp b/include/anna/diameter.comm/OamModule.hpp index 7567eff..3c43aa5 100644 --- a/include/anna/diameter.comm/OamModule.hpp +++ b/include/anna/diameter.comm/OamModule.hpp @@ -175,8 +175,8 @@ public: anna_declare_enum(Counter); }; - /* virtual */std::string getDefaultInternalAlarmDescription(const int & alarmType) const throw() { return Alarm::asCString((Alarm::_v)alarmType); } - /* virtual */std::string getDefaultInternalCounterDescription(const int & counterType) const throw() { return Counter::asCString((Counter::_v)counterType); } + /* virtual */std::string getDefaultInternalAlarmDescription(const int & alarmType) const { return Alarm::asCString((Alarm::_v)alarmType); } + /* virtual */std::string getDefaultInternalCounterDescription(const int & counterType) const { return Counter::asCString((Counter::_v)counterType); } private: diff --git a/include/anna/diameter.comm/OriginHost.hpp b/include/anna/diameter.comm/OriginHost.hpp index 1cc7bc9..55f729d 100644 --- a/include/anna/diameter.comm/OriginHost.hpp +++ b/include/anna/diameter.comm/OriginHost.hpp @@ -70,26 +70,26 @@ public: ~OriginHost() {;} // OriginHost name: - const std::string &getName() const throw(); + const std::string &getName() const ; // Core resources: - anna::diameter::comm::Engine* getCommEngine() const throw() { return a_commEngine; } - unsigned int getApplicationId() const throw() { return a_applicationId; } - anna::diameter::codec::Engine *getCodecEngine() const throw() { return a_codecEngine; } + anna::diameter::comm::Engine* getCommEngine() const { return a_commEngine; } + unsigned int getApplicationId() const { return a_applicationId; } + anna::diameter::codec::Engine *getCodecEngine() const { return a_codecEngine; } - void createEntity(const std::string &entityRepresentation, const anna::Millisecond &bindTimeout, const anna::Millisecond &applicationTimeout) throw(anna::RuntimeException); - anna::diameter::comm::Entity *getEntity() const throw() { return a_entity; } + void createEntity(const std::string &entityRepresentation, const anna::Millisecond &bindTimeout, const anna::Millisecond &applicationTimeout) noexcept(false); + anna::diameter::comm::Entity *getEntity() const { return a_entity; } - void createDiameterServer(const std::string &serverRepresentation, int sessions, const anna::Millisecond &inactivityTimeout, const anna::Millisecond &applicationTimeout, const std::string &ceaPathfile) throw(anna::RuntimeException); - anna::diameter::comm::LocalServer* getDiameterServer() throw() { return a_diameterServer; } - void setRequestRetransmissions(int r) throw() { if (r >= 0) a_requestRetransmissions = r; } + void createDiameterServer(const std::string &serverRepresentation, int sessions, const anna::Millisecond &inactivityTimeout, const anna::Millisecond &applicationTimeout, const std::string &ceaPathfile) noexcept(false); + anna::diameter::comm::LocalServer* getDiameterServer() { return a_diameterServer; } + void setRequestRetransmissions(int r) { if (r >= 0) a_requestRetransmissions = r; } // Messages factory: - anna::diameter::comm::Message *createCommMessage() throw(anna::RuntimeException); - void releaseCommMessage(anna::diameter::comm::Message*) throw(); + anna::diameter::comm::Message *createCommMessage() noexcept(false); + void releaseCommMessage(anna::diameter::comm::Message*) ; // Traffic logs & burst: - void setLogs(const std::string &log, bool splitLog, bool detailedLog, bool dumpLog, const std::string &burstLog) throw() { + void setLogs(const std::string &log, bool splitLog, bool detailedLog, bool dumpLog, const std::string &burstLog) { a_logFile = log; a_splitLog = splitLog; a_detailedLog = detailedLog; @@ -97,26 +97,26 @@ public: a_burstLogFile = burstLog; } - bool logEnabled() const throw() { return (((a_logFile == "") || (a_logFile == "null")) ? false : true); } - void writeLogFile(const anna::DataBlock & db, const std::string &logExtension, const std::string &detail) const throw(); - void writeLogFile(const anna::diameter::codec::Message & decodedMessage, const std::string &logExtension, const std::string &detail) const throw(); - void writeBurstLogFile(const std::string &buffer) throw(); - bool burstLogEnabled() const throw() { return (((a_burstLogFile == "") || (a_burstLogFile == "null")) ? false : true); } - int clearBurst() throw(); // returns removed - int loadBurstMessage(const anna::DataBlock & db) throw(anna::RuntimeException); - void repeatBurst(bool repeat) throw() { a_burstRepeat = repeat; } - int startBurst(int initialLoad) throw(); // return processed on start, or -1 if burst list is empty, -2 if invalid initial load (0 or negative) - int pushBurst(int loadAmount) throw(); // returns pushed (perhaps is less than provided because of no repeat mode and burst list exhausted), or -1 if burst list is empty, -2 if invalid load (0 or negative) - int sendBurst(int loadAmount) throw(); // returns sent (burst always cycled using send), returns -1 if burst list is empty, -2 if invalid load (0 or negative) - int popBurst(int releaseAmount) throw(); // returns popped (perhaps is less than provided because of OTA request), or -1 if burst stopped - int stopBurst() throw(); // returns remaining on cycle, or -1 if burst already stopped - bool burstActive() const throw() { return a_burstActive; } - bool sendBurstMessage(bool anyway = false) throw(); - std::string lookBurst(int order = -1) const throw(); - std::string gotoBurst(int order) throw(); - - anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); - std::string asXMLString() const throw(); + bool logEnabled() const { return (((a_logFile == "") || (a_logFile == "null")) ? false : true); } + void writeLogFile(const anna::DataBlock & db, const std::string &logExtension, const std::string &detail) const ; + void writeLogFile(const anna::diameter::codec::Message & decodedMessage, const std::string &logExtension, const std::string &detail) const ; + void writeBurstLogFile(const std::string &buffer) ; + bool burstLogEnabled() const { return (((a_burstLogFile == "") || (a_burstLogFile == "null")) ? false : true); } + int clearBurst() ; // returns removed + int loadBurstMessage(const anna::DataBlock & db) noexcept(false); + void repeatBurst(bool repeat) { a_burstRepeat = repeat; } + int startBurst(int initialLoad) ; // return processed on start, or -1 if burst list is empty, -2 if invalid initial load (0 or negative) + int pushBurst(int loadAmount) ; // returns pushed (perhaps is less than provided because of no repeat mode and burst list exhausted), or -1 if burst list is empty, -2 if invalid load (0 or negative) + int sendBurst(int loadAmount) ; // returns sent (burst always cycled using send), returns -1 if burst list is empty, -2 if invalid load (0 or negative) + int popBurst(int releaseAmount) ; // returns popped (perhaps is less than provided because of OTA request), or -1 if burst stopped + int stopBurst() ; // returns remaining on cycle, or -1 if burst already stopped + bool burstActive() const { return a_burstActive; } + bool sendBurstMessage(bool anyway = false) ; + std::string lookBurst(int order = -1) const ; + std::string gotoBurst(int order) ; + + anna::xml::Node* asXML(anna::xml::Node* parent) const ; + std::string asXMLString() const ; }; } diff --git a/include/anna/diameter.comm/OriginHostManager.hpp b/include/anna/diameter.comm/OriginHostManager.hpp index af5793b..82c0979 100644 --- a/include/anna/diameter.comm/OriginHostManager.hpp +++ b/include/anna/diameter.comm/OriginHostManager.hpp @@ -56,17 +56,17 @@ public: /** * First element iterator */ - origin_hosts_it begin() const throw() { return a_origin_hosts.begin(); } + origin_hosts_it begin() const { return a_origin_hosts.begin(); } /** * Last element iterator */ - origin_hosts_it end() const throw() { return a_origin_hosts.end(); } + origin_hosts_it end() const { return a_origin_hosts.end(); } /** * Number of registered origin hosts */ - int size() const throw() { return a_origin_hosts.size(); } + int size() const { return a_origin_hosts.size(); } /** * Registers a new origin host node (externally allocated) associated to a name. @@ -75,7 +75,7 @@ public: * @param name Origin Host Name * @param originHost Associated Origin Host node */ - void registerOriginHost(const std::string &name, OriginHost* originHost) throw(); + void registerOriginHost(const std::string &name, OriginHost* originHost) ; /** * Get the associated origin host node for a provided name. @@ -84,14 +84,14 @@ public: * * @return Found origin host node, NULL if not found */ - OriginHost *getOriginHost(const std::string &name) const throw(); + OriginHost *getOriginHost(const std::string &name) const ; /** Class XML representation. \param parent XML node over which we will put instance information. \return XML with class content. */ - virtual anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); + virtual anna::xml::Node* asXML(anna::xml::Node* parent) const ; friend class anna::Singleton ; diff --git a/include/anna/diameter.comm/ReceiverFactoryImpl.hpp b/include/anna/diameter.comm/ReceiverFactoryImpl.hpp index 2f943b8..85eec49 100644 --- a/include/anna/diameter.comm/ReceiverFactoryImpl.hpp +++ b/include/anna/diameter.comm/ReceiverFactoryImpl.hpp @@ -30,7 +30,7 @@ class R; a #className method returning class name as: \code - static const char* className () throw (); + static const char* className () ; \encode */ template class ReceiverFactoryImpl : public anna::comm::ReceiverFactory { @@ -44,13 +44,13 @@ private: R *a_reference; anna::Recycler a_receivers; - anna::comm::Receiver* do_create() throw() { + anna::comm::Receiver* do_create() { T *result = a_receivers.create(); result->setReference(a_reference); return result; } - void do_release(anna::comm::Receiver* receiver) throw() { a_receivers.release(static_cast (receiver)); } + void do_release(anna::comm::Receiver* receiver) { a_receivers.release(static_cast (receiver)); } }; } diff --git a/include/anna/diameter.comm/Response.hpp b/include/anna/diameter.comm/Response.hpp index 25d42c6..a599e9e 100644 --- a/include/anna/diameter.comm/Response.hpp +++ b/include/anna/diameter.comm/Response.hpp @@ -57,7 +57,7 @@ public: Devuelve el tipo de la clase de esta respuesta. \return El tipo de la clase de esta respuesta. */ - const ClassCode::_v & getClassCode() const throw() { return a_classCode; } + const ClassCode::_v & getClassCode() const { return a_classCode; } /** Devuelve la identificacion del mensaje diameter. @@ -65,52 +65,52 @@ public: \return Identificacion del mensaje asociado a esta peticion/respuesta. \see diameter::comm::Session::send */ - HopByHop getHopByHop() const throw() { return a_hopByHop; } + HopByHop getHopByHop() const { return a_hopByHop; } /** Devuelve la sesion que genera esta respuesta. \return La instancia de la sesion que genera esta respuesta. */ - const Session* getSession() const throw() { return a_session; } + const Session* getSession() const { return a_session; } /** Devuelve la sesion que origino la creacion de esta respuesta. \return La sesion que origino la creacion de esta respuesta. */ - Session* getSession() throw() { return a_session; } + Session* getSession() { return a_session; } /** Devuelve el resultado de la peticion diameter solicitada. \return El resultado de la peticion diameter solicitada. */ - const ResultCode::_v & getResultCode() const throw() { return a_resultCode; } + const ResultCode::_v & getResultCode() const { return a_resultCode; } /** Returns original request for the response received from the network. \see diameter::comm::Session::send */ - const Message* getRequest() const throw() { return a_request; } + const Message* getRequest() const { return a_request; } /** Returns message received from the network. \see diameter::comm::Session::send */ - const anna::DataBlock *getMessage() const throw() { return a_message; } + const anna::DataBlock *getMessage() const { return a_message; } // helpers // /** // Reponse regarding diameter keepalive // */ -// bool isKeepAlive() const throw(); +// bool isKeepAlive() const ; /** Devuelve una cadena con la informacion relevante sobre esta instancia. \return Una cadena con la informacion relevante sobre esta instancia. */ - std::string asString() const throw(); + std::string asString() const ; private: ClassCode::_v a_classCode; @@ -126,19 +126,19 @@ private: Response(); - static Response* instance(const ClassCode::_v &, const HopByHop) throw(anna::RuntimeException); - static void release(Response* response) throw(); + static Response* instance(const ClassCode::_v &, const HopByHop) noexcept(false); + static void release(Response* response) ; - void clear() throw(); + void clear() ; - void setSession(Session* session) throw() { a_session = session; } - void setRequest(const Message* request) throw() { a_request = request; } - void setMessage(const anna::DataBlock *message) throw() { a_message = message; } - void activateTimer() throw(anna::RuntimeException); - void cancelTimer() throw(); - void setResultCode(const ResultCode::_v & resultCode) throw() { a_resultCode = resultCode; } + void setSession(Session* session) { a_session = session; } + void setRequest(const Message* request) { a_request = request; } + void setMessage(const anna::DataBlock *message) { a_message = message; } + void activateTimer() noexcept(false); + void cancelTimer() ; + void setResultCode(const ResultCode::_v & resultCode) { a_resultCode = resultCode; } - static const char* asText(const ResultCode::_v) throw(); + static const char* asText(const ResultCode::_v) ; friend class Session; friend class ClientSession; diff --git a/include/anna/diameter.comm/Server.hpp b/include/anna/diameter.comm/Server.hpp index 8d5dea9..711fdcd 100644 --- a/include/anna/diameter.comm/Server.hpp +++ b/include/anna/diameter.comm/Server.hpp @@ -67,28 +67,28 @@ class Server { // Activity anna::Millisecond a_lastIncomingActivityTime; // last unix timestamp (in milliseconds) when message reception was managed over this server anna::Millisecond a_lastOutgoingActivityTime; // last unix timestamp (in milliseconds) when message sending was managed over this server - void updateIncomingActivityTime() throw(); - void updateOutgoingActivityTime() throw(); + void updateIncomingActivityTime() ; + void updateOutgoingActivityTime() ; // Engine Engine *a_engine; // Statistics MessageStatistics a_messageStatistics; - void initializeStatisticResources() throw(); - void resetStatistics() throw(); + void initializeStatisticResources() ; + void resetStatistics() ; // Availability bool a_available; // any of the client-sessions must be bound - void availabilityLost() throw(); - void availabilityRecovered() throw(); - bool refreshAvailability() throw(); // return true if change - void assertReady() throw(anna::RuntimeException); - void initialize() throw(); - void childIdle() const throw(); + void availabilityLost() ; + void availabilityRecovered() ; + bool refreshAvailability() ; // return true if change + void assertReady() noexcept(false); + void initialize() ; + void childIdle() const ; // Private close/destroy method - void close(bool destroy) throw(anna::RuntimeException); + void close(bool destroy) noexcept(false); public: @@ -110,7 +110,7 @@ public: * * \param socketId Diameter socket identifier within the server. */ - void addClientSession(int socketId) throw(anna::RuntimeException); + void addClientSession(int socketId) noexcept(false); /** Set timeout to consider failed a request. @@ -119,34 +119,34 @@ public: Timers are internally managed and automatically activated. */ - void setClassCodeTimeout(const ClassCode::_v v, const anna::Millisecond & millisecond) throw(); + void setClassCodeTimeout(const ClassCode::_v v, const anna::Millisecond & millisecond) ; /** * Binds server client-sessions. * * @return Returns true if all client-session were successfully bound */ - bool bind() throw(anna::RuntimeException); + bool bind() noexcept(false); /** * Propagate auto recovery configuration to client-sessions within server * * @param autoRecovery Auto recovery indicator. True by default. */ - void raiseAutoRecovery(bool autoRecovery = true) throw(anna::RuntimeException); + void raiseAutoRecovery(bool autoRecovery = true) noexcept(false); // Sent a message to the server using a certain client-session by mean round-robin between socketId's for // multiple client client-sessions functionality. If a specific socketId is provided, then uses such specific client-session. // Last used delivery resource could be known through #getLastUsedResource(). - bool send(const Message*, int socketId = -1 /* client-sessions round-robin */) throw(anna::RuntimeException); - bool send(const Message& message, int socketId = -1 /* client-sessions round-robin */) throw(anna::RuntimeException) { return send(&message, socketId); } + bool send(const Message*, int socketId = -1 /* client-sessions round-robin */) noexcept(false); + bool send(const Message& message, int socketId = -1 /* client-sessions round-robin */) noexcept(false) { return send(&message, socketId); } /** Gets the last used resource (client session) during sending. Broadcast doesn't updates this information. */ - ClientSession *getLastUsedResource() const throw() { return (a_lastUsedResource); } + ClientSession *getLastUsedResource() const { return (a_lastUsedResource); } /** Sent a message to all the server client-sessions (socketId's) for multiple client client-sessions functionality. @@ -154,53 +154,53 @@ public: Returns true (success) only when broadcast is success over all the server client-sessions. If any client-session fails, then false is returned. Broadcast try to send all over the resources in spite of any fail. */ - bool broadcast(const Message*) throw(anna::RuntimeException); - bool broadcast(const Message& message) throw(anna::RuntimeException) { return broadcast(&message); } + bool broadcast(const Message*) noexcept(false); + bool broadcast(const Message& message) noexcept(false) { return broadcast(&message); } /** Close all the server client-sessions. Depending on client-session configuration ('OnDisconnect' behaviour), pending answers will be wait (graceful) or ignored (immediate-abrupt close). Resources are not destroyed. */ - void close() throw(anna::RuntimeException) { close(false /* no destroy */); } + void close() noexcept(false) { close(false /* no destroy */); } /** Diameter parent entity. \return Diameter parent entity. */ - const Entity *getParent() const throw() { return a_parent; } + const Entity *getParent() const { return a_parent; } /** Returns true when any of the server client-sessions is Bound. False when all not-bound. */ - bool isAvailable() const throw() { return a_available; } + bool isAvailable() const { return a_available; } - std::vector::iterator begin() throw() { return a_clientSessions.begin(); } - std::vector::iterator end() throw() { return a_clientSessions.end(); } - std::vector::const_iterator begin() const throw() { return a_clientSessions.begin(); } - std::vector::const_iterator end() const throw() { return a_clientSessions.end(); } + std::vector::iterator begin() { return a_clientSessions.begin(); } + std::vector::iterator end() { return a_clientSessions.end(); } + std::vector::const_iterator begin() const { return a_clientSessions.begin(); } + std::vector::const_iterator end() const { return a_clientSessions.end(); } - int getNumberOfClientSessions() const throw() { return a_clientSessions.size(); } - int getMaxClientSessions() const throw() { return a_maxClientSessions; } - void setMaxClientSessions(int maxClientSessions) throw() { a_maxClientSessions = maxClientSessions; } + int getNumberOfClientSessions() const { return a_clientSessions.size(); } + int getMaxClientSessions() const { return a_maxClientSessions; } + void setMaxClientSessions(int maxClientSessions) { a_maxClientSessions = maxClientSessions; } /** Diameter server address (IP or hostname) \return Diameter server address. */ - const std::string& getAddress() const throw() { return a_socket.first; } + const std::string& getAddress() const { return a_socket.first; } /** Diameter server port. \return Diameter server port. */ - int getPort() const throw() { return a_socket.second; } + int getPort() const { return a_socket.second; } /** Server presentation as 'ADDRESS:PORT' */ - std::string socketAsString() const throw(); + std::string socketAsString() const ; /** @@ -208,14 +208,14 @@ public: @return Last incoming activity timestamp. */ - const anna::Millisecond & getLastIncomingActivityTime() const throw() { return a_lastIncomingActivityTime; } + const anna::Millisecond & getLastIncomingActivityTime() const { return a_lastIncomingActivityTime; } /** Gets the timestamp for last outgoing activity over the server. @return Last outgoing activity timestamp. */ - const anna::Millisecond & getLastOutgoingActivityTime() const throw() { return a_lastOutgoingActivityTime; } + const anna::Millisecond & getLastOutgoingActivityTime() const { return a_lastOutgoingActivityTime; } /** @@ -223,58 +223,58 @@ public: @return OTA messages. */ - int getOTARequests() const throw(); + int getOTARequests() const ; /** Returns idle state (no pending answers). @return Idle state. */ - bool idle() const throw() { return (getOTARequests() == 0); } + bool idle() const { return (getOTARequests() == 0); } /** Deny resources for delivery restriction. Deny all its client sessions */ - void hide() throw(); + void hide() ; /** Allow resource for delivery permission. Allow all its client sessions */ - void show() throw(); + void show() ; /** Returns true when all its client session resources are hidden for application messages delivery */ - bool hidden() const throw(); + bool hidden() const ; /** Returns true when all its client session resources are shown for application messages delivery */ - bool shown() const throw(); + bool shown() const ; /** Class string representation \return String with relevant information for this instance. */ - std::string asString() const throw(); + std::string asString() const ; /** Class xml representation \param parent Parent XML node on which hold this instance information. \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 ; // Statistics - void updateProcessingTimeStatisticConcept(const double &value, const anna::diameter::CommandId &cid) throw(); - void updateReceivedMessageSizeStatisticConcept(const double &value, const anna::diameter::CommandId &cid) throw(); -// int getProcessingTimeStatisticConcept() const throw() { return a_processing_time__StatisticConceptId; } -// int getReceivedMessageSizeStatisticConcept() const throw() { return a_received_message_size__StatisticConceptId; } + void updateProcessingTimeStatisticConcept(const double &value, const anna::diameter::CommandId &cid) ; + void updateReceivedMessageSizeStatisticConcept(const double &value, const anna::diameter::CommandId &cid) ; +// int getProcessingTimeStatisticConcept() const { return a_processing_time__StatisticConceptId; } +// int getReceivedMessageSizeStatisticConcept() const { return a_received_message_size__StatisticConceptId; } protected: @@ -283,21 +283,21 @@ protected: When notified, ANNA.diameter.comm generates an diameter::comm::Entity::eventResponse for every request with pending answers. */ - virtual void eventPeerShutdown(const ClientSession*) throw(); + virtual void eventPeerShutdown(const ClientSession*) ; /** Handler about a request retransmission over the session. \param request Message retransmitted */ - virtual void eventRequestRetransmission(const ClientSession*, Message *request) throw(); + virtual void eventRequestRetransmission(const ClientSession*, Message *request) ; /** Handler for diameter server (client-session) responses \param response Answer container object for corresponding diameter request */ - virtual void eventResponse(const Response & response) throw(anna::RuntimeException); + virtual void eventResponse(const Response & response) noexcept(false); /** Handler for diameter server (client-session) requests @@ -305,8 +305,8 @@ protected: \param clientSession ClientSession from which request has been received \param request Diameter request message received */ - virtual void eventRequest(ClientSession *clientSession, const anna::DataBlock &request) throw(anna::RuntimeException); - //virtual void eventRequest(ClientSession *clientSession, const Message & request) throw(anna::RuntimeException); + virtual void eventRequest(ClientSession *clientSession, const anna::DataBlock &request) noexcept(false); + //virtual void eventRequest(ClientSession *clientSession, const Message & request) noexcept(false); /** Handler for diameter server (client-session) responses out of context @@ -314,7 +314,7 @@ protected: \param clientSession ClientSession from which request has been received \param response Answer data block object without context match */ - virtual void eventUnknownResponse(ClientSession *clientSession, const anna::DataBlock& response) throw(anna::RuntimeException); + virtual void eventUnknownResponse(ClientSession *clientSession, const anna::DataBlock& response) noexcept(false); /** Handler for diameter server (client-session) Disconnect-Peer-Answer messages @@ -322,7 +322,7 @@ protected: \param clientSession ClientSession from which request has been received \param response Answer data block object without context match */ - virtual void eventDPA(ClientSession *clientSession, const anna::DataBlock& response) throw(anna::RuntimeException); + virtual void eventDPA(ClientSession *clientSession, const anna::DataBlock& response) noexcept(false); diff --git a/include/anna/diameter.comm/ServerSession.hpp b/include/anna/diameter.comm/ServerSession.hpp index 5b30204..937cbf9 100644 --- a/include/anna/diameter.comm/ServerSession.hpp +++ b/include/anna/diameter.comm/ServerSession.hpp @@ -54,7 +54,7 @@ public: ServerSession(); - /* virtual */void initialize() throw(); + /* virtual */void initialize() ; /** * Default max inactivity period for the diameter server-session health. @@ -66,48 +66,48 @@ public: @param allowedInactivityTime Inactivity time allowed */ - void setAllowedInactivityTime(const anna::Millisecond & allowedInactivityTime) throw(); + void setAllowedInactivityTime(const anna::Millisecond & allowedInactivityTime) ; /** Diameter listening address (ip or hostname). \return Diameter listening address. */ - /* virtual */const std::string& getAddress() const throw(); + /* virtual */const std::string& getAddress() const ; /** Diameter listen port. \return Diameter listen port. */ - /* virtual */int getPort() const throw(); + /* virtual */int getPort() const ; /** Server session key. Same as socket id */ - int getKey() const throw() { return getSocketId(); } + int getKey() const { return getSocketId(); } /** Local server parent \return Local server parent */ - LocalServer *getParent() throw() { return a_parent; } + LocalServer *getParent() { return a_parent; } /** Sets the diameter client socket and assign the receiver factory to it \param clientSocket Diameter client socket */ - void setClientSocket(anna::comm::ClientSocket *clientSocket) throw(); + void setClientSocket(anna::comm::ClientSocket *clientSocket) ; /** Diameter client socket \return Diameter client socket */ - anna::comm::ClientSocket *getClientSocket() throw() { return a_clientSocket; } + anna::comm::ClientSocket *getClientSocket() { return a_clientSocket; } // /** // Sets deprecated state to this server session // */ -// void setDeprecated(bool deprecated = true) throw() { a_deprecated = deprecated; } +// void setDeprecated(bool deprecated = true) { a_deprecated = deprecated; } // /** // * Sets CEA and DWA diameter messages to be used over created server-sessions @@ -115,17 +115,17 @@ public: // * @param cea Capabilities-Exchange-Answer message (encoded) for the server-sessions bind. // * @param dwa Device-Watchdog-Answer message (encoded) for the server-sessions keep-alive. // */ -// void setCEAandDWA(const anna::DataBlock & cea, const anna::DataBlock & dwa) throw(anna::RuntimeException); +// void setCEAandDWA(const anna::DataBlock & cea, const anna::DataBlock & dwa) noexcept(false); - /* virtual */const Response* send(const Message* message) throw(anna::RuntimeException); - /* virtual */bool unbind(bool forceDisconnect /* se usa en timer, para el actionTimer del tipo SessionUnbind, etc. */ = false) throw(anna::RuntimeException); // returns true if done at call time (no pendings or ignore pendings, except Disconnecting state by mean DPR/DPA) + /* virtual */const Response* send(const Message* message) noexcept(false); + /* virtual */bool unbind(bool forceDisconnect /* se usa en timer, para el actionTimer del tipo SessionUnbind, etc. */ = false) noexcept(false); // returns true if done at call time (no pendings or ignore pendings, except Disconnecting state by mean DPR/DPA) /** Class string representation \return String with relevant information for this instance. */ - /* virtual */std::string asString() const throw(); + /* virtual */std::string asString() const ; /** @@ -133,7 +133,7 @@ public: \param parent Parent XML node on which hold this instance information. \return XML document with relevant information for this instance. */ - /* virtual */anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); + /* virtual */anna::xml::Node* asXML(anna::xml::Node* parent) const ; protected: @@ -154,12 +154,12 @@ private: // Auxiliary messages: Message a_cer, a_dwr; - /* virtual */void expire(anna::timex::Engine *timeController) throw(anna::RuntimeException); + /* virtual */void expire(anna::timex::Engine *timeController) noexcept(false); // Activity: - /* virtual */void updateIncomingActivityTime() throw(); - /* virtual */void updateOutgoingActivityTime() throw(); - void countSendings(const diameter::CommandId & cid, unsigned int aid, bool ok) throw(); + /* virtual */void updateIncomingActivityTime() ; + /* virtual */void updateOutgoingActivityTime() ; + void countSendings(const diameter::CommandId & cid, unsigned int aid, bool ok) ; // Handlers: /** @@ -167,55 +167,55 @@ private: When notified, ANNA.diameter.comm generates an diameter::comm::ServerSession::eventResponse for every request with pending answers. */ - void eventPeerShutdown() throw(); + void eventPeerShutdown() ; /** Handler about a request retransmission over the session. \param request Message retransmitted */ - void eventRequestRetransmission(Message *request) throw(); + void eventRequestRetransmission(Message *request) ; /** Handler for diameter client responses \param response Answer container object for corresponding diameter request */ - void eventResponse(const Response& response) throw(anna::RuntimeException); + void eventResponse(const Response& response) noexcept(false); /** Handler for diameter client requests \param request Request data block object for corresponding diameter reception */ - void eventRequest(const anna::DataBlock& request) throw(anna::RuntimeException); - //void eventRequest(const Message& request) throw(anna::RuntimeException); + void eventRequest(const anna::DataBlock& request) noexcept(false); + //void eventRequest(const Message& request) noexcept(false); /** Handler for diameter client responses out of context \param response Answer data block object without context match */ - void eventUnknownResponse(const anna::DataBlock& response) throw(anna::RuntimeException); + void eventUnknownResponse(const anna::DataBlock& response) noexcept(false); /** Handler for diameter client Disconnect-Peer-Answer messages \param response Answer data block object without context match */ - void eventDPA(const anna::DataBlock& response) throw(anna::RuntimeException); + void eventDPA(const anna::DataBlock& response) noexcept(false); /** * Handlers for receptions */ - /* virtual */void receive(const anna::comm::Message& message) throw(anna::RuntimeException); - /* virtual */void finalize() throw(); + /* virtual */void receive(const anna::comm::Message& message) noexcept(false); + /* virtual */void finalize() ; - /* virtual */void expireResponse(Response*) throw(); - void sendCEA() throw(anna::RuntimeException); - void sendDWA() throw(anna::RuntimeException); + /* virtual */void expireResponse(Response*) ; + void sendCEA() noexcept(false); + void sendDWA() noexcept(false); friend class anna::diameter::comm::Timer; diff --git a/include/anna/diameter.comm/ServerSessionReceiver.hpp b/include/anna/diameter.comm/ServerSessionReceiver.hpp index c3152c2..03397b3 100644 --- a/include/anna/diameter.comm/ServerSessionReceiver.hpp +++ b/include/anna/diameter.comm/ServerSessionReceiver.hpp @@ -36,17 +36,17 @@ class ServerSessionReceiver : public anna::comm::Receiver { public: virtual ~ServerSessionReceiver() {;} - static const char* className() throw() { return "diameter.comm.ServerSessionReceiver"; } - void setReference(ServerSession *s) throw() { a_session = s; } + static const char* className() { return "diameter.comm.ServerSessionReceiver"; } + void setReference(ServerSession *s) { a_session = s; } // base class virtuals - void eventBreakLocalConnection(const anna::comm::ClientSocket&cli) throw(); - //void eventCreateConnection(const anna::comm::Server*srv) throw(); + void eventBreakLocalConnection(const anna::comm::ClientSocket&cli) ; + //void eventCreateConnection(const anna::comm::Server*srv) ; private: ServerSessionReceiver() : anna::comm::Receiver("diameter.comm.ServerSessionReceiver") { a_session = NULL; } - void initialize() throw(anna::RuntimeException) {;} - void apply(anna::comm::ClientSocket&, const anna::comm::Message&) throw(anna::RuntimeException); + void initialize() noexcept(false) {;} + void apply(anna::comm::ClientSocket&, const anna::comm::Message&) noexcept(false); anna::diameter::comm::ServerSession *a_session; diff --git a/include/anna/diameter.comm/ServerSocket.hpp b/include/anna/diameter.comm/ServerSocket.hpp index 206d96e..4035b52 100644 --- a/include/anna/diameter.comm/ServerSocket.hpp +++ b/include/anna/diameter.comm/ServerSocket.hpp @@ -45,7 +45,7 @@ class ServerSocket : public anna::comm::ServerSocket { LocalServer * a_localServer; - virtual bool eventAcceptConnection(const anna::comm::ClientSocket &clientSocket) throw(anna::RuntimeException); + virtual bool eventAcceptConnection(const anna::comm::ClientSocket &clientSocket) noexcept(false); public: diff --git a/include/anna/diameter.comm/Session.hpp b/include/anna/diameter.comm/Session.hpp index b23f8c0..6507229 100644 --- a/include/anna/diameter.comm/Session.hpp +++ b/include/anna/diameter.comm/Session.hpp @@ -109,7 +109,7 @@ public: Session state. \return State for this session. */ - State::_v getState() const throw() { return a_state; } + State::_v getState() const { return a_state; } /** * Defines behaviour on 'Disconnecting' state, about #unbind action (ignore/wait pending answers) @@ -120,13 +120,13 @@ public: * Sets behaviour on 'Disconnecting' state, about #unbind action (ignore/wait pending answers). * \param onDisconnect Behaviour on 'Disconnecting' state, about #unbind action (ignore/wait pending answers). */ - void setOnDisconnect(const OnDisconnect::_v onDisconnect) throw() { a_onDisconnect = onDisconnect; } + void setOnDisconnect(const OnDisconnect::_v onDisconnect) { a_onDisconnect = onDisconnect; } /** * Returns behaviour on 'Disconnecting' state, about #unbind action (ignore/wait pending answers). * \return behaviour on 'Disconnecting' state, about #unbind action (ignore/wait pending answers). */ - OnDisconnect::_v getOnDisconnect() const throw() { return a_onDisconnect; } + OnDisconnect::_v getOnDisconnect() const { return a_onDisconnect; } @@ -134,32 +134,32 @@ public: Diameter server address, ip or hostname (remote for client-session, local for server-session). \return Diameter server address (remote for client-session, local for server-session). */ - virtual const std::string& getAddress() const throw() = 0; + virtual const std::string& getAddress() const = 0; /** Diameter server listen port (remote for client-session, local for server-session). \return Diameter server listen port (remote for client-session, local for server-session). */ - virtual int getPort() const throw() = 0; + virtual int getPort() const = 0; /** Socket id. \return Socket id. */ - int getSocketId() const throw() { return a_socketId; } + int getSocketId() const { return a_socketId; } /** Returns the next hop-by-hop which will be used over the diameter session to send a message It is recommended to fix the message with this value (or store along with the message), for application context identification purposes */ - const HopByHop & getNextHopByHop() const throw() { return a_nextHopByHop; } + const HopByHop & getNextHopByHop() const { return a_nextHopByHop; } /** Returns the next end-to-end which will be used over the diameter session to send a message It is recommended to fix the message with this value (or store along with the message), for application context identification purposes */ - const EndToEnd & getNextEndToEnd() const throw() { return a_nextEndToEnd; } + const EndToEnd & getNextEndToEnd() const { return a_nextEndToEnd; } /** @@ -169,20 +169,20 @@ public: Timers are internally managed and automatically activated. */ - void setClassCodeTimeout(const ClassCode::_v v, const anna::Millisecond & millisecond) throw() { a_timeouts [v] = millisecond; } + void setClassCodeTimeout(const ClassCode::_v v, const anna::Millisecond & millisecond) { a_timeouts [v] = millisecond; } /** * Timeout configured for class code \em v requests. * \return Timeout configured for class code \em v requests. */ - anna::Millisecond getClassCodeTimeout(const ClassCode::_v v) const throw() { return a_timeouts [v]; } + anna::Millisecond getClassCodeTimeout(const ClassCode::_v v) const { return a_timeouts [v]; } /** Returns \em true when diameter server is connected (application level) \em false in other case. \return \em true when diameter server is connected (application level) \em false in other case. */ - bool isBound() const throw() { return a_state == State::Bound; } + bool isBound() const { return a_state == State::Bound; } // Envia el mensaje recibido como parametro al servidor con el que estamos conectados mediante esta @@ -196,13 +196,13 @@ public: // \param message Mensaje a enviar al servidor diameter con el que estamos conectados. // @return Diameter response reference asociated to a request. NULL if answer sent. // \warning Solo se podra hacer uso de este metodo cuando el metodo #isBound devuelva \em true. - virtual const Response* send(const Message* message) throw(anna::RuntimeException) = 0; - const Response* send(const Message& message) throw(anna::RuntimeException) { return send(&message); } + virtual const Response* send(const Message* message) noexcept(false) = 0; + const Response* send(const Message& message) noexcept(false) { return send(&message); } // Desconecta del extremo remoto // Se notifica la terminaci�n de cada una de las peticiones pendientes invocando al m�todo Session::eventResponse // \warning Despu�s de invocar a este m�todo habr�a que volver a iniciar una sesion. - virtual bool unbind(bool forceDisconnect /* se usa en timer, para el actionTimer del tipo SessionUnbind, etc. */ = false) throw(anna::RuntimeException) = 0; + virtual bool unbind(bool forceDisconnect /* se usa en timer, para el actionTimer del tipo SessionUnbind, etc. */ = false) noexcept(false) = 0; // returns true if done at call time (no pendings or ignore pendings, except Disconnecting state by mean DPR/DPA) @@ -211,21 +211,21 @@ public: @return Last incoming activity timestamp. */ - const anna::Millisecond & getLastIncomingActivityTime() const throw() { return a_lastIncomingActivityTime; } + const anna::Millisecond & getLastIncomingActivityTime() const { return a_lastIncomingActivityTime; } /** Gets the timestamp for last outgoing activity over the session. @return Last outgoing activity timestamp. */ - const anna::Millisecond & getLastOutgoingActivityTime() const throw() { return a_lastOutgoingActivityTime; } + const anna::Millisecond & getLastOutgoingActivityTime() const { return a_lastOutgoingActivityTime; } /** Gets the number of requests messages over-the-air. @return OTA messages. */ - int getOTARequests() const throw() { return a_responses.size(); } + int getOTARequests() const { return a_responses.size(); } /** @@ -233,7 +233,7 @@ public: @return Idle state. */ - bool idle() const throw() { return (getOTARequests() == 0); } + bool idle() const { return (getOTARequests() == 0); } /** @@ -247,13 +247,13 @@ public: @defer Delayed notification for orphan request due to transport failures */ - void notifyOrphansOnExpiration(bool defer = true) throw() { a_notifyOrphansOnExpiration = defer; } + void notifyOrphansOnExpiration(bool defer = true) { a_notifyOrphansOnExpiration = defer; } /** Class string representation \return String with relevant information for this instance. */ - virtual std::string asString() const throw(); + virtual std::string asString() const ; /** @@ -261,7 +261,7 @@ public: \param parent Parent XML node on which hold this instance information. \return XML document with relevant information for this instance. */ - virtual anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); + virtual anna::xml::Node* asXML(anna::xml::Node* parent) const ; protected: @@ -281,13 +281,13 @@ protected: // Sequencing HopByHop a_nextHopByHop; EndToEnd a_nextEndToEnd; - virtual void initialize() throw(); - void initializeSequences() throw(); // debe invocarse despues de haber asignado el a_parent - void generateNextSequences() throw() { a_nextHopByHop++; a_nextEndToEnd++; } + virtual void initialize() ; + void initializeSequences() ; // debe invocarse despues de haber asignado el a_parent + void generateNextSequences() { a_nextHopByHop++; a_nextEndToEnd++; } // Context Responses struct SortById { - static HopByHop value(const Response*) throw(); + static HopByHop value(const Response*) ; }; typedef anna::SortedVector response_container; typedef response_container::iterator response_iterator; @@ -295,27 +295,27 @@ protected: response_container a_responses; bool a_notifyOrphansOnExpiration; - void response_add(Response* response) throw(); - void response_erase(Response* response) throw(); - Response* response_find(const HopByHop hopByHop) throw(anna::RuntimeException); + void response_add(Response* response) ; + void response_erase(Response* response) ; + Response* response_find(const HopByHop hopByHop) noexcept(false); - response_iterator response_begin() throw() { return a_responses.begin(); } - response_iterator response_end() throw() { return a_responses.end(); } - static Response* response(response_iterator ii) throw() { return response_container::data(ii); } + response_iterator response_begin() { return a_responses.begin(); } + response_iterator response_end() { return a_responses.end(); } + static Response* response(response_iterator ii) { return response_container::data(ii); } - const_response_iterator response_begin() const throw() { return a_responses.begin(); } - const_response_iterator response_end() const throw() { return a_responses.end(); } - static const Response* response(const_response_iterator ii) throw() { return response_container::data(ii); } + const_response_iterator response_begin() const { return a_responses.begin(); } + const_response_iterator response_end() const { return a_responses.end(); } + static const Response* response(const_response_iterator ii) { return response_container::data(ii); } // Activity anna::timex::Engine* a_timeController; anna::Millisecond a_lastIncomingActivityTime; // last unix timestamp (in milliseconds) when message reception was managed over the session anna::Millisecond a_lastOutgoingActivityTime; // last unix timestamp (in milliseconds) when message sending was managed over the session - virtual void updateIncomingActivityTime() throw(); - virtual void updateOutgoingActivityTime() throw(); + virtual void updateIncomingActivityTime() ; + virtual void updateOutgoingActivityTime() ; // Self-timer expiration handler - virtual void expire(anna::timex::Engine *timeController) throw(anna::RuntimeException) {;} + virtual void expire(anna::timex::Engine *timeController) noexcept(false) {;} // Timming: anna::Millisecond a_timeouts [ClassCode::Max]; @@ -326,29 +326,29 @@ protected: When notified, ANNA.diameter.comm generates an diameter::comm::ClientSession::eventResponse for every request with pending answers. */ - virtual void eventPeerShutdown() throw() = 0; + virtual void eventPeerShutdown() = 0; /** Handler about a request retransmission over the session. \param request Message retransmitted */ - virtual void eventRequestRetransmission(Message *request) throw() = 0; + virtual void eventRequestRetransmission(Message *request) = 0; /** Handler for diameter session responses \param response Answer data block object for corresponding diameter request */ - virtual void eventResponse(const Response& response) throw(anna::RuntimeException) = 0; + virtual void eventResponse(const Response& response) noexcept(false) = 0; /** Handler for diameter session requests \param request Request container object for corresponding diameter reception */ - virtual void eventRequest(const anna::DataBlock& request) throw(anna::RuntimeException) = 0; - //void eventRequest(const Message& request) throw(anna::RuntimeException); + virtual void eventRequest(const anna::DataBlock& request) noexcept(false) = 0; + //void eventRequest(const Message& request) noexcept(false); /** @@ -356,21 +356,21 @@ protected: \param response Answer data block object without context match */ - virtual void eventUnknownResponse(const anna::DataBlock& response) throw(anna::RuntimeException) = 0; + virtual void eventUnknownResponse(const anna::DataBlock& response) noexcept(false) = 0; /** Handler for diameter session Disconnect-Peer-Answer messages \param response Answer data block object without context match */ - virtual void eventDPA(const anna::DataBlock& response) throw(anna::RuntimeException) = 0; + virtual void eventDPA(const anna::DataBlock& response) noexcept(false) = 0; /** * Handlers */ - virtual void receive(const anna::comm::Message& message) throw(anna::RuntimeException) = 0; + virtual void receive(const anna::comm::Message& message) noexcept(false) = 0; //PROTOCOL ERRORS //The errors at the protocol level are reported in response messages that contain the �E� bit and the error code in the AVP result-Code (various errors having been produced only the first one of them is reported). Examples of these errors are: //An unrecognized AVP with the �M� bit is received. @@ -385,27 +385,27 @@ protected: - virtual void finalize() throw(); // invoked from ClientSessionReceiver::eventBreakConnection() + virtual void finalize() ; // invoked from ClientSessionReceiver::eventBreakConnection() - virtual void expireResponse(Response*) throw(); - void sendDPA() throw(anna::RuntimeException); - void activateActionTimer(const anna::diameter::comm::Timer::Type::_v type) throw(); - void cancelActionTimer() throw(); - void activateTimer() throw(); // Session timer - void cancelTimer() throw(); // Session timer - virtual void timerStopped() throw() {;} - virtual void timerStarted() throw() {;} + virtual void expireResponse(Response*) ; + void sendDPA() noexcept(false); + void activateActionTimer(const anna::diameter::comm::Timer::Type::_v type) ; + void cancelActionTimer() ; + void activateTimer() ; // Session timer + void cancelTimer() ; // Session timer + virtual void timerStopped() {;} + virtual void timerStarted() {;} - virtual void setState(State::_v state) throw(); + virtual void setState(State::_v state) ; //anna::diameter::comm::Timer *getActionTimer() const { return (a_actionTimer); } // helpers - static const char* asText(const State::_v) throw(); - static const char* asText(const OnDisconnect::_v) throw(); + static const char* asText(const State::_v) ; + static const char* asText(const OnDisconnect::_v) ; friend class anna::diameter::comm::Timer; diff --git a/include/anna/diameter.comm/Timer.hpp b/include/anna/diameter.comm/Timer.hpp index c0b7b24..7857a51 100644 --- a/include/anna/diameter.comm/Timer.hpp +++ b/include/anna/diameter.comm/Timer.hpp @@ -33,18 +33,18 @@ public: struct Type { enum _v { ResponseExpiration, SessionUnbind, SessionRecover, LocalServerAttach }; }; // getters for responses - Response* getResponse() throw() { return reinterpret_cast (getContext()); } - const Response* getResponse() const throw() { return reinterpret_cast (getContext()); } + Response* getResponse() { return reinterpret_cast (getContext()); } + const Response* getResponse() const { return reinterpret_cast (getContext()); } // getters for session (client-session at the moment) - Session* getSession() throw() { return reinterpret_cast (getContext()); } - const Session* getSession() const throw() { return reinterpret_cast (getContext()); } + Session* getSession() { return reinterpret_cast (getContext()); } + const Session* getSession() const { return reinterpret_cast (getContext()); } // getters for local server - LocalServer* getLocalServer() throw() { return reinterpret_cast (getContext()); } - const LocalServer* getLocalServer() const throw() { return reinterpret_cast (getContext()); } + LocalServer* getLocalServer() { return reinterpret_cast (getContext()); } + const LocalServer* getLocalServer() const { return reinterpret_cast (getContext()); } - std::string asString() const throw(); + std::string asString() const ; private: Timer() {;} @@ -52,11 +52,11 @@ private: Type::_v a_type; - void expire(anna::timex::Engine*) throw(anna::RuntimeException); + void expire(anna::timex::Engine*) noexcept(false); - Type::_v getType() const throw() { return a_type; } - void setType(const Type::_v type) throw() { a_type = type; } - static const char* asText(const Type::_v) throw(); + Type::_v getType() const { return a_type; } + void setType(const Type::_v type) { a_type = type; } + static const char* asText(const Type::_v) ; friend class TimerManager; diff --git a/include/anna/diameter.comm/TimerManager.hpp b/include/anna/diameter.comm/TimerManager.hpp index c81af05..102c8b3 100644 --- a/include/anna/diameter.comm/TimerManager.hpp +++ b/include/anna/diameter.comm/TimerManager.hpp @@ -52,13 +52,13 @@ class TimerManager : public anna::timex::TimeEventObserver, public anna::Singlet TimerManager(const TimerManager&); virtual ~TimerManager() {;} - Timer* createTimer(Response*) throw(anna::RuntimeException); - Timer* createTimer(Session*, const anna::diameter::comm::Timer::Type::_v type) throw(anna::RuntimeException); - Timer* createTimer(LocalServer*) throw(anna::RuntimeException); + Timer* createTimer(Response*) noexcept(false); + Timer* createTimer(Session*, const anna::diameter::comm::Timer::Type::_v type) noexcept(false); + Timer* createTimer(LocalServer*) noexcept(false); - void cancelTimer(Timer*) throw(); + void cancelTimer(Timer*) ; - void release(anna::timex::TimeEvent*) throw(); + void release(anna::timex::TimeEvent*) ; friend class anna::Singleton ; friend class Response; diff --git a/include/anna/diameter.comm/Transport.hpp b/include/anna/diameter.comm/Transport.hpp index 8f6e38e..49b3329 100644 --- a/include/anna/diameter.comm/Transport.hpp +++ b/include/anna/diameter.comm/Transport.hpp @@ -53,22 +53,22 @@ public: Devuelve el gestor de capas de transporte asociado a esta clase. \return El gestor de capas de transporte asociado a esta clase. */ - static anna::comm::TransportFactory& getFactory() throw() { return st_factory; } + static anna::comm::TransportFactory& getFactory() { return st_factory; } /** Devuelve el literal que identifica de esta clase. \return el literal que identifica de esta clase. */ - static const char* className() throw() { return "diameter::comm::Transport"; } + static const char* className() { return "diameter::comm::Transport"; } private: static anna::comm::TransportFactoryImpl st_factory; Transport(); - int calculeSize(const anna::DataBlock&) throw(anna::RuntimeException); - const anna::comm::Message* decode(const anna::DataBlock&) throw(anna::RuntimeException); - const anna::DataBlock& code(anna::comm::Message&) throw(anna::RuntimeException); + int calculeSize(const anna::DataBlock&) noexcept(false); + const anna::comm::Message* decode(const anna::DataBlock&) noexcept(false); + const anna::DataBlock& code(anna::comm::Message&) noexcept(false); friend class anna::Allocator ; }; diff --git a/include/anna/diameter.comm/internal/sccs.hpp b/include/anna/diameter.comm/internal/sccs.hpp index d944d6f..6e3eb7d 100644 --- a/include/anna/diameter.comm/internal/sccs.hpp +++ b/include/anna/diameter.comm/internal/sccs.hpp @@ -17,7 +17,7 @@ namespace comm { class sccs { public: - static void activate() throw(); + static void activate() ; }; } diff --git a/include/anna/diameter/app/base/Message.hpp b/include/anna/diameter/app/base/Message.hpp index a111584..0ab5990 100644 --- a/include/anna/diameter/app/base/Message.hpp +++ b/include/anna/diameter/app/base/Message.hpp @@ -52,7 +52,7 @@ public: Avp Session-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 * getSessionId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const UTF8String * getSessionId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP(return getAvp(helpers::base::AVPID__Session_Id)->getUTF8String()); } @@ -60,7 +60,7 @@ public: Avp Destination-Host 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 DiameterIdentity * getDestinationHost(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const DiameterIdentity * getDestinationHost(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP(return getAvp(helpers::base::AVPID__Destination_Host)->getDiameterIdentity()); } @@ -68,7 +68,7 @@ public: Avp Destination-Realm 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 DiameterIdentity * getDestinationRealm(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const DiameterIdentity * getDestinationRealm(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP(return getAvp(helpers::base::AVPID__Destination_Realm)->getDiameterIdentity()); } @@ -76,7 +76,7 @@ public: Avp User-Name 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 * getUserName(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const UTF8String * getUserName(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP(return getAvp(helpers::radius::AVPID__User_Name)->getUTF8String()); } @@ -84,7 +84,7 @@ public: Avp Termination-Cause 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 * getTerminationCause(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const Enumerated * getTerminationCause(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP(return getAvp(helpers::base::AVPID__Termination_Cause)->getEnumerated()); } @@ -92,7 +92,7 @@ public: Avp Auth-Application-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 Unsigned32 * getAuthApplicationId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const Unsigned32 * getAuthApplicationId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP(return getAvp(helpers::base::AVPID__Auth_Application_Id)->getUnsigned32()); } @@ -100,7 +100,7 @@ public: Avp Event-Timestamp 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 Time * getEventTimestamp(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const Time * getEventTimestamp(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP(return getAvp(helpers::radius::AVPID__Event_Timestamp)->getTime()); } }; diff --git a/include/anna/diameter/app/dcca/Message.hpp b/include/anna/diameter/app/dcca/Message.hpp index 006e23a..4063ea9 100644 --- a/include/anna/diameter/app/dcca/Message.hpp +++ b/include/anna/diameter/app/dcca/Message.hpp @@ -54,7 +54,7 @@ typedef struct { int MaximumBitrateForDownlink; - void reset() throw() { + void reset() { qosProfile = ""; Release = TrafficClass = HandlingPriority = MaximumBitrateForUplink = MaximumBitrateForDownlink = 0; } @@ -79,7 +79,7 @@ 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; @@ -95,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)); } @@ -103,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()); } @@ -111,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()); } @@ -119,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)-> @@ -131,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()); } @@ -139,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)); } @@ -148,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); @@ -159,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()); } @@ -167,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()); } @@ -175,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()); } @@ -183,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()); } @@ -191,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()); } @@ -199,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()); } @@ -207,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()); } @@ -215,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)); } @@ -225,7 +225,7 @@ 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; @@ -240,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; /** @@ -248,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); @@ -267,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 ; // diff --git a/include/anna/diameter/app/dcca/huawei/Message.hpp b/include/anna/diameter/app/dcca/huawei/Message.hpp index 805b920..943ced4 100644 --- a/include/anna/diameter/app/dcca/huawei/Message.hpp +++ b/include/anna/diameter/app/dcca/huawei/Message.hpp @@ -51,7 +51,7 @@ public: Avp PS-Information 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 * getPSInformation(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const anna::diameter::codec::Avp * getPSInformation(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP( return getAvp(helpers::tgpp::AVPID__Service_Information)-> getAvp(helpers::tgpp::AVPID__PS_Information); @@ -62,7 +62,7 @@ public: Avp Called-Station-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 * getCalledStationId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const UTF8String * getCalledStationId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP( return getAvp(helpers::tgpp::AVPID__Service_Information)-> getAvp(helpers::tgpp::AVPID__PS_Information)-> @@ -74,7 +74,7 @@ public: Avp 3GPP-PDP-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 Unsigned32 * get3GPPPDPType(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const Unsigned32 * get3GPPPDPType(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP( return getAvp(helpers::tgpp::AVPID__Service_Information)-> getAvp(helpers::tgpp::AVPID__PS_Information)-> @@ -86,7 +86,7 @@ public: Avp 3GPP-SGSN-MCC-MNC 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 * get3GPPSGSNMCCMNC(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const UTF8String * get3GPPSGSNMCCMNC(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP( return getAvp(helpers::tgpp::AVPID__Service_Information)-> getAvp(helpers::tgpp::AVPID__PS_Information)-> @@ -98,7 +98,7 @@ public: Avp 3GPP-Charging-Characteristics 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 * get3GPPChargingCharacteristics(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const UTF8String * get3GPPChargingCharacteristics(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP( return getAvp(helpers::tgpp::AVPID__Service_Information)-> getAvp(helpers::tgpp::AVPID__PS_Information)-> @@ -110,7 +110,7 @@ public: Avp 3GPP-GPRS-Neg-QoS-Profile 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 * get3GPPGPRSNegQoSProfile(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const UTF8String * get3GPPGPRSNegQoSProfile(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP( return getAvp(helpers::tgpp::AVPID__Service_Information)-> getAvp(helpers::tgpp::AVPID__PS_Information)-> @@ -122,7 +122,7 @@ public: Avp CG-Address 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 Address * getCGAddress(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const Address * getCGAddress(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP( return getAvp(helpers::tgpp::AVPID__Service_Information)-> getAvp(helpers::tgpp::AVPID__PS_Information)-> @@ -134,7 +134,7 @@ public: Avp 3GPP-Rat-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 OctetString * get3GPPRatType(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const OctetString * get3GPPRatType(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP( return getAvp(helpers::tgpp::AVPID__Service_Information)-> getAvp(helpers::tgpp::AVPID__PS_Information)-> @@ -146,7 +146,7 @@ public: Avp SGSN-Address 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 Address * getSGSNAddress(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const Address * getSGSNAddress(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP( return getAvp(helpers::tgpp::AVPID__Service_Information)-> getAvp(helpers::tgpp::AVPID__PS_Information)-> @@ -158,7 +158,7 @@ public: Avp GGSN-Address 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 Address * getGGSNAddress(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const Address * getGGSNAddress(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP( return getAvp(helpers::tgpp::AVPID__Service_Information)-> getAvp(helpers::tgpp::AVPID__PS_Information)-> @@ -170,7 +170,7 @@ public: Avp 3GPP-Charging-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 Unsigned32 * get3GPPChargingId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const Unsigned32 * get3GPPChargingId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP( return getAvp(helpers::tgpp::AVPID__Service_Information)-> getAvp(helpers::tgpp::AVPID__PS_Information)-> @@ -182,7 +182,7 @@ public: Avp Reporting-Reason 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 * getReportingReason(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const Enumerated * getReportingReason(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::tgpp::AVPID__Reporting_Reason)->getEnumerated()); } @@ -190,7 +190,7 @@ public: Avp Trigger-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 * getTriggerType(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const Enumerated * getTriggerType(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::tgpp::AVPID__Trigger)-> @@ -202,7 +202,7 @@ public: Avp PS-Furnish-Charging-Information 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 * getPSFurnishChargingInformation(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const anna::diameter::codec::Avp * getPSFurnishChargingInformation(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::tgpp::AVPID__PS_Furnish_Charging_Information); @@ -213,7 +213,7 @@ public: Avp PS-Free-Format-Data 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 * getPSFreeFormatData(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const OctetString * getPSFreeFormatData(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::tgpp::AVPID__PS_Furnish_Charging_Information)-> @@ -225,7 +225,7 @@ public: Avp PS-Append-Free-Format-Data 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 * getPSAppendFreeFormatData(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const Enumerated * getPSAppendFreeFormatData(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::tgpp::AVPID__PS_Furnish_Charging_Information)-> @@ -238,7 +238,7 @@ public: @param ocurrence Select the n-th PDP-Address within the PS-Information. 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 Address * getPDPAddress(int ocurrence = 1, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const Address * getPDPAddress(int ocurrence = 1, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP( return getAvp(helpers::tgpp::AVPID__Service_Information)-> getAvp(helpers::tgpp::AVPID__PS_Information)-> diff --git a/include/anna/diameter/app/dcca/nokia/Message.hpp b/include/anna/diameter/app/dcca/nokia/Message.hpp index 4690ece..3be834e 100644 --- a/include/anna/diameter/app/dcca/nokia/Message.hpp +++ b/include/anna/diameter/app/dcca/nokia/Message.hpp @@ -52,7 +52,7 @@ public: Avp 3GPP-PDP-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 Unsigned32 * get3GPPPDPType(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const Unsigned32 * get3GPPPDPType(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP(return getAvp(helpers::tgpp::AVPID__3GPP_PDP_Type)->getUnsigned32()); } @@ -61,7 +61,7 @@ public: Avp Framed-IP-Address or Framed-IPv6-Prefix data-part pointer reference, depending on 3GPP-PDP-Type value @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 * getFramedIP(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const OctetString * getFramedIP(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP( int pdpType = get3GPPPDPType()->getValue(); @@ -77,7 +77,7 @@ public: Avp Called-Station-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 * getCalledStationId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const UTF8String * getCalledStationId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP(return getAvp(helpers::radius::AVPID__Called_Station_Id)->getUTF8String()); } @@ -85,7 +85,7 @@ public: Avp 3GPP-SGSN-MCC-MNC 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 * get3GPPSGSNMCCMNC(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const UTF8String * get3GPPSGSNMCCMNC(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP(return getAvp(helpers::tgpp::AVPID__3GPP_SGSN_MCC_MNC)->getUTF8String()); } @@ -93,7 +93,7 @@ public: Avp 3GPP-SGSN-Address 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 * get3GPPSGSNAddress(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const OctetString * get3GPPSGSNAddress(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP(return getAvp(helpers::tgpp::AVPID__3GPP_SGSN_Address)->getOctetString()); } @@ -101,7 +101,7 @@ public: Avp 3GPP-Charging-Characteristics 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 * get3GPPChargingCharacteristics(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const UTF8String * get3GPPChargingCharacteristics(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP(return getAvp(helpers::tgpp::AVPID__3GPP_Charging_Characteristics)->getUTF8String()); } @@ -109,7 +109,7 @@ public: Avp 3GPP-CG-Address 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 * get3GPPCGAddress(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const OctetString * get3GPPCGAddress(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP(return getAvp(helpers::tgpp::AVPID__3GPP_CG_Address)->getOctetString()); } @@ -117,7 +117,7 @@ public: Avp 3GPP-Rat-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 OctetString * get3GPPRatType(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const OctetString * get3GPPRatType(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP(return getAvp(helpers::tgpp::AVPID__3GPP_Rat_Type)->getOctetString()); } @@ -125,7 +125,7 @@ public: Avp Nokia-IMS-Media-Component-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 Unsigned32 * getNokiaIMSMediaComponentId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const Unsigned32 * getNokiaIMSMediaComponentId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP(return getAvp(helpers::nokia::AVPID__Nokia_IMS_Media_Component_Id)->getUnsigned32()); } @@ -133,7 +133,7 @@ public: Avp Time-Of-Last-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 Time * getTimeOfLastUsage(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const Time * getTimeOfLastUsage(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP(return getAvp(helpers::nokia::AVPID__Time_Of_Last_Usage)->getTime()); } @@ -141,7 +141,7 @@ public: Avp Time-Of-First-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 Time * getTimeOfFirstUsage(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const Time * getTimeOfFirstUsage(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP(return getAvp(helpers::nokia::AVPID__Time_Of_First_Usage)->getTime()); } @@ -149,7 +149,7 @@ public: Avp Session-Start-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 * getSessionStartIndicator(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const OctetString * getSessionStartIndicator(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP(return getAvp(helpers::nokia::AVPID__Session_Start_Indicator)->getOctetString()); } @@ -157,7 +157,7 @@ public: Avp Rule-Base-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 * getRuleBaseId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const UTF8String * getRuleBaseId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP(return getAvp(helpers::nokia::AVPID__Rule_Base_Id)->getUTF8String()); } @@ -165,7 +165,7 @@ public: Avp 3GPP-GGSN-Address 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 * get3GPPGGSNAddress(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const OctetString * get3GPPGGSNAddress(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP(return getAvp(helpers::tgpp::AVPID__3GPP_GGSN_Address)->getOctetString()); } @@ -173,7 +173,7 @@ public: Avp Nokia-Reporting-Reason 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 * getNOKIAReportingReason(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const Enumerated * getNOKIAReportingReason(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::nokia::AVPID__Nokia_Reporting_Reason)->getEnumerated()); } @@ -181,7 +181,7 @@ public: Avp 3GPP-Charging-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 Unsigned32 * get3GPPChargingId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const Unsigned32 * get3GPPChargingId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP(return getAvp(helpers::tgpp::AVPID__3GPP_Charging_Id)->getUnsigned32()); } @@ -190,7 +190,7 @@ public: @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 * get3GPPGPRSNegQoSProfile(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + const UTF8String * get3GPPGPRSNegQoSProfile(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { ASSERT_APP_GETAVP(return getAvp(helpers::tgpp::AVPID__3GPP_GPRS_Neg_QoS_Profile)->getUTF8String()); } }; diff --git a/include/anna/diameter/codec/Avp.hpp b/include/anna/diameter/codec/Avp.hpp index 2454d4d..331551b 100644 --- a/include/anna/diameter/codec/Avp.hpp +++ b/include/anna/diameter/codec/Avp.hpp @@ -171,42 +171,42 @@ class Avp { // of your class. // Common (also for Message class) - static avp_iterator avp_find(avp_container &avps, AvpId id, unsigned int position) throw(); - static const_avp_iterator avp_find(const avp_container &avps, AvpId id, unsigned int position) throw() { + static avp_iterator avp_find(avp_container &avps, AvpId id, unsigned int position) ; + static const_avp_iterator avp_find(const avp_container &avps, AvpId id, unsigned int position) { return (const_avp_iterator)avp_find((avp_container &)avps, id, position); } - static Avp * addAvp(avp_container &avps, int &insertionPositionForChilds, AvpId id, Engine *engine) throw(); - static bool removeAvp(avp_container &avps, find_container &finds, AvpId id, int ocurrence, Engine *engine) throw(); - static void fix(avp_container &avps, find_container &finds, int &insertionPositionForChilds, anna::diameter::stack::const_avprule_iterator ruleBegin, anna::diameter::stack::const_avprule_iterator ruleEnd) throw(); - static bool validLevel(const avp_container &avps, anna::diameter::stack::const_avprule_iterator ruleBegin, anna::diameter::stack::const_avprule_iterator ruleEnd, Engine * engine, const anna::diameter::codec::parent_t & parent, Message *answer) throw(anna::RuntimeException); // validates mandatory/fixed and cardinality - static const Avp* getAvp(const avp_container &avps, find_container &finds, AvpId id, int ocurrence, Engine *engine, anna::Exception::Mode::_v emode) throw(anna::RuntimeException); - static int countAvp(const avp_container &avps, AvpId id) throw(); - static const Avp* firstAvp(const avp_container &avps, AvpId id) throw(); - static int countChilds(const avp_container &avps) throw(); - static int addChild(avp_container &avps, int &insertionPositionForChilds, Avp *avp) throw() { + static Avp * addAvp(avp_container &avps, int &insertionPositionForChilds, AvpId id, Engine *engine) ; + static bool removeAvp(avp_container &avps, find_container &finds, AvpId id, int ocurrence, Engine *engine) ; + static void fix(avp_container &avps, find_container &finds, int &insertionPositionForChilds, anna::diameter::stack::const_avprule_iterator ruleBegin, anna::diameter::stack::const_avprule_iterator ruleEnd) ; + static bool validLevel(const avp_container &avps, anna::diameter::stack::const_avprule_iterator ruleBegin, anna::diameter::stack::const_avprule_iterator ruleEnd, Engine * engine, const anna::diameter::codec::parent_t & parent, Message *answer) noexcept(false); // validates mandatory/fixed and cardinality + static const Avp* getAvp(const avp_container &avps, find_container &finds, AvpId id, int ocurrence, Engine *engine, anna::Exception::Mode::_v emode) noexcept(false); + static int countAvp(const avp_container &avps, AvpId id) ; + static const Avp* firstAvp(const avp_container &avps, AvpId id) ; + static int countChilds(const avp_container &avps) ; + static int addChild(avp_container &avps, int &insertionPositionForChilds, Avp *avp) { if(!avp) return -1; avps[insertionPositionForChilds++] = avp; return insertionPositionForChilds; } - static const anna::diameter::stack::Avp *getStackAvp(AvpId id, Engine *engine) throw(); - const Avp* _getAvp(const char *name, int ocurrence, anna::Exception::Mode::_v emode) const throw(anna::RuntimeException); - const Avp* _getAvp(AvpId id, int ocurrence, anna::Exception::Mode::_v emode) const throw(anna::RuntimeException); + static const anna::diameter::stack::Avp *getStackAvp(AvpId id, Engine *engine) ; + const Avp* _getAvp(const char *name, int ocurrence, anna::Exception::Mode::_v emode) const noexcept(false); + const Avp* _getAvp(AvpId id, int ocurrence, anna::Exception::Mode::_v emode) const noexcept(false); // Own - avp_iterator avp_begin() throw() { return a_avps.begin(); } - avp_iterator avp_end() throw() { return a_avps.end(); } - static Avp* avp(avp_iterator ii) throw() { return ii->second; } - const_avp_iterator avp_begin() const throw() { return a_avps.begin(); } - const_avp_iterator avp_end() const throw() { return a_avps.end(); } - static const Avp* avp(const_avp_iterator ii) throw() { return ii->second; } + avp_iterator avp_begin() { return a_avps.begin(); } + avp_iterator avp_end() { return a_avps.end(); } + static Avp* avp(avp_iterator ii) { return ii->second; } + const_avp_iterator avp_begin() const { return a_avps.begin(); } + const_avp_iterator avp_end() const { return a_avps.end(); } + static const Avp* avp(const_avp_iterator ii) { return ii->second; } // Internal - bool flagsOK() const throw(); // flags coherence regarding dictionary. Only must be called when AVP is identified at the dictionary. - int addChild(Avp *avp) throw(anna::RuntimeException) { assertFormat("Grouped"); return addChild(a_avps, a_insertionPositionForChilds, avp); } - bool hasChildren() throw() { return a_avps.size() != 0; } + bool flagsOK() const ; // flags coherence regarding dictionary. Only must be called when AVP is identified at the dictionary. + int addChild(Avp *avp) noexcept(false) { assertFormat("Grouped"); return addChild(a_avps, a_insertionPositionForChilds, avp); } + bool hasChildren() { return a_avps.size() != 0; } - static bool contain(const_avp_iterator begin, const_avp_iterator end, const Avp *parent) throw() { return true; } + static bool contain(const_avp_iterator begin, const_avp_iterator end, const Avp *parent) { return true; } /** @@ -215,7 +215,7 @@ class Avp { This is useful to give flexibility to the application during message construction before encoding or representing the data. Is not recommended to fix a recently decoded message because possible validation problems will be hidden. */ - void fix() throw(); + void fix() ; /** Validates an Avp regarding dictionary rules like enumerated range, flags coherence, mandatory and fixed types, cardinality qualifiers, etc. @@ -225,7 +225,7 @@ class Avp { @return Boolean indicating validation result */ - bool valid(const anna::diameter::codec::parent_t & parent, Message *answer) const throw(anna::RuntimeException); + bool valid(const anna::diameter::codec::parent_t & parent, Message *answer) const noexcept(false); /** Decodes buffer provided over class content. If an error ocurred, decoding will stop launching exception (fatal error) or a warning trace (perhaps the achieved @@ -236,7 +236,7 @@ class Avp { @param parent Parent description. Internally used for alarms, tracing and Failed-AVP construction @param answer Answer built for request decoding/validation */ - void decode(const anna::DataBlock &db, const anna::diameter::codec::parent_t & parent, Message *answer) throw(anna::RuntimeException); + void decode(const anna::DataBlock &db, const anna::diameter::codec::parent_t & parent, Message *answer) noexcept(false); ///////////////////////////////////////////// @@ -248,7 +248,7 @@ class Avp { * Default implementation supports all anna::diameter formats (including derived ones). * Diameter basic formats are managed at #initialize, which will invoke this method at the end. */ - virtual void initializeByFormat() throw() {}; + virtual void initializeByFormat() {}; /** * Gets avp data-part length. @@ -259,7 +259,7 @@ class Avp { * * @return Avp data-part size. */ - virtual U24 getLengthByFormat(const anna::diameter::stack::Format *stackFormat) const throw() { return 0; }; + virtual U24 getLengthByFormat(const anna::diameter::stack::Format *stackFormat) const { return 0; }; /** Gets data or hexadecimal data depending on avp format, for xml creating @@ -270,7 +270,7 @@ class Avp { \param stackFormat Stack avp format in which data extraction is based. \return xml data representation */ - virtual std::string getXMLdataByFormat(bool & isHex, const anna::diameter::stack::Format *stackFormat) const throw() { return ""; }; + virtual std::string getXMLdataByFormat(bool & isHex, const anna::diameter::stack::Format *stackFormat) const { return ""; }; /** Interpret xml data in order to dump over the class content. @@ -281,7 +281,7 @@ class Avp { \param hexData Avp hex-data attribute \param stackFormat Stack avp format in which data extraction is based. */ - virtual void fromXMLByFormat(const anna::xml::Attribute* data, const anna::xml::Attribute* hexData, const anna::diameter::stack::Format *stackFormat) throw(anna::RuntimeException) {}; + virtual void fromXMLByFormat(const anna::xml::Attribute* data, const anna::xml::Attribute* hexData, const anna::diameter::stack::Format *stackFormat) noexcept(false) {}; /** @@ -292,7 +292,7 @@ class Avp { @param dataPart Data-part begin pointer @param stackFormat Stack avp format in which data extraction is based. */ - virtual void codeByFormat(char* dataPart, const anna::diameter::stack::Format *stackFormat) const throw(anna::RuntimeException) {}; + virtual void codeByFormat(char* dataPart, const anna::diameter::stack::Format *stackFormat) const noexcept(false) {}; /** @@ -304,7 +304,7 @@ class Avp { @param size Avp data part size @param stackFormat Stack avp format in which data extraction is based. */ - virtual void decodeDataPartByFormat(const char * buffer, int size, const anna::diameter::stack::Format *stackFormat) throw(anna::RuntimeException) {}; + virtual void decodeDataPartByFormat(const char * buffer, int size, const anna::diameter::stack::Format *stackFormat) noexcept(false) {}; /** Reserves memory for data part depending on avp format for the identifier provided. @@ -313,12 +313,12 @@ class Avp { @param stackFormat Stack avp format in which data extraction is based. */ - virtual void allocationByFormat(const anna::diameter::stack::Format *stackFormat) throw() {}; + virtual void allocationByFormat(const anna::diameter::stack::Format *stackFormat) {}; /** * Clears Avp data-part format containers. */ - virtual void clearByFormat() throw() {}; + virtual void clearByFormat() {}; @@ -328,17 +328,17 @@ protected: mutable Engine *a_engine; /** Codec Engine getter: avoids have to create base engine when using its child */ - virtual Engine * getEngine() const throw(anna::RuntimeException); + virtual Engine * getEngine() const noexcept(false); /** * Initializes Avp class information. */ - void initialize() throw(); + void initialize() ; /** * Assert format regarding dictionary */ - void assertFormat(const std::string &name) const throw(anna::RuntimeException); + void assertFormat(const std::string &name) const noexcept(false); /** * Gets avp total length based on internal data part and header configuration. @@ -346,7 +346,7 @@ protected: * The only format which always have total length equal to sum of all its parts is Grouped, * because of the 4-multiple nature of its data part length. */ - U24 getLength() const throw(); + U24 getLength() const ; /** Gets data or hexadecimal data depending on avp format, for xml creating @@ -355,7 +355,7 @@ protected: \param stackFormat Stack avp format in which data extraction is based. \return xml data representation */ - std::string getXMLdata(bool & isHex, const anna::diameter::stack::Format *stackFormat) const throw(); + std::string getXMLdata(bool & isHex, const anna::diameter::stack::Format *stackFormat) const ; /** @@ -366,7 +366,7 @@ protected: @param parent Parent description. Internally used for alarms, tracing and Failed-AVP construction @param answer Answer built for request decoding/validation */ - void decodeDataPart(const char * buffer, int size, const anna::diameter::codec::parent_t & parent, Message *answer) throw(anna::RuntimeException); + void decodeDataPart(const char * buffer, int size, const anna::diameter::codec::parent_t & parent, Message *answer) noexcept(false); public: @@ -401,7 +401,7 @@ public: * will be interpreted as 'unknown' with the new dictionary, and then some problems * may occur. If you add elements (vendors, avps, messages) is not a problem. */ - void setEngine(Engine *engine) throw(); + void setEngine(Engine *engine) ; // Length references @@ -434,7 +434,7 @@ public: * Clears and initializes Avp class information. * Application should clear auxiliary avp objects before setting data in a new context. */ - void clear() throw(anna::RuntimeException); + void clear() noexcept(false); /** @@ -445,12 +445,12 @@ public: @param id Avp identifier as pair (code,vendor-id). */ - void setId(AvpId id) throw(anna::RuntimeException); + void setId(AvpId id) noexcept(false); /** Same as #setId but providing dictionary logical name for Avp searched */ - void setId(const char *name) throw(anna::RuntimeException); + void setId(const char *name) noexcept(false); /** Sets/unsets M bit activation. @@ -463,7 +463,7 @@ public: @param activate Activates/deactivates the bit. True by default. */ - void setMandatoryBit(bool activate = true) throw() { if(activate) a_flags |= MBitMask; else a_flags &= (~MBitMask); } + void setMandatoryBit(bool activate = true) { if(activate) a_flags |= MBitMask; else a_flags &= (~MBitMask); } /** Sets/unsets P bit activation. @@ -472,7 +472,7 @@ public: @param activate Activates/deactivates the bit. True by default. */ - void setEncryptionBit(bool activate = true) throw() { if(activate) a_flags |= PBitMask; else a_flags &= (~PBitMask); } + void setEncryptionBit(bool activate = true) { if(activate) a_flags |= PBitMask; else a_flags &= (~PBitMask); } /** @@ -483,13 +483,13 @@ public: @return Pointer to the new created avp. */ - Avp * addAvp(AvpId id) throw(anna::RuntimeException) { assertFormat("Grouped"); return addAvp(a_avps, a_insertionPositionForChilds, id, getEngine()); } + Avp * addAvp(AvpId id) noexcept(false) { assertFormat("Grouped"); return addAvp(a_avps, a_insertionPositionForChilds, id, getEngine()); } /** Same as #addAvp but providing dictionary logical name for Avp searched */ - Avp * addAvp(const char *name) throw(anna::RuntimeException); + Avp * addAvp(const char *name) noexcept(false); /** Adds an avp child providing a persistent pointer (must be maintained by application). @@ -502,42 +502,42 @@ public: @return Pointer to the added avp (again). */ - Avp * addAvp(Avp * avp) throw(anna::RuntimeException); + Avp * addAvp(Avp * avp) noexcept(false); // Data part access /** Access content for OctetString Avp in order to set data part */ - OctetString * getOctetString() throw(anna::RuntimeException) { assertFormat("OctetString"); return a_OctetString; } + OctetString * getOctetString() noexcept(false) { assertFormat("OctetString"); return a_OctetString; } /** Access content for Integer32 Avp in order to set data part */ - Integer32 * getInteger32() throw(anna::RuntimeException) { assertFormat("Integer32"); return a_Integer32; } + Integer32 * getInteger32() noexcept(false) { assertFormat("Integer32"); return a_Integer32; } /** Access content for Integer64 Avp in order to set data part */ - Integer64 * getInteger64() throw(anna::RuntimeException) { assertFormat("Integer64"); return a_Integer64; } + Integer64 * getInteger64() noexcept(false) { assertFormat("Integer64"); return a_Integer64; } /** Access content for Unsigned32 Avp in order to set data part */ - Unsigned32 * getUnsigned32() throw(anna::RuntimeException) { assertFormat("Unsigned32"); return a_Unsigned32; } + Unsigned32 * getUnsigned32() noexcept(false) { assertFormat("Unsigned32"); return a_Unsigned32; } /** Access content for Unsigned64 Avp in order to set data part */ - Unsigned64 * getUnsigned64() throw(anna::RuntimeException) { assertFormat("Unsigned64"); return a_Unsigned64; } + Unsigned64 * getUnsigned64() noexcept(false) { assertFormat("Unsigned64"); return a_Unsigned64; } /** Access content for Float32 Avp in order to set data part */ - Float32 * getFloat32() throw(anna::RuntimeException) { assertFormat("Float32"); return a_Float32; } + Float32 * getFloat32() noexcept(false) { assertFormat("Float32"); return a_Float32; } /** Access content for Float64 Avp in order to set data part */ - Float64 * getFloat64() throw(anna::RuntimeException) { assertFormat("Float64"); return a_Float64; } + Float64 * getFloat64() noexcept(false) { assertFormat("Float64"); return a_Float64; } /** Access content for Address Avp in order to set data part */ - Address * getAddress() throw(anna::RuntimeException) { assertFormat("Address"); return a_Address; } + Address * getAddress() noexcept(false) { assertFormat("Address"); return a_Address; } /** Access content for Time Avp in order to set data part */ - Time * getTime() throw(anna::RuntimeException) { assertFormat("Time"); return a_Time; } + Time * getTime() noexcept(false) { assertFormat("Time"); return a_Time; } /** Access content for UTF8String Avp in order to set data part */ - UTF8String * getUTF8String() throw(anna::RuntimeException) { assertFormat("UTF8String"); return a_UTF8String; } + UTF8String * getUTF8String() noexcept(false) { assertFormat("UTF8String"); return a_UTF8String; } /** Access content for DiameterIdentity Avp in order to set data part */ - DiameterIdentity * getDiameterIdentity() throw(anna::RuntimeException) { assertFormat("DiameterIdentity"); return a_DiameterIdentity; } + DiameterIdentity * getDiameterIdentity() noexcept(false) { assertFormat("DiameterIdentity"); return a_DiameterIdentity; } /** Access content for DiameterURI Avp in order to set data part */ - DiameterURI * getDiameterURI() throw(anna::RuntimeException) { assertFormat("DiameterURI"); return a_DiameterURI; } + DiameterURI * getDiameterURI() noexcept(false) { assertFormat("DiameterURI"); return a_DiameterURI; } /** Access content for Enumerated Avp in order to set data part */ - Enumerated * getEnumerated() throw(anna::RuntimeException) { assertFormat("Enumerated"); return a_Enumerated; } + Enumerated * getEnumerated() noexcept(false) { assertFormat("Enumerated"); return a_Enumerated; } /** Access content for IPFilterRule Avp in order to set data part */ - IPFilterRule * getIPFilterRule() throw(anna::RuntimeException) { assertFormat("IPFilterRule"); return a_IPFilterRule; } + IPFilterRule * getIPFilterRule() noexcept(false) { assertFormat("IPFilterRule"); return a_IPFilterRule; } /** Access content for QoSFilterRule Avp in order to set data part */ - QoSFilterRule * getQoSFilterRule() throw(anna::RuntimeException) { assertFormat("QoSFilterRule"); return a_QoSFilterRule; } + QoSFilterRule * getQoSFilterRule() noexcept(false) { assertFormat("QoSFilterRule"); return a_QoSFilterRule; } /** Access content for Unknown Avp in order to set data part */ - Unknown * getUnknown() throw(anna::RuntimeException) { assertFormat("Unknown"); return a_Unknown; } + Unknown * getUnknown() noexcept(false) { assertFormat("Unknown"); return a_Unknown; } /** @@ -549,55 +549,55 @@ public: @return Returns true if something was removed. False in other cases (including i.e. when this Avp is empty or is not a grouped avp). */ - bool removeAvp(AvpId id, int ocurrence = 1) throw(anna::RuntimeException) { assertFormat("Grouped"); return removeAvp(a_avps, (find_container&)a_finds, id, ocurrence, getEngine()); } + bool removeAvp(AvpId id, int ocurrence = 1) noexcept(false) { assertFormat("Grouped"); return removeAvp(a_avps, (find_container&)a_finds, id, ocurrence, getEngine()); } /** Same as #removeAvp but providing dictionary logical name for Avp searched */ - bool removeAvp(const char *name, int ocurrence = 1) throw(anna::RuntimeException); + bool removeAvp(const char *name, int ocurrence = 1) noexcept(false); // getters /** Gets Avp identifier as pair (code, vendor-id). */ - const AvpId & getId() const throw() { return a_id; } + const AvpId & getId() const { return a_id; } /** Gets Avp vendor-id. */ - int getVendorId() const throw() { return a_id.second; } + int getVendorId() const { return a_id.second; } /** Gets stack avp (dictionary avp reference). */ - const anna::diameter::stack::Avp *getStackAvp() const throw(anna::RuntimeException) { return getStackAvp(a_id, getEngine()); } + const anna::diameter::stack::Avp *getStackAvp() const noexcept(false) { return getStackAvp(a_id, getEngine()); } /** Returns V bit activation state */ - bool vendorBit() const throw() { return ((a_flags & VBitMask) != 0x00); } + bool vendorBit() const { return ((a_flags & VBitMask) != 0x00); } /** Returns M bit activation state */ - bool mandatoryBit() const throw() { return ((a_flags & MBitMask) != 0x00); } + bool mandatoryBit() const { return ((a_flags & MBitMask) != 0x00); } /** Returns P bit activation state */ - bool encryptionBit() const throw() { return ((a_flags & PBitMask) != 0x00); } + bool encryptionBit() const { return ((a_flags & PBitMask) != 0x00); } // Data part access /** Access content for OctetString Avp */ - const OctetString * getOctetString() const throw(anna::RuntimeException) { assertFormat("OctetString"); return a_OctetString; } + const OctetString * getOctetString() const noexcept(false) { assertFormat("OctetString"); return a_OctetString; } /** Access content for Integer32 Avp */ - const Integer32 * getInteger32() const throw(anna::RuntimeException) { assertFormat("Integer32"); return a_Integer32; } + const Integer32 * getInteger32() const noexcept(false) { assertFormat("Integer32"); return a_Integer32; } /** Access content for Integer64 Avp */ - const Integer64 * getInteger64() const throw(anna::RuntimeException) { assertFormat("Integer64"); return a_Integer64; } + const Integer64 * getInteger64() const noexcept(false) { assertFormat("Integer64"); return a_Integer64; } /** Access content for Unsigned32 Avp */ - const Unsigned32 * getUnsigned32() const throw(anna::RuntimeException) { assertFormat("Unsigned32"); return a_Unsigned32; } + const Unsigned32 * getUnsigned32() const noexcept(false) { assertFormat("Unsigned32"); return a_Unsigned32; } /** Access content for Unsigned64 Avp */ - const Unsigned64 * getUnsigned64() const throw(anna::RuntimeException) { assertFormat("Unsigned64"); return a_Unsigned64; } + const Unsigned64 * getUnsigned64() const noexcept(false) { assertFormat("Unsigned64"); return a_Unsigned64; } /** Access content for Float32 Avp */ - const Float32 * getFloat32() const throw(anna::RuntimeException) { assertFormat("Float32"); return a_Float32; } + const Float32 * getFloat32() const noexcept(false) { assertFormat("Float32"); return a_Float32; } /** Access content for Float64 Avp */ - const Float64 * getFloat64() const throw(anna::RuntimeException) { assertFormat("Float64"); return a_Float64; } + const Float64 * getFloat64() const noexcept(false) { assertFormat("Float64"); return a_Float64; } /** Access content for Grouped Avp. Exception mode allows different combinations like cascade access: @@ -629,45 +629,45 @@ public: If avp format is not grouped, always exception will be launched and no matter what mode is provided. It would be a development error and must be solved. */ - const Avp* getAvp(AvpId id, int ocurrence = 1, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) const throw(anna::RuntimeException) { + const Avp* getAvp(AvpId id, int ocurrence = 1, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) const noexcept(false) { return _getAvp(id, ocurrence, emode); } - Avp* getAvp(AvpId id, int ocurrence = 1, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + Avp* getAvp(AvpId id, int ocurrence = 1, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { return const_cast(_getAvp(id, ocurrence, emode)); } /** Same as #getAvp but providing dictionary logical name for Avp searched */ - const Avp* getAvp(const char *name, int ocurrence = 1, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) const throw(anna::RuntimeException) { + const Avp* getAvp(const char *name, int ocurrence = 1, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) const noexcept(false) { return _getAvp(name, ocurrence, emode); } - Avp* getAvp(const char *name, int ocurrence = 1, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + Avp* getAvp(const char *name, int ocurrence = 1, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { return const_cast(_getAvp(name, ocurrence, emode)); } /** Access content for Address Avp */ - const Address * getAddress() const throw(anna::RuntimeException) { assertFormat("Address"); return a_Address; } + const Address * getAddress() const noexcept(false) { assertFormat("Address"); return a_Address; } /** Access content for Time Avp */ - const Time * getTime() const throw(anna::RuntimeException) { assertFormat("Time"); return a_Time; } + const Time * getTime() const noexcept(false) { assertFormat("Time"); return a_Time; } /** Access content for UTF8String Avp */ - const UTF8String * getUTF8String() const throw(anna::RuntimeException) { assertFormat("UTF8String"); return a_UTF8String; } + const UTF8String * getUTF8String() const noexcept(false) { assertFormat("UTF8String"); return a_UTF8String; } /** Access content for DiameterIdentity Avp */ - const DiameterIdentity * getDiameterIdentity() const throw(anna::RuntimeException) { assertFormat("DiameterIdentity"); return a_DiameterIdentity; } + const DiameterIdentity * getDiameterIdentity() const noexcept(false) { assertFormat("DiameterIdentity"); return a_DiameterIdentity; } /** Access content for DiameterURI Avp */ - const DiameterURI * getDiameterURI() const throw(anna::RuntimeException) { assertFormat("DiameterURI"); return a_DiameterURI; } + const DiameterURI * getDiameterURI() const noexcept(false) { assertFormat("DiameterURI"); return a_DiameterURI; } /** Access content for Enumerated Avp */ - const Enumerated * getEnumerated() const throw(anna::RuntimeException) { assertFormat("Enumerated"); return a_Enumerated; } + const Enumerated * getEnumerated() const noexcept(false) { assertFormat("Enumerated"); return a_Enumerated; } /** Access content for IPFilterRule Avp */ - const IPFilterRule * getIPFilterRule() const throw(anna::RuntimeException) { assertFormat("IPFilterRule"); return a_IPFilterRule; } + const IPFilterRule * getIPFilterRule() const noexcept(false) { assertFormat("IPFilterRule"); return a_IPFilterRule; } /** Access content for QoSFilterRule Avp */ - const QoSFilterRule * getQoSFilterRule() const throw(anna::RuntimeException) { assertFormat("QoSFilterRule"); return a_QoSFilterRule; } + const QoSFilterRule * getQoSFilterRule() const noexcept(false) { assertFormat("QoSFilterRule"); return a_QoSFilterRule; } /** Access content for Unknown Avp */ - const Unknown * getUnknown() const throw(anna::RuntimeException) { assertFormat("Unknown"); return a_Unknown; } + const Unknown * getUnknown() const noexcept(false) { assertFormat("Unknown"); return a_Unknown; } /** @@ -679,7 +679,7 @@ public: @param db Buffer data block processed */ - void decode(const anna::DataBlock &db) throw(anna::RuntimeException); + void decode(const anna::DataBlock &db) noexcept(false); /** @@ -687,7 +687,7 @@ public: \param avpNode Avp root node */ - void fromXML(const anna::xml::Node* avpNode) throw(anna::RuntimeException); + void fromXML(const anna::xml::Node* avpNode) noexcept(false); /** @@ -698,7 +698,7 @@ public: * @param buffer Raw data to be encoded (shall be externally allocated) * @param size Size of raw data to be encoded */ - void code(char* buffer, int &size) const throw(anna::RuntimeException); + void code(char* buffer, int &size) const noexcept(false); // Helpers @@ -708,7 +708,7 @@ public: \param parent Parent XML node on which hold this instance information. \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 ; /** Class xml string representation @@ -717,7 +717,7 @@ public: \return XML string representation with relevant information for this instance. */ - std::string asXMLString(bool normalize = false) const throw(); + std::string asXMLString(bool normalize = false) const ; /** Comparison operator by mean serialization @@ -727,7 +727,7 @@ public: @return Comparison result */ - friend bool operator == (const Avp & a1, const Avp & a2) throw() { return (a1.asXMLString() == a2.asXMLString()); } + friend bool operator == (const Avp & a1, const Avp & a2) { return (a1.asXMLString() == a2.asXMLString()); } /** Match a regular expression (string pattern) regarding xml string serialization for this avp. @@ -737,26 +737,26 @@ public: \return Returns the match result */ - bool isLike(const std::string &pattern) const throw(); + bool isLike(const std::string &pattern) const ; /** Counts the number of ocurrences of Avps (first level) with the identifier provided @param id Avp identifier (pair code + vendor-id). */ - int countAvp(AvpId id) const throw(anna::RuntimeException) { assertFormat("Grouped"); return countAvp(a_avps, id); } + int countAvp(AvpId id) const noexcept(false) { assertFormat("Grouped"); return countAvp(a_avps, id); } /** Same as #countAvp but providing dictionary logical name for Avp searched */ - int countAvp(const char *name) const throw(anna::RuntimeException); + int countAvp(const char *name) const noexcept(false); /** Counts the number of children within a grouped avp @param id Avp identifier (pair code + vendor-id). */ - int countChilds() const throw(anna::RuntimeException) { assertFormat("Grouped"); return countChilds(a_avps); } + int countChilds() const noexcept(false) { assertFormat("Grouped"); return countChilds(a_avps); } /** The 'M' Bit, known as the Mandatory bit, indicates whether support of the AVP is required. If an AVP with the 'M' bit set is received by @@ -767,7 +767,7 @@ public: Relay and Redirect agents could reimplement this method to avoid oam management (another way is avoid alarm/counter registration on these applications). Result-Code DIAMETER_AVP_UNSUPPORTED will be stored for possible answer message. */ - virtual void unknownAvpWithMandatoryBit() const throw(anna::RuntimeException); + virtual void unknownAvpWithMandatoryBit() const noexcept(false); friend class Message; diff --git a/include/anna/diameter/codec/Engine.hpp b/include/anna/diameter/codec/Engine.hpp index 907bcd4..022bbef 100644 --- a/include/anna/diameter/codec/Engine.hpp +++ b/include/anna/diameter/codec/Engine.hpp @@ -49,7 +49,7 @@ public: */ Engine(const char *className, const stack::Dictionary * dictionary) : EngineImpl(className, dictionary) {;} - void releaseAvp(Avp* avp) throw() { + void releaseAvp(Avp* avp) { if(avp == NULL) return; //Avp* aux = static_cast (avp); @@ -57,7 +57,7 @@ public: a_avps.release(avp/*aux*/); } - void releaseMessage(Message* message) throw() { + void releaseMessage(Message* message) { if(message == NULL) return; //Message* aux = static_cast (message); @@ -70,8 +70,8 @@ protected: anna::Recycler a_avps; anna::Recycler a_messages; - anna::diameter::codec::Avp* allocateAvp() throw() { return a_avps.create(); } - anna::diameter::codec::Message* allocateMessage() throw() { return a_messages.create(); } + anna::diameter::codec::Avp* allocateAvp() { return a_avps.create(); } + anna::diameter::codec::Message* allocateMessage() { return a_messages.create(); } friend class Message; friend class Avp; diff --git a/include/anna/diameter/codec/EngineImpl.hpp b/include/anna/diameter/codec/EngineImpl.hpp index a73b42a..22fb82f 100644 --- a/include/anna/diameter/codec/EngineImpl.hpp +++ b/include/anna/diameter/codec/EngineImpl.hpp @@ -110,18 +110,18 @@ class Avp; * anna::Recycler a_avps; * anna::Recycler a_messages; * - * anna::diameter::codec::Avp* allocateAvp () throw () { return a_avps.create (); } + * anna::diameter::codec::Avp* allocateAvp () { return a_avps.create (); } * - * void releaseAvp (anna::diameter::codec::Avp* avp) throw () { + * void releaseAvp (anna::diameter::codec::Avp* avp) { * if (avp == NULL) return; * MyAvp* aux = static_cast (avp); * aux->clear(); // free internal data-part storage specially for grouped avps which will release its childrens * a_avps.release (aux); * } * - * anna::diameter::codec::Message* allocateMessage () throw () { return a_messages.create (); } + * anna::diameter::codec::Message* allocateMessage () { return a_messages.create (); } * - * void releaseMessage (anna::diameter::codec::Message* message) throw () { + * void releaseMessage (anna::diameter::codec::Message* message) { * if (message == NULL) return; * MyMessage* aux = static_cast (message); * aux->clear(); // free internal data-part storage specially for childrens releasing @@ -159,8 +159,8 @@ public: // Creators - Avp* createAvp(const AvpId *id) throw(anna::RuntimeException); - Message* createMessage(const CommandId *id) throw(anna::RuntimeException); + Avp* createAvp(const AvpId *id) noexcept(false); + Message* createMessage(const CommandId *id) noexcept(false); private: @@ -175,9 +175,9 @@ private: const stack::Dictionary * a_dictionary; // helpers - static const char* asText(const ValidationDepth::_v) throw(); - static const char* asText(const ValidationMode::_v) throw(); - static const char* asText(const FixMode::_v) throw(); + static const char* asText(const ValidationDepth::_v) ; + static const char* asText(const ValidationMode::_v) ; + static const char* asText(const FixMode::_v) ; public: @@ -203,14 +203,14 @@ public: @return Returns currently configured engine dictionary */ - const stack::Dictionary *getDictionary() const throw() { return a_dictionary; } + const stack::Dictionary *getDictionary() const { return a_dictionary; } /** * Sets behaviour on validation procedure. * \param validationDepth Behaviour on validation procedure: complete analysis or stop at first validation error over the message. */ - void setValidationDepth(const ValidationDepth::_v validationDepth) throw() { a_validationDepth = validationDepth; } + void setValidationDepth(const ValidationDepth::_v validationDepth) { a_validationDepth = validationDepth; } /** * Returns behaviour on on validation procedure. @@ -220,7 +220,7 @@ public: * * \return Behaviour on validation procedure: complete analysis or stop at first validation error over the message (by default). */ - ValidationDepth::_v getValidationDepth() const throw() { return a_validationDepth; } + ValidationDepth::_v getValidationDepth() const { return a_validationDepth; } /** * Sets behaviour on validation procedure regarding stack flags. Actually, only AVP flags M & P are affected. The vendor bit is @@ -229,7 +229,7 @@ public: * \param ignoreFlags Validation will ignore flags. */ - void ignoreFlagsOnValidation(bool ignoreFlags) throw() { a_ignoreFlags = ignoreFlags; } + void ignoreFlagsOnValidation(bool ignoreFlags) { a_ignoreFlags = ignoreFlags; } /** * Gets behaviour on validation procedure regarding stack flags. Actually, only AVP flags M & P are affected. The vendor bit is @@ -237,13 +237,13 @@ public: * By default (at engine start), flags are verified. * \return Validation ignore flags indicator. */ - bool ignoreFlagsOnValidation() const throw() { return a_ignoreFlags; } + bool ignoreFlagsOnValidation() const { return a_ignoreFlags; } /** * Sets validation mode. * \param validationMode Validation mode: before encoding, after decoding, always or never. */ - void setValidationMode(const ValidationMode::_v validationMode) throw() { a_validationMode = validationMode; } + void setValidationMode(const ValidationMode::_v validationMode) { a_validationMode = validationMode; } /** * Returns validation mode. @@ -251,7 +251,7 @@ public: * during development phase. * \return Validation mode: before encoding, after decoding (by default), always or never. */ - ValidationMode::_v getValidationMode() const throw() { return a_validationMode; } + ValidationMode::_v getValidationMode() const { return a_validationMode; } @@ -259,13 +259,13 @@ public: * Sets fix mode. * \param fixMode Fix mode: before encoding, after decoding, always or never. */ - void setFixMode(const FixMode::_v fixMode) throw() { a_fixMode = fixMode; } + void setFixMode(const FixMode::_v fixMode) { a_fixMode = fixMode; } /** * Returns fix mode. * \return Fix mode: before encoding (by default), after decoding, always or never. */ - FixMode::_v getFixMode() const throw() { return a_fixMode; } + FixMode::_v getFixMode() const { return a_fixMode; } /** * Sets single FailedAVP. True by default. If false, and more than one wrong avp are found during message @@ -274,13 +274,13 @@ public: * * \param single Single Failed-AVP boolean. */ - void setSingleFailedAVP(bool single = true) throw() { a_singleFailedAVP = single; } + void setSingleFailedAVP(bool single = true) { a_singleFailedAVP = single; } /** * Returns single Failed-AVP boolean. * \return Failed-AVP could be one (true) or more (false) in answer message. */ - bool getSingleFailedAVP() const throw() { return a_singleFailedAVP; } + bool getSingleFailedAVP() const { return a_singleFailedAVP; } /** * Creates a new diameter avp assigning its identifier, using engine resources to allocate memory (recommended @@ -292,7 +292,7 @@ public: * * @return Created avp ready to be used */ - Avp* createAvp(AvpId id) throw(anna::RuntimeException) { return createAvp(&id); } + Avp* createAvp(AvpId id) noexcept(false) { return createAvp(&id); } /** * Creates a new diameter avp, using engine resources to allocate memory (recommended recycler allocation at @@ -300,7 +300,7 @@ public: * * @return Created avp ready to be used */ - Avp* createAvp() throw(anna::RuntimeException) { return createAvp(NULL); } + Avp* createAvp() noexcept(false) { return createAvp(NULL); } /** * Creates a new diameter Message assigning its identifier, using engine resources to allocate memory (recommended @@ -312,7 +312,7 @@ public: * * @return Created message ready to be used */ - Message* createMessage(CommandId id) throw(anna::RuntimeException) { return createMessage(&id); } + Message* createMessage(CommandId id) noexcept(false) { return createMessage(&id); } /** * Creates a new diameter message, using engine resources to allocate memory (recommended recycler allocation @@ -320,7 +320,7 @@ public: * * @return Created message ready to be used */ - Message* createMessage() throw(anna::RuntimeException) { return createMessage(NULL); } + Message* createMessage() noexcept(false) { return createMessage(NULL); } /** @@ -329,20 +329,20 @@ public: @param xmlPathFile_or_string Complete path file or string representation for the xml document which represents the diameter message @param pathfile_or_string boolean about the interpretation of the previous argument */ - Message *createMessage(const std::string & xmlPathFile_or_string, bool pathfile_or_string = true) throw(anna::RuntimeException); + Message *createMessage(const std::string & xmlPathFile_or_string, bool pathfile_or_string = true) noexcept(false); /** Invoked to free Avps. \see anna::Recycler */ - virtual void releaseAvp(Avp*) throw() = 0; + virtual void releaseAvp(Avp*) = 0; /** Invoked to free Messages. \see anna::Recycler */ - virtual void releaseMessage(Message*) throw() = 0; + virtual void releaseMessage(Message*) = 0; /** @@ -350,14 +350,14 @@ public: * * @return String with class content */ - virtual std::string asString(void) const throw(); + virtual std::string asString(void) const ; /** Class XML representation. \param parent XML node over which we will put instance information. \return XML documentcon with class content. */ - virtual anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); + virtual anna::xml::Node* asXML(anna::xml::Node* parent) const ; /** @@ -367,7 +367,7 @@ public: @return Avp identifier as pair (code,vendor-id) */ - AvpId avpIdForName(const char * name) throw(anna::RuntimeException); + AvpId avpIdForName(const char * name) noexcept(false); /** @@ -377,7 +377,7 @@ public: @return Command identifier as pair (code,request-indicator) */ - CommandId commandIdForName(const char * name) throw(anna::RuntimeException); + CommandId commandIdForName(const char * name) noexcept(false); protected: @@ -389,7 +389,7 @@ protected: \see anna::Recycler */ - virtual Avp* allocateAvp() throw() = 0; + virtual Avp* allocateAvp() = 0; /** @@ -399,7 +399,7 @@ protected: \see anna::Recycler */ - virtual Message* allocateMessage() throw() = 0; + virtual Message* allocateMessage() = 0; /** @@ -411,7 +411,7 @@ protected: @see setValidationDepth @see getValidationDepth */ - void validationAnomaly(const std::string & description) const throw(anna::RuntimeException); + void validationAnomaly(const std::string & description) const noexcept(false); }; } diff --git a/include/anna/diameter/codec/EngineManager.hpp b/include/anna/diameter/codec/EngineManager.hpp index e498e69..e487885 100644 --- a/include/anna/diameter/codec/EngineManager.hpp +++ b/include/anna/diameter/codec/EngineManager.hpp @@ -60,17 +60,17 @@ public: /** * First element iterator */ - appid_codec_engines_it begin() const throw() { return a_appid_codec_engines.begin(); } + appid_codec_engines_it begin() const { return a_appid_codec_engines.begin(); } /** * Last element iterator */ - appid_codec_engines_it end() const throw() { return a_appid_codec_engines.end(); } + appid_codec_engines_it end() const { return a_appid_codec_engines.end(); } /** * Number of registered engines */ - int size() const throw() { return a_appid_codec_engines.size(); } + int size() const { return a_appid_codec_engines.size(); } /** * Registers a new codec engine (externally allocated) associated to an application id. @@ -79,7 +79,7 @@ public: * @param appid Application-Id * @param engine Associated codec engine */ - void registerCodecEngine(const ApplicationId &appid, Engine* engine) throw(); + void registerCodecEngine(const ApplicationId &appid, Engine* engine) ; /** * Get the associated codec engine for a provided Application-Id. @@ -88,7 +88,7 @@ public: * * @return Found codec engine, NULL if not found */ - Engine *getCodecEngine(const ApplicationId &appid) const throw(); + Engine *getCodecEngine(const ApplicationId &appid) const ; /** * If only one codec engine is registered (mono-stack application), it will be returned @@ -98,7 +98,7 @@ public: * * @return Unique codec engine, NULL if not unique (empty manager or more than one) */ - Engine *getMonoStackCodecEngine() const throw() { + Engine *getMonoStackCodecEngine() const { return ((size() != 1) ? NULL : begin()->second); } @@ -115,7 +115,7 @@ public: * @param enable Activates/deactivates the codec engine selection from the Application-Id value. True by default * and applicable when this manager store is not empty. */ - void selectFromApplicationId (bool enable) throw() { a_autoSelectFromApplicationId = enable; } + void selectFromApplicationId (bool enable) { a_autoSelectFromApplicationId = enable; } /** Gets the currently configured behaviour regarding codec engine selection. @@ -123,14 +123,14 @@ public: @return True if selection is done with the Application-Id (default behaviour). False to disable (the manager could be used for some other things which could be also interesting). */ - bool selectFromApplicationId (void) throw() { return a_autoSelectFromApplicationId; } + bool selectFromApplicationId (void) { return a_autoSelectFromApplicationId; } /** Class XML representation. \param parent XML node over which we will put instance information. \return XML documentcon with class content. */ - virtual anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); + virtual anna::xml::Node* asXML(anna::xml::Node* parent) const ; friend class anna::Singleton ; diff --git a/include/anna/diameter/codec/Format.hpp b/include/anna/diameter/codec/Format.hpp index e326f34..01ed65f 100644 --- a/include/anna/diameter/codec/Format.hpp +++ b/include/anna/diameter/codec/Format.hpp @@ -61,7 +61,7 @@ struct Format { * * @return Format description */ - static const char* asText(const Format::_v v) throw(anna::RuntimeException) { + static const char* asText(const Format::_v v) noexcept(false) { return asCString(v); } diff --git a/include/anna/diameter/codec/Message.hpp b/include/anna/diameter/codec/Message.hpp index 2ec338b..3c8a4f7 100644 --- a/include/anna/diameter/codec/Message.hpp +++ b/include/anna/diameter/codec/Message.hpp @@ -86,7 +86,7 @@ class Message { int a_insertionPositionForChilds; // used with childrens anna::DataBlock a_forCode; - const Avp* _getAvp(const char *name, int ocurrence, anna::Exception::Mode::_v emode) const throw(anna::RuntimeException); + const Avp* _getAvp(const char *name, int ocurrence, anna::Exception::Mode::_v emode) const noexcept(false); // --- Developer notes --- // 'AVP Length' does not include posible data padding. Thanks to this, 'Data Length' @@ -103,23 +103,23 @@ class Message { // Children helpers // Own - avp_iterator avp_begin() throw() { return a_avps.begin(); } - avp_iterator avp_end() throw() { return a_avps.end(); } - const_avp_iterator avp_begin() const throw() { return a_avps.begin(); } - const_avp_iterator avp_end() const throw() { return a_avps.end(); } + avp_iterator avp_begin() { return a_avps.begin(); } + avp_iterator avp_end() { return a_avps.end(); } + const_avp_iterator avp_begin() const { return a_avps.begin(); } + const_avp_iterator avp_end() const { return a_avps.end(); } /** * Gets avp total message length. */ - U24 getLength() const throw(); + U24 getLength() const ; // Internal - bool flagsOK(int &rc) const throw(); // flags coherence regarding dictionary. Only must be called when Message is identified at the dictionary. - int addChild(Avp *avp) throw() { return Avp::addChild(a_avps, a_insertionPositionForChilds, avp); } - const anna::diameter::stack::Command *getStackCommand(CommandId id) const throw(anna::RuntimeException); + bool flagsOK(int &rc) const ; // flags coherence regarding dictionary. Only must be called when Message is identified at the dictionary. + int addChild(Avp *avp) { return Avp::addChild(a_avps, a_insertionPositionForChilds, avp); } + const anna::diameter::stack::Command *getStackCommand(CommandId id) const noexcept(false); - void setFailedAvp(const parent_t &parent, AvpId wrong, const char *wrongName = NULL) throw(anna::RuntimeException); + void setFailedAvp(const parent_t &parent, AvpId wrong, const char *wrongName = NULL) noexcept(false); // During message decoding and validation, the first wrong avp is stored and all the tracking is managed to find out its // nested path for the case of grouped avps with wrong avps inside. Remember the RFC 6733, section 7.5: // @@ -150,13 +150,13 @@ protected: mutable Engine *a_engine; /** Codec Engine getter: avoids have to create base engine when using its child */ - virtual Engine * getEngine() const throw(anna::RuntimeException); + virtual Engine * getEngine() const noexcept(false); /** * Initializes Message class information. * Any reimplementation must first invoke base class method. */ - virtual void initialize() throw(); + virtual void initialize() ; public: @@ -196,7 +196,7 @@ public: * about #clear. The needed cleanup will be done automatically from decoding and xml * loading procedures, and initialized engine will be kept along message operations. */ - void setEngine(Engine *engine) throw(); + void setEngine(Engine *engine) ; // Length references @@ -239,19 +239,19 @@ public: @param id Command identifier as pair (code,request-indicator). */ - void setId(CommandId id) throw(anna::RuntimeException); + void setId(CommandId id) noexcept(false); /** Same as #setId but providing dictionary logical name for Avp searched */ - void setId(const char *name) throw(anna::RuntimeException); + void setId(const char *name) noexcept(false); /** Sets the command version. By default, messages initializes with value 1. @param version Version provided */ - void setVersion(U8 version) throw() { a_version = version; } + void setVersion(U8 version) { a_version = version; } /** Sets/unsets P bit activation. @@ -259,7 +259,7 @@ public: @param activate Activates/deactivates the bit. True by default. */ - void setProxiableBit(bool activate = true) throw() { if(activate) a_flags |= PBitMask; else a_flags &= (~PBitMask); } + void setProxiableBit(bool activate = true) { if(activate) a_flags |= PBitMask; else a_flags &= (~PBitMask); } /** Sets/unsets E bit activation. @@ -268,7 +268,7 @@ public: @param activate Activates/deactivates the bit. True by default. */ - void setErrorBit(bool activate = true) throw() { if(isRequest()) return; if(activate) a_flags |= EBitMask; else a_flags &= (~EBitMask); } + void setErrorBit(bool activate = true) { if(isRequest()) return; if(activate) a_flags |= EBitMask; else a_flags &= (~EBitMask); } /** Sets/unsets T bit activation. @@ -277,7 +277,7 @@ public: @param activate Activates/deactivates the bit. True by default. */ - void setPotentiallyReTransmittedMessageBit(bool activate = true) throw() { if(isAnswer()) return; if(activate) a_flags |= TBitMask; else a_flags &= (~TBitMask); } + void setPotentiallyReTransmittedMessageBit(bool activate = true) { if(isAnswer()) return; if(activate) a_flags |= TBitMask; else a_flags &= (~TBitMask); } /** Sets the message application id. @@ -294,19 +294,19 @@ public: @param aid Application-id. */ - void setApplicationId(U32 aid) throw(anna::RuntimeException); + void setApplicationId(U32 aid) noexcept(false); /** Sets the message hop-by-hop @param hbh Hop-by-hop identifier. */ - void setHopByHop(U32 hbh) throw() { a_hopByHop = hbh; } + void setHopByHop(U32 hbh) { a_hopByHop = hbh; } /** Sets the message end-to-end @param ete End-to-end identifier. */ - void setEndToEnd(U32 ete) throw() { a_endToEnd = ete; } + void setEndToEnd(U32 ete) { a_endToEnd = ete; } /** @@ -317,7 +317,7 @@ public: @warning Request provided must be a request, in other case method do nothing. */ - void setHeaderToAnswer(const Message &request) throw(anna::RuntimeException) { + void setHeaderToAnswer(const Message &request) noexcept(false) { if(!request.getId().second) return; a_engine = request.getEngine(); // we know this will be @@ -397,7 +397,7 @@ public: @warning Request provided must be a request, in other case method do nothing. */ - void setStandardToAnswer(const Message &request, const std::string &originHost, const std::string &originRealm, int resultCode = helpers::base::AVPVALUES__Result_Code::DIAMETER_SUCCESS) throw(anna::RuntimeException); + void setStandardToAnswer(const Message &request, const std::string &originHost, const std::string &originRealm, int resultCode = helpers::base::AVPVALUES__Result_Code::DIAMETER_SUCCESS) noexcept(false); /** @@ -435,7 +435,7 @@ public: @param rc Result-Code value. DIAMETER_SUCCESS by default. */ - void setResultCode(int rc = helpers::base::AVPVALUES__Result_Code::DIAMETER_SUCCESS) throw(anna::RuntimeException); + void setResultCode(int rc = helpers::base::AVPVALUES__Result_Code::DIAMETER_SUCCESS) noexcept(false); /** @@ -444,7 +444,7 @@ public: @return Result-Code value for answers, -1 for request and answers without Result-Code AVP inside */ - int getResultCode() const throw(); + int getResultCode() const ; /** @@ -454,13 +454,13 @@ public: @return Pointer to the new created avp. */ - Avp * addAvp(AvpId id) throw(anna::RuntimeException) { return Avp::addAvp(a_avps, a_insertionPositionForChilds, id, getEngine()); } + Avp * addAvp(AvpId id) noexcept(false) { return Avp::addAvp(a_avps, a_insertionPositionForChilds, id, getEngine()); } /** Same as #addAvp but providing dictionary logical name for Avp searched */ - Avp * addAvp(const char *name) throw(anna::RuntimeException); + Avp * addAvp(const char *name) noexcept(false); /** @@ -473,7 +473,7 @@ public: @return Pointer to the added avp (again). */ - Avp * addAvp(Avp * avp) throw(); + Avp * addAvp(Avp * avp) ; /** @@ -485,13 +485,13 @@ public: @return Returns true if something was removed. False in other cases (including i.e. when this message is empty). */ - bool removeAvp(AvpId id, int ocurrence = 1) throw(anna::RuntimeException) { return Avp::removeAvp(a_avps, (find_container&)a_finds, id, ocurrence, getEngine()); } + bool removeAvp(AvpId id, int ocurrence = 1) noexcept(false) { return Avp::removeAvp(a_avps, (find_container&)a_finds, id, ocurrence, getEngine()); } /** Same as #removeAvp but providing dictionary logical name for Avp searched */ - bool removeAvp(const char *name, int ocurrence = 1) throw(anna::RuntimeException); + bool removeAvp(const char *name, int ocurrence = 1) noexcept(false); /** @@ -505,7 +505,7 @@ public: * you don't initialize the engine to NULL, the second use of the message will keep the same engine deduced from the first * decoding/loading operation, which could be wrong if the second message belongs to a different application identifier. */ - virtual void clear(bool resetEngine = true) throw(anna::RuntimeException); + virtual void clear(bool resetEngine = true) noexcept(false); /** Decodes buffer provided over class content. If an error ocurred, decoding will stop launching exception (fatal error) or a warning trace (perhaps the achieved @@ -519,7 +519,7 @@ public: and automatically built regarding standard. If message analyzed realizes to be an answer, internal reference becomes NULL because no answer is built for answers. By default, automatic answer is not built. */ - void decode(const anna::DataBlock &db, Message *ptrAnswer = NULL) throw(anna::RuntimeException); + void decode(const anna::DataBlock &db, Message *ptrAnswer = NULL) noexcept(false); /** Fix childrens content regarding dictionary avp positions. @@ -527,7 +527,7 @@ public: This is useful to give flexibility to the application during message construction before encoding or representing the data. Is not recommended to fix a recently decoded message because possible validation problems will be hidden. */ - void fix() throw(); + void fix() ; /** Validates the message regarding dictionary rules like enumerated range, flags coherence, mandatory and fixed types, cardinality qualifiers, etc. @@ -536,14 +536,14 @@ public: and automatically built regarding standard. If message analyzed realizes to be an answer, internal reference becomes NULL because no answer is built for answers. By default, automatic answer is not built. */ - bool valid(Message *ptrAnswer = NULL) const throw(anna::RuntimeException); + bool valid(Message *ptrAnswer = NULL) const noexcept(false); /** Interpret xml data in order to dump over the class content. You could apply this multiple times over the same object. A basic cleanup is done respecting the codec engine. \param messageNode Message root node obtained from @functions::xmlFileTo */ - void fromXML(const anna::xml::Node* messageNode) throw(anna::RuntimeException); + void fromXML(const anna::xml::Node* messageNode) noexcept(false); /** * Interpret a xml file in order to create a diameter message @@ -554,7 +554,7 @@ public: * * @param xmlPathFile Complete path file to the xml document which represents the diameter message */ - void loadXMLFile(const std::string &xmlPathFile) throw(anna::RuntimeException); + void loadXMLFile(const std::string &xmlPathFile) noexcept(false); /** * Interpret a xml string in order to create a diameter message @@ -565,7 +565,7 @@ public: * * @param xmlString xml representation of the diameter message */ - void loadXMLString(const std::string &xmlString) throw(anna::RuntimeException); + void loadXMLString(const std::string &xmlString) noexcept(false); // getters @@ -573,59 +573,59 @@ public: /** Gets Message identifier as pair (code, request indicator). */ - const CommandId & getId() const throw() { return a_id; } + const CommandId & getId() const { return a_id; } /** Gets the command version. By default, messages initializes with value 1. @return version Message version */ - U8 getVersion() const throw() { return a_version; } + U8 getVersion() const { return a_version; } /** Gets Message request indicator. */ - bool isRequest() const throw() { return a_id.second; } + bool isRequest() const { return a_id.second; } /** Gets Message answer indicator. */ - bool isAnswer() const throw() { return !isRequest(); } + bool isAnswer() const { return !isRequest(); } /** Gets the message application id @return aid Application-id. */ - const U32 & getApplicationId() const throw() { return a_applicationId; } + const U32 & getApplicationId() const { return a_applicationId; } /** Gets the message hop-by-hop @return hbh Hop-by-hop identifier. */ - const U32 & getHopByHop() const throw() { return a_hopByHop; } + const U32 & getHopByHop() const { return a_hopByHop; } /** Gets the message end-to-end @return ete End-to-end identifier. */ - const U32 & getEndToEnd() const throw() { return a_endToEnd; } + const U32 & getEndToEnd() const { return a_endToEnd; } /** Gets stack command (dictionary command reference). */ - const anna::diameter::stack::Command *getStackCommand() const throw(anna::RuntimeException) { return getStackCommand(a_id); } + const anna::diameter::stack::Command *getStackCommand() const noexcept(false) { return getStackCommand(a_id); } /** Returns R bit activation state */ - bool requestBit() const throw() { return ((a_flags & RBitMask) != 0x00); } + bool requestBit() const { return ((a_flags & RBitMask) != 0x00); } /** Returns P bit activation state */ - bool proxiableBit() const throw() { return ((a_flags & PBitMask) != 0x00); } + bool proxiableBit() const { return ((a_flags & PBitMask) != 0x00); } /** Returns E bit activation state */ - bool errorBit() const throw() { return ((a_flags & EBitMask) != 0x00); } + bool errorBit() const { return ((a_flags & EBitMask) != 0x00); } /** Returns T bit activation state */ - bool potentiallyReTransmittedMessageBit() const throw() { return ((a_flags & TBitMask) != 0x00); } + bool potentiallyReTransmittedMessageBit() const { return ((a_flags & TBitMask) != 0x00); } /** @@ -656,11 +656,11 @@ public: access positions: i.e. -1 is the last ocurrence, -2 is the second to last (penultimate), etc. @param emode Excepcion mode handling: Ignore (no action is taken), Throw (excepcion when missing avp), Trace (trace situation as warning). */ - const Avp* getAvp(AvpId id, int ocurrence = 1, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) const throw(anna::RuntimeException) { + const Avp* getAvp(AvpId id, int ocurrence = 1, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) const noexcept(false) { return Avp::getAvp(a_avps, (find_container&)a_finds, id, ocurrence, getEngine(), emode); } - Avp* getAvp(AvpId id, int ocurrence = 1, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + Avp* getAvp(AvpId id, int ocurrence = 1, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { return const_cast(Avp::getAvp(a_avps, (find_container&)a_finds, id, ocurrence, getEngine(), emode)); } @@ -668,11 +668,11 @@ public: /** Same as #getAvp but providing dictionary logical name for Avp searched */ - const Avp* getAvp(const char *name, int ocurrence = 1, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) const throw(anna::RuntimeException) { + const Avp* getAvp(const char *name, int ocurrence = 1, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) const noexcept(false) { return _getAvp(name, ocurrence, emode); } - Avp* getAvp(const char *name, int ocurrence = 1, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) throw(anna::RuntimeException) { + Avp* getAvp(const char *name, int ocurrence = 1, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) { return const_cast(_getAvp(name, ocurrence, emode)); } @@ -683,19 +683,19 @@ public: @param id Avp identifier (pair code + vendor-id). */ - int countAvp(AvpId id) const throw() { return Avp::countAvp(a_avps, id); } + int countAvp(AvpId id) const { return Avp::countAvp(a_avps, id); } /** Same as #countAvp but providing dictionary logical name for Avp searched */ - int countAvp(const char *name) const throw(anna::RuntimeException); + int countAvp(const char *name) const noexcept(false); /** Counts the number of children @param id Avp identifier (pair code + vendor-id). */ - int countChilds() const throw() { return Avp::countChilds(a_avps); } + int countChilds() const { return Avp::countChilds(a_avps); } /** Encodes datablock with the class content. In case that validation is enabled (codec::Engine::ValidationMode) an exception will be launched @@ -704,14 +704,14 @@ public: @return DataBlock encoded (internal memory used) */ - const anna::DataBlock & code() throw(anna::RuntimeException); + const anna::DataBlock & code() noexcept(false); /** Class xml representation \param parent Parent XML node on which hold this instance information. \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 ; /** Class xml string representation @@ -720,7 +720,7 @@ public: \return XML string representation with relevant information for this instance. */ - std::string asXMLString(bool normalize = false) const throw(); + std::string asXMLString(bool normalize = false) const ; /** Comparison operator by mean serialization @@ -730,7 +730,7 @@ public: @return Comparison result */ - friend bool operator == (const Message & m1, const Message & m2) throw() { return (m1.asXMLString() == m2.asXMLString()); } + friend bool operator == (const Message & m1, const Message & m2) { return (m1.asXMLString() == m2.asXMLString()); } /** Matchs a regular expression (string pattern) regarding xml string serialization for this message. @@ -788,7 +788,7 @@ public: \return Returns the match result */ - bool isLike(const std::string &pattern) const throw(); + bool isLike(const std::string &pattern) const ; //friend class Engine; diff --git a/include/anna/diameter/codec/MessagesDeque.hpp b/include/anna/diameter/codec/MessagesDeque.hpp index 8a52d30..1c90dfe 100644 --- a/include/anna/diameter/codec/MessagesDeque.hpp +++ b/include/anna/diameter/codec/MessagesDeque.hpp @@ -38,15 +38,15 @@ typedef std::map < int /* message code */, codec_messages_deque* >::const_iterat MessagesDeque() { a_rotate = false; } ~MessagesDeque() { clear(); } - bool rotate() const throw() { return a_rotate; } - void rotate(bool r) throw() { a_rotate = r; } - - void clear () throw(); - void dump (const char *filenamePrefix = "programmed_message") throw(); - void addMessage(int code, anna::diameter::codec::Message *message) throw(); - anna::diameter::codec::Message* getMessage(int code) const throw(); - void nextMessage(int code) throw(); - std::string asString(const char *queueName) const throw(); + bool rotate() const { return a_rotate; } + void rotate(bool r) { a_rotate = r; } + + void clear () ; + void dump (const char *filenamePrefix = "programmed_message") ; + void addMessage(int code, anna::diameter::codec::Message *message) ; + anna::diameter::codec::Message* getMessage(int code) const ; + void nextMessage(int code) ; + std::string asString(const char *queueName) const ; }; } diff --git a/include/anna/diameter/codec/OamModule.hpp b/include/anna/diameter/codec/OamModule.hpp index 0ef5aa4..a67acff 100644 --- a/include/anna/diameter/codec/OamModule.hpp +++ b/include/anna/diameter/codec/OamModule.hpp @@ -161,8 +161,8 @@ public: anna_declare_enum(Counter); }; - /* virtual */std::string getDefaultInternalAlarmDescription(const int & alarmType) const throw() { return Alarm::asCString((Alarm::_v)alarmType); } - /* virtual */std::string getDefaultInternalCounterDescription(const int & counterType) const throw() { return Counter::asCString((Counter::_v)counterType); } + /* virtual */std::string getDefaultInternalAlarmDescription(const int & alarmType) const { return Alarm::asCString((Alarm::_v)alarmType); } + /* virtual */std::string getDefaultInternalCounterDescription(const int & counterType) const { return Counter::asCString((Counter::_v)counterType); } private: diff --git a/include/anna/diameter/codec/basetypes/Address.hpp b/include/anna/diameter/codec/basetypes/Address.hpp index c20c556..b6e7fb6 100644 --- a/include/anna/diameter/codec/basetypes/Address.hpp +++ b/include/anna/diameter/codec/basetypes/Address.hpp @@ -71,9 +71,9 @@ class Address : OctetString { // Only for derived diameter type: - void updateBasic() throw(anna::RuntimeException); + void updateBasic() noexcept(false); - void setPrintableString(const char * printableString) throw(anna::RuntimeException); + void setPrintableString(const char * printableString) noexcept(false); public: @@ -93,7 +93,7 @@ public: * * @param abb Abbreviate mode boolean indicator */ - void setAbbreviatePresentation(bool abb) throw() { a_abbreviatePresentation = abb; }; + void setAbbreviatePresentation(bool abb) { a_abbreviatePresentation = abb; }; @@ -104,21 +104,21 @@ public: * * @return IANA address */ - const iana_address_t& getIANAAddress() const throw() { return a_address; } + const iana_address_t& getIANAAddress() const { return a_address; } /** * Sets the IANA address * * @param address IANA address */ - void setIANAAddress(const iana_address_t& address) throw(anna::RuntimeException) { a_address = address; updateBasic(); } + void setIANAAddress(const iana_address_t& address) noexcept(false) { a_address = address; updateBasic(); } // ////////////////////////////////////////////////////////////////////////////////////////////////////// // gets - std::string getFormatName() const throw() { return "Address"; } + std::string getFormatName() const { return "Address"; } // helpers @@ -129,15 +129,15 @@ public: * * @return Natural/smart string representation for IANA address (only IPv4 and IPv6 are printable-supported) */ - std::string asPrintableString() throw(anna::RuntimeException); + std::string asPrintableString() noexcept(false); - std::string asString() throw(anna::RuntimeException) { return a_address.asString(); } + std::string asString() noexcept(false) { return a_address.asString(); } // sets - void decode(const char* buffer, const int size) throw(anna::RuntimeException); + void decode(const char* buffer, const int size) noexcept(false); // exports ///////////////////////////// diff --git a/include/anna/diameter/codec/basetypes/AvpData.hpp b/include/anna/diameter/codec/basetypes/AvpData.hpp index 95d3a13..39171bc 100644 --- a/include/anna/diameter/codec/basetypes/AvpData.hpp +++ b/include/anna/diameter/codec/basetypes/AvpData.hpp @@ -62,7 +62,7 @@ class AvpData { * @param buffer Raw data to be encoded * @param size Size of raw data to be encoded */ - virtual void codeBasic(char* buffer, int &size) throw(anna::RuntimeException) = 0; + virtual void codeBasic(char* buffer, int &size) noexcept(false) = 0; /** * Updates parent members from child ones to keep coherence between levels. @@ -71,7 +71,7 @@ class AvpData { * and will be called after child members modification (setters). * Basic types implementation will be empty. */ - virtual void updateBasic() throw(anna::RuntimeException) {;} + virtual void updateBasic() noexcept(false) {;} /** * Sets own members from natural/smart string representation @@ -79,7 +79,7 @@ class AvpData { * * @param printableString avp data in natural/smart string representation (human-readable) */ - virtual void setPrintableString(const char * printableString) throw(anna::RuntimeException) = 0; + virtual void setPrintableString(const char * printableString) noexcept(false) = 0; protected: @@ -93,7 +93,7 @@ protected: * * @return Printable string or if not printable */ - std::string assertPrintable(const char* buffer, const int size) const throw(anna::RuntimeException) { + std::string assertPrintable(const char* buffer, const int size) const noexcept(false) { std::string result; if(size == 0) return result; @@ -125,7 +125,7 @@ public: * * @return avp data format name */ - virtual std::string getFormatName() const throw() = 0; + virtual std::string getFormatName() const = 0; /** * Gets the avp data size based on basic container. @@ -133,7 +133,7 @@ public: * * @return avp data size */ - virtual int getSize() const throw() = 0; + virtual int getSize() const = 0; // helpers @@ -144,7 +144,7 @@ public: * @param buffer Raw data to be encoded * @param size Size of raw data to be encoded */ - void code(char* buffer, int &size) throw(anna::RuntimeException) { + void code(char* buffer, int &size) noexcept(false) { codeBasic(buffer, size); } @@ -156,7 +156,7 @@ public: * * @return Natural/smart string representation for avp data */ - virtual std::string asPrintableString() throw(anna::RuntimeException) { + virtual std::string asPrintableString() noexcept(false) { int size = getSize(); char buffer[size]; code(buffer, size); @@ -168,7 +168,7 @@ public: * * @return String with DataBlock representation */ - std::string asDataBlockString() throw(anna::RuntimeException) { + std::string asDataBlockString() noexcept(false) { int size = getSize(); char buffer[size]; code(buffer, size); @@ -183,7 +183,7 @@ public: * * @return String with class content */ - virtual std::string asString() throw(anna::RuntimeException) { + virtual std::string asString() noexcept(false) { return(asDataBlockString()); } @@ -193,7 +193,7 @@ public: * * @return Hexadecimal string representation for avp data */ - std::string asHexString() throw(anna::RuntimeException) { + std::string asHexString() noexcept(false) { int size = getSize(); char buffer[size]; code(buffer, size); @@ -214,14 +214,14 @@ public: * @param buffer Raw avp data * @param size Raw avp data length */ - virtual void decode(const char* buffer, const int size) throw(anna::RuntimeException) = 0; + virtual void decode(const char* buffer, const int size) noexcept(false) = 0; /** * Initializes members from natural/smart string representation * * @param printableString avp data in natural/smart string representation (human-readable) */ - void fromPrintableString(const char * printableString) throw(anna::RuntimeException) { + void fromPrintableString(const char * printableString) noexcept(false) { if(!printableString) { std::string ex = getFormatName(); ex += "::fromPrintableString | Null printableString provided"; @@ -237,7 +237,7 @@ public: * * @param hexString Raw avp data in hexadecimal string representation */ - void fromHexString(const std::string& hexString) throw(anna::RuntimeException) { + void fromHexString(const std::string& hexString) noexcept(false) { anna::DataBlock db(true); anna::functions::fromHexString(hexString, db); decode(db.getData(), db.getSize()); diff --git a/include/anna/diameter/codec/basetypes/DiameterIdentity.hpp b/include/anna/diameter/codec/basetypes/DiameterIdentity.hpp index 2e99075..9c7b780 100644 --- a/include/anna/diameter/codec/basetypes/DiameterIdentity.hpp +++ b/include/anna/diameter/codec/basetypes/DiameterIdentity.hpp @@ -32,7 +32,7 @@ class DiameterIdentity : public OctetString { // De momento no vamos a interpretar/decodificar este tipo de formato, puesto que aún no se ha necesitado a nivel de aplicación // Only for derived diameter type: - void updateBasic() throw(anna::RuntimeException); // assertPrintable + void updateBasic() noexcept(false); // assertPrintable public: @@ -40,7 +40,7 @@ public: // gets - std::string getFormatName() const throw() { return "DiameterIdentity"; } + std::string getFormatName() const { return "DiameterIdentity"; } // helpers @@ -48,7 +48,7 @@ public: // sets - void decode(const char* buffer, const int size) throw(anna::RuntimeException); + void decode(const char* buffer, const int size) noexcept(false); }; } diff --git a/include/anna/diameter/codec/basetypes/DiameterURI.hpp b/include/anna/diameter/codec/basetypes/DiameterURI.hpp index d13f86a..40ec960 100644 --- a/include/anna/diameter/codec/basetypes/DiameterURI.hpp +++ b/include/anna/diameter/codec/basetypes/DiameterURI.hpp @@ -32,7 +32,7 @@ class DiameterURI : public OctetString { // De momento no vamos a interpretar/decodificar este tipo de formato, puesto que aún no se ha necesitado a nivel de aplicación // Only for derived diameter type: - void updateBasic() throw(anna::RuntimeException); // assertPrintable + void updateBasic() noexcept(false); // assertPrintable public: @@ -40,7 +40,7 @@ public: // gets - std::string getFormatName() const throw() { return "DiameterURI"; } + std::string getFormatName() const { return "DiameterURI"; } // helpers @@ -48,7 +48,7 @@ public: // sets - void decode(const char* buffer, const int size) throw(anna::RuntimeException); + void decode(const char* buffer, const int size) noexcept(false); }; } diff --git a/include/anna/diameter/codec/basetypes/Enumerated.hpp b/include/anna/diameter/codec/basetypes/Enumerated.hpp index e00438c..fbf2cd8 100644 --- a/include/anna/diameter/codec/basetypes/Enumerated.hpp +++ b/include/anna/diameter/codec/basetypes/Enumerated.hpp @@ -37,7 +37,7 @@ public: // gets - std::string getFormatName() const throw() { return "Enumerated"; } + std::string getFormatName() const { return "Enumerated"; } // helpers diff --git a/include/anna/diameter/codec/basetypes/Float32.hpp b/include/anna/diameter/codec/basetypes/Float32.hpp index 923e29e..b51b5ba 100644 --- a/include/anna/diameter/codec/basetypes/Float32.hpp +++ b/include/anna/diameter/codec/basetypes/Float32.hpp @@ -36,8 +36,8 @@ class Float32 : public AvpData { // Mandatory for basic diameter type: - void codeBasic(char* buffer, int &size) throw(anna::RuntimeException); - void setPrintableString(const char * printableString) throw(anna::RuntimeException); + void codeBasic(char* buffer, int &size) noexcept(false); + void setPrintableString(const char * printableString) noexcept(false); public: @@ -50,38 +50,38 @@ public: * * @return Float32 value */ - const F32& getValue() const throw() { return a_value; } + const F32& getValue() const { return a_value; } /** * Sets the Float32 value * * @param value Float32 value */ - void setValue(const F32& value) throw() { a_value = value; } + void setValue(const F32& value) { a_value = value; } // ////////////////////////////////////////////////////////////////////////////////////////////////////// // gets - virtual std::string getFormatName() const throw() { return "Float32"; } - virtual int getSize() const throw() { return 4; } + virtual std::string getFormatName() const { return "Float32"; } + virtual int getSize() const { return 4; } // helpers - std::string asPrintableString() throw(anna::RuntimeException) { + std::string asPrintableString() noexcept(false) { return anna::functions::asString(a_value); } - std::string asString() throw(anna::RuntimeException) { + std::string asString() noexcept(false) { return asPrintableString(); } // sets - void decode(const char* buffer, const int size) throw(anna::RuntimeException); + void decode(const char* buffer, const int size) noexcept(false); }; } diff --git a/include/anna/diameter/codec/basetypes/Float64.hpp b/include/anna/diameter/codec/basetypes/Float64.hpp index b7a70be..53dd137 100644 --- a/include/anna/diameter/codec/basetypes/Float64.hpp +++ b/include/anna/diameter/codec/basetypes/Float64.hpp @@ -36,8 +36,8 @@ class Float64 : public AvpData { // Mandatory for basic diameter type: - void codeBasic(char* buffer, int &size) throw(anna::RuntimeException); - void setPrintableString(const char * printableString) throw(anna::RuntimeException); + void codeBasic(char* buffer, int &size) noexcept(false); + void setPrintableString(const char * printableString) noexcept(false); public: @@ -50,38 +50,38 @@ public: * * @return Float64 value */ - const F64& getValue() const throw() { return a_value; } + const F64& getValue() const { return a_value; } /** * Sets the Float64 value * * @param value Float64 value */ - void setValue(const F64& value) throw() { a_value = value; } + void setValue(const F64& value) { a_value = value; } // ////////////////////////////////////////////////////////////////////////////////////////////////////// // gets - virtual std::string getFormatName() const throw() { return "Float64"; } - virtual int getSize() const throw() { return 8; } + virtual std::string getFormatName() const { return "Float64"; } + virtual int getSize() const { return 8; } // helpers - std::string asPrintableString() throw(anna::RuntimeException) { + std::string asPrintableString() noexcept(false) { return anna::functions::asString(a_value); } - std::string asString() throw(anna::RuntimeException) { + std::string asString() noexcept(false) { return asPrintableString(); } // sets - void decode(const char* buffer, const int size) throw(anna::RuntimeException); + void decode(const char* buffer, const int size) noexcept(false); }; } diff --git a/include/anna/diameter/codec/basetypes/IPFilterRule.hpp b/include/anna/diameter/codec/basetypes/IPFilterRule.hpp index c6afcf6..edfaba3 100644 --- a/include/anna/diameter/codec/basetypes/IPFilterRule.hpp +++ b/include/anna/diameter/codec/basetypes/IPFilterRule.hpp @@ -32,7 +32,7 @@ class IPFilterRule : public OctetString { // De momento no vamos a interpretar/decodificar este tipo de formato, puesto que aún no se ha necesitado a nivel de aplicación // Only for derived diameter type: - void updateBasic() throw(anna::RuntimeException); // assertPrintable + void updateBasic() noexcept(false); // assertPrintable public: @@ -40,7 +40,7 @@ public: // gets - std::string getFormatName() const throw() { return "IPFilterRule"; } + std::string getFormatName() const { return "IPFilterRule"; } // helpers @@ -48,7 +48,7 @@ public: // sets - void decode(const char* buffer, const int size) throw(anna::RuntimeException); + void decode(const char* buffer, const int size) noexcept(false); }; } diff --git a/include/anna/diameter/codec/basetypes/Integer32.hpp b/include/anna/diameter/codec/basetypes/Integer32.hpp index cf7cd38..c0ffdac 100644 --- a/include/anna/diameter/codec/basetypes/Integer32.hpp +++ b/include/anna/diameter/codec/basetypes/Integer32.hpp @@ -35,8 +35,8 @@ class Integer32 : public AvpData { // Mandatory for basic diameter type: - void codeBasic(char* buffer, int &size) throw(anna::RuntimeException); - void setPrintableString(const char * printableString) throw(anna::RuntimeException); + void codeBasic(char* buffer, int &size) noexcept(false); + void setPrintableString(const char * printableString) noexcept(false); public: @@ -49,38 +49,38 @@ public: * * @return Integer32 value */ - const S32& getValue() const throw() { return a_value; } + const S32& getValue() const { return a_value; } /** * Sets the Integer32 value * * @param value Integer32 value */ - void setValue(const S32& value) throw() { a_value = value; } + void setValue(const S32& value) { a_value = value; } // ////////////////////////////////////////////////////////////////////////////////////////////////////// // gets - virtual std::string getFormatName() const throw() { return "Integer32"; } - virtual int getSize() const throw() { return 4; } + virtual std::string getFormatName() const { return "Integer32"; } + virtual int getSize() const { return 4; } // helpers - std::string asPrintableString() throw(anna::RuntimeException) { + std::string asPrintableString() noexcept(false) { return anna::functions::asString(a_value); } - std::string asString() throw(anna::RuntimeException) { + std::string asString() noexcept(false) { return asPrintableString(); } // sets - void decode(const char* buffer, const int size) throw(anna::RuntimeException); + void decode(const char* buffer, const int size) noexcept(false); }; } diff --git a/include/anna/diameter/codec/basetypes/Integer64.hpp b/include/anna/diameter/codec/basetypes/Integer64.hpp index 8f7c1fa..b3a5765 100644 --- a/include/anna/diameter/codec/basetypes/Integer64.hpp +++ b/include/anna/diameter/codec/basetypes/Integer64.hpp @@ -35,8 +35,8 @@ class Integer64 : public AvpData { // Mandatory for basic diameter type: - void codeBasic(char* buffer, int &size) throw(anna::RuntimeException); - void setPrintableString(const char * printableString) throw(anna::RuntimeException); + void codeBasic(char* buffer, int &size) noexcept(false); + void setPrintableString(const char * printableString) noexcept(false); public: @@ -49,38 +49,38 @@ public: * * @return Integer64 value */ - const S64& getValue() const throw() { return a_value; } + const S64& getValue() const { return a_value; } /** * Sets the Integer64 value * * @param value Integer64 value */ - void setValue(const S64& value) throw() { a_value = value; } + void setValue(const S64& value) { a_value = value; } // ////////////////////////////////////////////////////////////////////////////////////////////////////// // gets - virtual std::string getFormatName() const throw() { return "Integer64"; } - virtual int getSize() const throw() { return 8; } + virtual std::string getFormatName() const { return "Integer64"; } + virtual int getSize() const { return 8; } // helpers - std::string asPrintableString() throw(anna::RuntimeException) { + std::string asPrintableString() noexcept(false) { return anna::functions::asString((anna::S64)a_value); } - std::string asString() throw(anna::RuntimeException) { + std::string asString() noexcept(false) { return asPrintableString(); } // sets - void decode(const char* buffer, const int size) throw(anna::RuntimeException); + void decode(const char* buffer, const int size) noexcept(false); }; } diff --git a/include/anna/diameter/codec/basetypes/OctetString.hpp b/include/anna/diameter/codec/basetypes/OctetString.hpp index cd765e5..a21ddee 100644 --- a/include/anna/diameter/codec/basetypes/OctetString.hpp +++ b/include/anna/diameter/codec/basetypes/OctetString.hpp @@ -33,12 +33,12 @@ class OctetString : public AvpData { // Mandatory for basic diameter type: - void codeBasic(char* buffer, int &size) throw(anna::RuntimeException); - void setPrintableString(const char * printableString) throw(anna::RuntimeException); + void codeBasic(char* buffer, int &size) noexcept(false); + void setPrintableString(const char * printableString) noexcept(false); protected: - void assertPrintable() const throw(anna::RuntimeException); + void assertPrintable() const noexcept(false); public: @@ -51,29 +51,29 @@ public: * * @return OctetString value */ - const std::string& getValue() const throw() { return a_value; } + const std::string& getValue() const { return a_value; } /** * Sets the OctetString value * * @param value OctetString value */ - void setValue(const std::string& value) throw() { a_value = value; } + void setValue(const std::string& value) { a_value = value; } // ////////////////////////////////////////////////////////////////////////////////////////////////////// // gets // virtual for Unknown format container - virtual std::string getFormatName() const throw() { return "OctetString"; } - virtual int getSize() const throw() { return a_value.size(); } + virtual std::string getFormatName() const { return "OctetString"; } + virtual int getSize() const { return a_value.size(); } // helpers // sets - void decode(const char* buffer, const int size) throw(anna::RuntimeException); + void decode(const char* buffer, const int size) noexcept(false); }; } diff --git a/include/anna/diameter/codec/basetypes/QoSFilterRule.hpp b/include/anna/diameter/codec/basetypes/QoSFilterRule.hpp index c3a81ff..0894483 100644 --- a/include/anna/diameter/codec/basetypes/QoSFilterRule.hpp +++ b/include/anna/diameter/codec/basetypes/QoSFilterRule.hpp @@ -32,7 +32,7 @@ class QoSFilterRule : public OctetString { // De momento no vamos a interpretar/decodificar este tipo de formato, puesto que aún no se ha necesitado a nivel de aplicación // Only for derived diameter type: - void updateBasic() throw(anna::RuntimeException); // assertPrintable + void updateBasic() noexcept(false); // assertPrintable public: @@ -40,7 +40,7 @@ public: // gets - std::string getFormatName() const throw() { return "QoSFilterRule"; } + std::string getFormatName() const { return "QoSFilterRule"; } // helpers @@ -48,7 +48,7 @@ public: // sets - void decode(const char* buffer, const int size) throw(anna::RuntimeException); + void decode(const char* buffer, const int size) noexcept(false); }; } diff --git a/include/anna/diameter/codec/basetypes/Time.hpp b/include/anna/diameter/codec/basetypes/Time.hpp index 4bc13ba..17f7514 100644 --- a/include/anna/diameter/codec/basetypes/Time.hpp +++ b/include/anna/diameter/codec/basetypes/Time.hpp @@ -36,8 +36,8 @@ class Time : OctetString { // Only for derived diameter type: - void updateBasic() throw(anna::RuntimeException); - void setPrintableString(const char * printableString) throw(anna::RuntimeException); + void updateBasic() noexcept(false); + void setPrintableString(const char * printableString) noexcept(false); public: @@ -60,7 +60,7 @@ public: * @param v Timestamp type * @return Timestamp description */ - static const char* asText(const Timestamp::_v v) throw() { // anna_declare_enum is not safe, because labels don't have to match a sequence + static const char* asText(const Timestamp::_v v) { // anna_declare_enum is not safe, because labels don't have to match a sequence if(v == Timestamp::NTP) return "NTP"; else if(v == Timestamp::UNIX) return "UNIX"; @@ -75,7 +75,7 @@ public: * * @return timestamp value */ - U32 getTimestamp(Timestamp::_v timestampType = Timestamp::NTP) const throw(); + U32 getTimestamp(Timestamp::_v timestampType = Timestamp::NTP) const ; /** * Sets the timestamp value @@ -83,27 +83,27 @@ public: * @param timestamp timestamp value * @param timestampType Timestamp reference (NTP/Unix) */ - void setTimestamp(const U32& timestamp, Timestamp::_v timestampType = Timestamp::NTP) throw(); + void setTimestamp(const U32& timestamp, Timestamp::_v timestampType = Timestamp::NTP) ; // ////////////////////////////////////////////////////////////////////////////////////////////////////// // gets - std::string getFormatName() const throw() { return "Time"; } + std::string getFormatName() const { return "Time"; } // helpers - std::string asPrintableString() throw(anna::RuntimeException) { + std::string asPrintableString() noexcept(false) { return anna::functions::asString(a_ntpTimestamp); } - std::string asString() throw(anna::RuntimeException); + std::string asString() noexcept(false); // sets - void decode(const char* buffer, const int size) throw(anna::RuntimeException); + void decode(const char* buffer, const int size) noexcept(false); // exports ///////////////////////////// diff --git a/include/anna/diameter/codec/basetypes/UTF8String.hpp b/include/anna/diameter/codec/basetypes/UTF8String.hpp index 74a7b6a..1a757ca 100644 --- a/include/anna/diameter/codec/basetypes/UTF8String.hpp +++ b/include/anna/diameter/codec/basetypes/UTF8String.hpp @@ -32,7 +32,7 @@ class UTF8String : public OctetString { // De momento no vamos a interpretar/decodificar este tipo de formato, puesto que aún no se ha necesitado a nivel de aplicación // Only for derived diameter type: - void updateBasic() throw(anna::RuntimeException); // assertPrintable + void updateBasic() noexcept(false); // assertPrintable public: @@ -40,7 +40,7 @@ public: // gets - std::string getFormatName() const throw() { return "UTF8String"; } + std::string getFormatName() const { return "UTF8String"; } // helpers @@ -48,7 +48,7 @@ public: // sets - void decode(const char* buffer, const int size) throw(anna::RuntimeException); + void decode(const char* buffer, const int size) noexcept(false); }; } diff --git a/include/anna/diameter/codec/basetypes/Unknown.hpp b/include/anna/diameter/codec/basetypes/Unknown.hpp index c571f53..7ce77b8 100644 --- a/include/anna/diameter/codec/basetypes/Unknown.hpp +++ b/include/anna/diameter/codec/basetypes/Unknown.hpp @@ -33,7 +33,7 @@ public: virtual ~Unknown() {;} - std::string getFormatName() const throw() { return "Unknown"; } + std::string getFormatName() const { return "Unknown"; } }; } diff --git a/include/anna/diameter/codec/basetypes/Unsigned32.hpp b/include/anna/diameter/codec/basetypes/Unsigned32.hpp index e2eb417..05a793b 100644 --- a/include/anna/diameter/codec/basetypes/Unsigned32.hpp +++ b/include/anna/diameter/codec/basetypes/Unsigned32.hpp @@ -35,8 +35,8 @@ class Unsigned32 : public AvpData { // Mandatory for basic diameter type: - void codeBasic(char* buffer, int &size) throw(anna::RuntimeException); - void setPrintableString(const char * printableString) throw(anna::RuntimeException); + void codeBasic(char* buffer, int &size) noexcept(false); + void setPrintableString(const char * printableString) noexcept(false); public: @@ -49,38 +49,38 @@ public: * * @return Unsigned32 value */ - const U32& getValue() const throw() { return a_value; } + const U32& getValue() const { return a_value; } /** * Sets the Unsigned32 value * * @param value Unsigned32 value */ - void setValue(const U32& value) throw() { a_value = value; } + void setValue(const U32& value) { a_value = value; } // ////////////////////////////////////////////////////////////////////////////////////////////////////// // gets - virtual std::string getFormatName() const throw() { return "Unsigned32"; } - virtual int getSize() const throw() { return 4; } + virtual std::string getFormatName() const { return "Unsigned32"; } + virtual int getSize() const { return 4; } // helpers - std::string asPrintableString() throw(anna::RuntimeException) { + std::string asPrintableString() noexcept(false) { return anna::functions::asString(a_value); } - std::string asString() throw(anna::RuntimeException) { + std::string asString() noexcept(false) { return asPrintableString(); } // sets - void decode(const char* buffer, const int size) throw(anna::RuntimeException); + void decode(const char* buffer, const int size) noexcept(false); }; } diff --git a/include/anna/diameter/codec/basetypes/Unsigned64.hpp b/include/anna/diameter/codec/basetypes/Unsigned64.hpp index 02b050a..6ab0696 100644 --- a/include/anna/diameter/codec/basetypes/Unsigned64.hpp +++ b/include/anna/diameter/codec/basetypes/Unsigned64.hpp @@ -35,8 +35,8 @@ class Unsigned64 : public AvpData { // Mandatory for basic diameter type: - void codeBasic(char* buffer, int &size) throw(anna::RuntimeException); - void setPrintableString(const char * printableString) throw(anna::RuntimeException); + void codeBasic(char* buffer, int &size) noexcept(false); + void setPrintableString(const char * printableString) noexcept(false); public: @@ -49,38 +49,38 @@ public: * * @return Unsigned64 value */ - const U64& getValue() const throw() { return a_value; } + const U64& getValue() const { return a_value; } /** * Sets the Unsigned64 value * * @param value Unsigned64 value */ - void setValue(const U64& value) throw() { a_value = value; } + void setValue(const U64& value) { a_value = value; } // ////////////////////////////////////////////////////////////////////////////////////////////////////// // gets - virtual std::string getFormatName() const throw() { return "Unsigned64"; } - virtual int getSize() const throw() { return 8; } + virtual std::string getFormatName() const { return "Unsigned64"; } + virtual int getSize() const { return 8; } // helpers - std::string asPrintableString() throw(anna::RuntimeException) { + std::string asPrintableString() noexcept(false) { return anna::functions::asString((anna::U64)a_value); } - std::string asString() throw(anna::RuntimeException) { + std::string asString() noexcept(false) { return asPrintableString(); } // sets - void decode(const char* buffer, const int size) throw(anna::RuntimeException); + void decode(const char* buffer, const int size) noexcept(false); }; } diff --git a/include/anna/diameter/codec/functions.hpp b/include/anna/diameter/codec/functions.hpp index 43dfa92..cd6b4bf 100644 --- a/include/anna/diameter/codec/functions.hpp +++ b/include/anna/diameter/codec/functions.hpp @@ -124,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; @@ -136,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)); } @@ -166,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. @@ -177,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 @@ -189,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 @@ -200,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. @@ -212,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. @@ -223,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); /** @@ -304,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. @@ -318,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::DocumentMemory &xmlDocument, const std::string &xmlString) throw(anna::RuntimeException); + static void messageXmlDocumentFromXmlString(anna::xml::DocumentMemory &xmlDocument, const std::string &xmlString) noexcept(false); }; diff --git a/include/anna/diameter/codec/tme/Avp.hpp b/include/anna/diameter/codec/tme/Avp.hpp index 0b25df7..971e76c 100644 --- a/include/anna/diameter/codec/tme/Avp.hpp +++ b/include/anna/diameter/codec/tme/Avp.hpp @@ -63,19 +63,19 @@ class Avp : public anna::diameter::codec::Avp { ISDNAddress *a_ISDNAddress; Unsigned16 *a_Unsigned16; - virtual void initializeByFormat() throw(); - virtual U24 getLengthByFormat(const anna::diameter::stack::Format *stackFormat) const throw(); - virtual std::string getXMLdataByFormat(bool & isHex, const anna::diameter::stack::Format *stackFormat) const throw(); - virtual void fromXMLByFormat(const anna::xml::Attribute* data, const anna::xml::Attribute* hexData, const anna::diameter::stack::Format *stackFormat) throw(anna::RuntimeException); - virtual void codeByFormat(char* dataPart, const anna::diameter::stack::Format *stackFormat) const throw(anna::RuntimeException); - virtual void decodeDataPartByFormat(const char * buffer, int size, const anna::diameter::stack::Format *stackFormat) throw(anna::RuntimeException); - virtual void allocationByFormat(const anna::diameter::stack::Format *stackFormat) throw(); - virtual void clearByFormat() throw(); + virtual void initializeByFormat() ; + virtual U24 getLengthByFormat(const anna::diameter::stack::Format *stackFormat) const ; + virtual std::string getXMLdataByFormat(bool & isHex, const anna::diameter::stack::Format *stackFormat) const ; + virtual void fromXMLByFormat(const anna::xml::Attribute* data, const anna::xml::Attribute* hexData, const anna::diameter::stack::Format *stackFormat) noexcept(false); + virtual void codeByFormat(char* dataPart, const anna::diameter::stack::Format *stackFormat) const noexcept(false); + virtual void decodeDataPartByFormat(const char * buffer, int size, const anna::diameter::stack::Format *stackFormat) noexcept(false); + virtual void allocationByFormat(const anna::diameter::stack::Format *stackFormat) ; + virtual void clearByFormat() ; //protected: // /** Codec Engine getter: avoids have to create base engine when using its child */ -// virtual anna::diameter::codec::Engine * getEngine() const throw(anna::RuntimeException); +// virtual anna::diameter::codec::Engine * getEngine() const noexcept(false); public: @@ -101,19 +101,19 @@ public: /** Access content for ISDNNumber Avp in order to set data part */ - ISDNNumber * getISDNNumber() throw(anna::RuntimeException) { assertFormat("ISDNNumber"); return a_ISDNNumber; } + ISDNNumber * getISDNNumber() noexcept(false) { assertFormat("ISDNNumber"); return a_ISDNNumber; } /** Access content for ISDNAddress Avp in order to set data part */ - ISDNAddress * getISDNAddress() throw(anna::RuntimeException) { assertFormat("ISDNAddress"); return a_ISDNAddress; } + ISDNAddress * getISDNAddress() noexcept(false) { assertFormat("ISDNAddress"); return a_ISDNAddress; } /** Access content for Unsigned16 Avp in order to set data part */ - Unsigned16 * getUnsigned16() throw(anna::RuntimeException) { assertFormat("Unsigned16"); return a_Unsigned16; } + Unsigned16 * getUnsigned16() noexcept(false) { assertFormat("Unsigned16"); return a_Unsigned16; } /** Access content for ISDNNumber Avp */ - const ISDNNumber * getISDNNumber() const throw(anna::RuntimeException) { assertFormat("ISDNNumber"); return a_ISDNNumber; } + const ISDNNumber * getISDNNumber() const noexcept(false) { assertFormat("ISDNNumber"); return a_ISDNNumber; } /** Access content for ISDNAddress Avp */ - const ISDNAddress * getISDNAddress() const throw(anna::RuntimeException) { assertFormat("ISDNAddress"); return a_ISDNAddress; } + const ISDNAddress * getISDNAddress() const noexcept(false) { assertFormat("ISDNAddress"); return a_ISDNAddress; } /** Access content for Unsigned16 Avp */ - const Unsigned16 * getUnsigned16() const throw(anna::RuntimeException) { assertFormat("Unsigned16"); return a_Unsigned16; } + const Unsigned16 * getUnsigned16() const noexcept(false) { assertFormat("Unsigned16"); return a_Unsigned16; } diff --git a/include/anna/diameter/codec/tme/Engine.hpp__ b/include/anna/diameter/codec/tme/Engine.hpp__ index 92fbc31..252b768 100644 --- a/include/anna/diameter/codec/tme/Engine.hpp__ +++ b/include/anna/diameter/codec/tme/Engine.hpp__ @@ -51,7 +51,7 @@ public: */ Engine(const char *className = "anna::diameter::codec::tme::Engine") : EngineImpl(className) {;} - void releaseAvp(anna::diameter::codec::Avp* avp) throw() { + void releaseAvp(anna::diameter::codec::Avp* avp) { if(avp == NULL) return; Avp* aux = static_cast (avp); @@ -59,7 +59,7 @@ public: a_avps.release(aux); } - void releaseMessage(anna::diameter::codec::Message* message) throw() { + void releaseMessage(anna::diameter::codec::Message* message) { if(message == NULL) return; Message* aux = static_cast (message); @@ -72,8 +72,8 @@ protected: anna::Recycler a_avps; anna::Recycler a_messages; - anna::diameter::codec::Avp* allocateAvp() throw() { return a_avps.create(); } - anna::diameter::codec::Message* allocateMessage() throw() { return a_messages.create(); } + anna::diameter::codec::Avp* allocateAvp() { return a_avps.create(); } + anna::diameter::codec::Message* allocateMessage() { return a_messages.create(); } friend class Message; friend class Avp; diff --git a/include/anna/diameter/codec/tme/Message.hpp b/include/anna/diameter/codec/tme/Message.hpp index 500b252..73a4f3a 100644 --- a/include/anna/diameter/codec/tme/Message.hpp +++ b/include/anna/diameter/codec/tme/Message.hpp @@ -40,13 +40,13 @@ class Message : public anna::diameter::codec::Message { protected: // /** Codec Engine getter: avoids have to create base engine when using its child */ -// virtual anna::diameter::codec::Engine * getEngine() const throw(anna::RuntimeException); +// virtual anna::diameter::codec::Engine * getEngine() const noexcept(false); /** * Initializes Message class information. * Any reimplementation must first invoke base class method. */ - virtual void initialize() throw(); + virtual void initialize() ; public: diff --git a/include/anna/diameter/functions.hpp b/include/anna/diameter/functions.hpp index 1445847..4147a05 100644 --- a/include/anna/diameter/functions.hpp +++ b/include/anna/diameter/functions.hpp @@ -36,7 +36,7 @@ struct functions { * '(,)' * */ - static std::string avpIdAsPairString(const AvpId & avpId) throw(); + static std::string avpIdAsPairString(const AvpId & avpId) ; /** @@ -46,7 +46,7 @@ struct functions { * '(,request|answer)' * */ - static std::string commandIdAsPairString(const CommandId & commandId) throw(); + static std::string commandIdAsPairString(const CommandId & commandId) ; }; diff --git a/include/anna/diameter/helpers/base/functions.hpp b/include/anna/diameter/helpers/base/functions.hpp index c500b97..db2499b 100644 --- a/include/anna/diameter/helpers/base/functions.hpp +++ b/include/anna/diameter/helpers/base/functions.hpp @@ -48,7 +48,7 @@ struct functions { * * @return Result-Code value */ - static U32 getResultCode(const anna::DataBlock &) throw(anna::RuntimeException); + static U32 getResultCode(const anna::DataBlock &) noexcept(false); /** * Gets the tokenized by ';' Session-Id contents defined as ';;[;]': @@ -59,7 +59,7 @@ struct functions { * @param low Low 64-bit-sequence part * @param optional Empty string when missing */ - static void decodeSessionId(const std::string &sessionId, std::string &diameterIdentity, U32 &high, U32 &low, std::string &optional) throw(anna::RuntimeException); + static void decodeSessionId(const std::string &sessionId, std::string &diameterIdentity, U32 &high, U32 &low, std::string &optional) noexcept(false); /** * Gets the fixed Session-Id AVP (UTF8String) from datablock provided. @@ -73,7 +73,7 @@ struct functions { * * @return Session-Id */ - static std::string getSessionId(const anna::DataBlock &db, std::string &diameterIdentity, U32 &high, U32 &low, std::string &optional) throw(anna::RuntimeException); + static std::string getSessionId(const anna::DataBlock &db, std::string &diameterIdentity, U32 &high, U32 &low, std::string &optional) noexcept(false); /** @@ -83,7 +83,7 @@ struct functions { * * @return Session-Id */ - static std::string getSessionId(const anna::DataBlock &db) throw(anna::RuntimeException) { + static std::string getSessionId(const anna::DataBlock &db) noexcept(false) { std::string dummy1, dummy4; U32 dummy2, dummy3; return (getSessionId(db, dummy1, dummy2, dummy3, dummy4)); @@ -97,7 +97,7 @@ struct functions { * * @return Origin-Host */ - static std::string getOriginHost(const anna::DataBlock &db) throw(anna::RuntimeException); + static std::string getOriginHost(const anna::DataBlock &db) noexcept(false); }; diff --git a/include/anna/diameter/helpers/dcca/functions.hpp b/include/anna/diameter/helpers/dcca/functions.hpp index e1841e7..f5f790d 100644 --- a/include/anna/diameter/helpers/dcca/functions.hpp +++ b/include/anna/diameter/helpers/dcca/functions.hpp @@ -73,7 +73,7 @@ struct functions { * @return Subscription-Id-Data for type provided. Empty string when not found. */ static std::string getSubscriptionIdData(const anna::DataBlock &db, - int subscriptionIdType = AVPVALUES__Subscription_Id_Type::END_USER_E164) throw(anna::RuntimeException); + int subscriptionIdType = AVPVALUES__Subscription_Id_Type::END_USER_E164) noexcept(false); /** @@ -84,7 +84,7 @@ struct functions { * * @return Service-Context-Id */ - static std::string getServiceContextId(const anna::DataBlock &db, ChargingContext::_v &chargingContext) throw(anna::RuntimeException); + static std::string getServiceContextId(const anna::DataBlock &db, ChargingContext::_v &chargingContext) noexcept(false); /** * Service-Context-Id from datablock provided. @@ -93,7 +93,7 @@ struct functions { * * @return Service-Context-Id */ - static std::string getServiceContextId(const anna::DataBlock &db) throw(anna::RuntimeException) { + static std::string getServiceContextId(const anna::DataBlock &db) noexcept(false) { ChargingContext::_v dummy; return getServiceContextId(db, dummy); } diff --git a/include/anna/diameter/helpers/ericsson/functions.hpp b/include/anna/diameter/helpers/ericsson/functions.hpp index d00483c..37aa299 100644 --- a/include/anna/diameter/helpers/ericsson/functions.hpp +++ b/include/anna/diameter/helpers/ericsson/functions.hpp @@ -43,7 +43,7 @@ struct functions { * Returns empty string when not found. */ static std::string getSCAPSubscriptionIdData(const anna::DataBlock &, - int scapSubscriptionIdType = AVPVALUES__SCAP_Subscription_Id_Type::END_USER_MSISDN) throw(anna::RuntimeException); + int scapSubscriptionIdType = AVPVALUES__SCAP_Subscription_Id_Type::END_USER_MSISDN) noexcept(false); }; diff --git a/include/anna/diameter/helpers/tid/Format.hpp b/include/anna/diameter/helpers/tid/Format.hpp index ca41ae5..b28499d 100644 --- a/include/anna/diameter/helpers/tid/Format.hpp +++ b/include/anna/diameter/helpers/tid/Format.hpp @@ -43,7 +43,7 @@ struct Format { * @param v Format type * @return Format description */ - static const char* asText(const Format::_v v) throw(anna::RuntimeException) { + static const char* asText(const Format::_v v) noexcept(false) { return asCString(v); } }; diff --git a/include/anna/diameter/helpers/tid/codectypes/Date.hpp b/include/anna/diameter/helpers/tid/codectypes/Date.hpp index 714d3b5..45e9a56 100644 --- a/include/anna/diameter/helpers/tid/codectypes/Date.hpp +++ b/include/anna/diameter/helpers/tid/codectypes/Date.hpp @@ -39,7 +39,7 @@ public: // gets - std::string getFormatName() const throw() { return "Date"; } + std::string getFormatName() const { return "Date"; } // helpers diff --git a/include/anna/diameter/helpers/tme/Format.hpp b/include/anna/diameter/helpers/tme/Format.hpp index 223f918..3352976 100644 --- a/include/anna/diameter/helpers/tme/Format.hpp +++ b/include/anna/diameter/helpers/tme/Format.hpp @@ -45,7 +45,7 @@ struct Format { * @param v Format type * @return Format description */ - static const char* asText(const Format::_v v) throw(anna::RuntimeException) { + static const char* asText(const Format::_v v) noexcept(false) { return asCString(v); } }; diff --git a/include/anna/diameter/helpers/tme/codectypes/ISDNAddress.hpp b/include/anna/diameter/helpers/tme/codectypes/ISDNAddress.hpp index fde7ebf..f7af6d1 100644 --- a/include/anna/diameter/helpers/tme/codectypes/ISDNAddress.hpp +++ b/include/anna/diameter/helpers/tme/codectypes/ISDNAddress.hpp @@ -37,7 +37,7 @@ class ISDNAddress : public codec::basetypes::OctetString { isup_number_t a_isupNumber; // Only for derived diameter type: - void updateBasic() throw(anna::RuntimeException); + void updateBasic() noexcept(false); public: @@ -48,32 +48,32 @@ public: * * @return Q763 ISUP Number */ - const isup_number_t& getIsupNumber() const throw() { return a_isupNumber; } + const isup_number_t& getIsupNumber() const { return a_isupNumber; } /** * Sets the Q763 ISUP Number * * @param isupNumber Q763 ISUP Number */ - void setIsupNumber(const isup_number_t& isupNumber) throw() { a_isupNumber = isupNumber; updateBasic(); } + void setIsupNumber(const isup_number_t& isupNumber) { a_isupNumber = isupNumber; updateBasic(); } // ////////////////////////////////////////////////////////////////////////////////////////////////////// // gets - std::string getFormatName() const throw() { return "ISDNAddress"; } + std::string getFormatName() const { return "ISDNAddress"; } // helpers - std::string asString() throw(anna::RuntimeException) { + std::string asString() noexcept(false) { return a_isupNumber.asString(true /* called party number */); } // sets - void decode(const char* buffer, const int size) throw(anna::RuntimeException); + void decode(const char* buffer, const int size) noexcept(false); // exports ///////////////////////////// diff --git a/include/anna/diameter/helpers/tme/codectypes/ISDNNumber.hpp b/include/anna/diameter/helpers/tme/codectypes/ISDNNumber.hpp index 0921e8d..2daf26b 100644 --- a/include/anna/diameter/helpers/tme/codectypes/ISDNNumber.hpp +++ b/include/anna/diameter/helpers/tme/codectypes/ISDNNumber.hpp @@ -39,7 +39,7 @@ class ISDNNumber : public codec::basetypes::OctetString { isup_number_t a_isupNumber; // Only for derived diameter type: - void updateBasic() throw(anna::RuntimeException); + void updateBasic() noexcept(false); public: @@ -50,31 +50,31 @@ public: * * @return Q763 ISUP Number */ - const isup_number_t& getIsupNumber() const throw() { return a_isupNumber; } + const isup_number_t& getIsupNumber() const { return a_isupNumber; } /** * Sets the Q763 ISUP Number * * @param isupNumber Q763 ISUP Number */ - void setIsupNumber(const isup_number_t& isupNumber) throw() { a_isupNumber = isupNumber; updateBasic(); } + void setIsupNumber(const isup_number_t& isupNumber) { a_isupNumber = isupNumber; updateBasic(); } // ////////////////////////////////////////////////////////////////////////////////////////////////////// // gets - std::string getFormatName() const throw() { return "ISDNNumber"; } + std::string getFormatName() const { return "ISDNNumber"; } // helpers - std::string asString() throw(anna::RuntimeException) { + std::string asString() noexcept(false) { return a_isupNumber.asString(false /* calling party number */); } // sets - void decode(const char* buffer, const int size) throw(anna::RuntimeException); + void decode(const char* buffer, const int size) noexcept(false); // exports ///////////////////////////// diff --git a/include/anna/diameter/helpers/tme/codectypes/Unsigned16.hpp b/include/anna/diameter/helpers/tme/codectypes/Unsigned16.hpp index f899889..7b54fda 100644 --- a/include/anna/diameter/helpers/tme/codectypes/Unsigned16.hpp +++ b/include/anna/diameter/helpers/tme/codectypes/Unsigned16.hpp @@ -39,8 +39,8 @@ class Unsigned16 : codec::basetypes::OctetString { // Only for derived diameter type: - void updateBasic() throw(anna::RuntimeException); - void setPrintableString(const char * printableString) throw(anna::RuntimeException); + void updateBasic() noexcept(false); + void setPrintableString(const char * printableString) noexcept(false); public: @@ -52,37 +52,37 @@ public: * * @return Unsigned16 value */ - const U16& getValue() const throw() { return a_value; } + const U16& getValue() const { return a_value; } /** * Sets the Unsigned16 value * * @param value Unsigned16 value */ - void setValue(const U16& value) throw() { a_value = value; updateBasic(); } + void setValue(const U16& value) { a_value = value; updateBasic(); } // ////////////////////////////////////////////////////////////////////////////////////////////////////// // gets - std::string getFormatName() const throw() { return "Unsigned16"; } + std::string getFormatName() const { return "Unsigned16"; } // helpers - std::string asPrintableString() throw(anna::RuntimeException) { + std::string asPrintableString() noexcept(false) { return anna::functions::asString(a_value); } - std::string asString() throw(anna::RuntimeException) { + std::string asString() noexcept(false) { return asPrintableString(); } // sets - void decode(const char* buffer, const int size) throw(anna::RuntimeException); + void decode(const char* buffer, const int size) noexcept(false); // exports ///////////////////////////// diff --git a/include/anna/diameter/internal/sccs.hpp b/include/anna/diameter/internal/sccs.hpp index 871012e..107ac32 100644 --- a/include/anna/diameter/internal/sccs.hpp +++ b/include/anna/diameter/internal/sccs.hpp @@ -15,7 +15,7 @@ namespace diameter { class sccs { public: - static void activate() throw(); + static void activate() ; }; } diff --git a/include/anna/diameter/stack/Avp.hpp b/include/anna/diameter/stack/Avp.hpp index eafb99a..edd4e91 100644 --- a/include/anna/diameter/stack/Avp.hpp +++ b/include/anna/diameter/stack/Avp.hpp @@ -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::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); }; diff --git a/include/anna/diameter/stack/AvpRule.hpp b/include/anna/diameter/stack/AvpRule.hpp index ead1dc6..aeef91c 100644 --- a/include/anna/diameter/stack/AvpRule.hpp +++ b/include/anna/diameter/stack/AvpRule.hpp @@ -67,7 +67,7 @@ public: * @param v Presence type * @return Presence description */ - static const char* asText(const Presence::_v v) throw(anna::RuntimeException) { + static const char* asText(const Presence::_v v) noexcept(false) { return asCString(v); } }; @@ -79,7 +79,7 @@ private: Presence::_v a_presence; std::string a_qual; - void _initialize(const Dictionary *d) throw() { + void _initialize(const Dictionary *d) { a_dictionary = d; a_presence = Presence::None; a_qual = ""; @@ -93,29 +93,29 @@ public: // get - std::string getAvpName(void) const throw(); - const Presence::_v & getPresence(void) const throw() { return a_presence; } - const std::string & getQual(void) const throw() { return a_qual; } + std::string getAvpName(void) const ; + const Presence::_v & getPresence(void) const { return a_presence; } + const std::string & getQual(void) const { return a_qual; } // helpers - AvpId getId(void) const throw() { return a_avpId; } - bool isAny(void) const throw(); // generic Avp - bool isFixed(void) const throw() { return (a_presence == Presence::Fixed); } - bool isMandatory(void) const throw() { return (a_presence == Presence::Mandatory); } - bool isOptional(void) const throw() { return (a_presence == Presence::Optional); } - int getQualMin(void) const throw(); - int getQualMax(void) const throw(); // -1 is infinite + AvpId getId(void) const { return a_avpId; } + bool isAny(void) const ; // generic Avp + bool isFixed(void) const { return (a_presence == Presence::Fixed); } + bool isMandatory(void) const { return (a_presence == Presence::Mandatory); } + bool isOptional(void) const { return (a_presence == Presence::Optional); } + int getQualMin(void) const ; + int getQualMax(void) const ; // -1 is infinite - std::string asString(bool showPair = true) const throw(); - anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); + std::string asString(bool showPair = true) const ; + anna::xml::Node* asXML(anna::xml::Node* parent) const ; // operators // set - void initialize(const Dictionary *d = NULL) throw() { _initialize(d); } - void setAvpId(const AvpId & ai) throw() { a_avpId = ai; } - void setPresence(const Presence::_v & p) throw() { a_presence = p; } - void setQual(const std::string & q) throw(anna::RuntimeException); + void initialize(const Dictionary *d = NULL) { _initialize(d); } + void setAvpId(const AvpId & ai) { a_avpId = ai; } + void setPresence(const Presence::_v & p) { a_presence = p; } + void setQual(const std::string & q) noexcept(false); }; diff --git a/include/anna/diameter/stack/Command.hpp b/include/anna/diameter/stack/Command.hpp index f5226fa..737537e 100644 --- a/include/anna/diameter/stack/Command.hpp +++ b/include/anna/diameter/stack/Command.hpp @@ -66,13 +66,13 @@ private: bool a_allowFixedRule; int a_avprulePosition; - void _initializeRules() throw() { + void _initializeRules() { a_avprules.clear(); a_allowFixedRule = true; a_avprulePosition = 0; } - void _initialize(const Dictionary *d) throw() { + void _initialize(const Dictionary *d) { a_dictionary = d; _initializeRules(); } @@ -84,41 +84,41 @@ public: // get - const CommandId & getId(void) const throw() { return a_id; } - const std::string & getName(void) const throw() { return a_name; } + const CommandId & getId(void) const { return a_id; } + const std::string & getName(void) const { return a_name; } // 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(); } // helpers - bool isEmpty(void) const throw() { return (!a_avprules.size()); } - bool isRequest(void) const throw() { return (a_id.second); } - bool isAnswer(void) const throw() { return (!a_id.second); } - bool isChild(const AvpId & avp) const throw(); + bool isEmpty(void) const { return (!a_avprules.size()); } + bool isRequest(void) const { return (a_id.second); } + bool isAnswer(void) const { return (!a_id.second); } + bool isChild(const AvpId & avp) 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 initialize(const Dictionary *d = NULL) throw() { _initialize(d); } - void setCode(const U24 & c) throw(anna::RuntimeException) { + void initialize(const Dictionary *d = NULL) { _initialize(d); } + void setCode(const U24 & c) noexcept(false) { a_id.first = c; } - void setRequest(bool r = true) throw() { a_id.second = r; } - void setAnswer(bool a = true) throw() { a_id.second = a; } - void setName(const std::string & n) throw(anna::RuntimeException) { + void setRequest(bool r = true) { a_id.second = r; } + void setAnswer(bool a = true) { a_id.second = a; } + void setName(const std::string & n) noexcept(false) { if(n == "") throw anna::RuntimeException("Empty command-name string not allowed", ANNA_FILE_LOCATION); a_name = n; } - void addAvpRule(const AvpRule & avpRule) throw(anna::RuntimeException); + void addAvpRule(const AvpRule & avpRule) noexcept(false); }; diff --git a/include/anna/diameter/stack/Dictionary.hpp b/include/anna/diameter/stack/Dictionary.hpp index 33f8de6..cbb8ee2 100644 --- a/include/anna/diameter/stack/Dictionary.hpp +++ b/include/anna/diameter/stack/Dictionary.hpp @@ -112,14 +112,14 @@ private: // init - void initialize() throw(); + void initialize() ; // check & addings - //void checkUniqueIdentifiers(const anna::xml::Node *rootNode) const throw(anna::RuntimeException); - void extractFormats(const anna::xml::Node *rootNode) throw(anna::RuntimeException); - void extractVendors(const anna::xml::Node *rootNode) throw(anna::RuntimeException); - void extractAvps(const anna::xml::Node *rootNode) throw(anna::RuntimeException); - void extractCommands(const anna::xml::Node *rootNode) throw(anna::RuntimeException); + //void checkUniqueIdentifiers(const anna::xml::Node *rootNode) const noexcept(false); + void extractFormats(const anna::xml::Node *rootNode) noexcept(false); + void extractVendors(const anna::xml::Node *rootNode) noexcept(false); + void extractAvps(const anna::xml::Node *rootNode) noexcept(false); + void extractCommands(const anna::xml::Node *rootNode) noexcept(false); public: @@ -127,38 +127,38 @@ public: ~Dictionary() {}; // get - const std::string & getName() const throw() { return a_name; } - const Format * getFormat(const std::string & formatName) const throw(); - const Vendor * getVendor(S32 vendorId) const throw(); - const Vendor * getVendor(const std::string & vendorName) const throw(); - const Avp * getAvp(const AvpId & avpId) const throw(); - const Avp * getAvp(const std::string & avpName) const throw(); - const Command * getCommand(const CommandId & commandId) const throw(); - const Command * getCommand(const std::string & commandName) const throw(); + const std::string & getName() const { return a_name; } + const Format * getFormat(const std::string & formatName) const ; + const Vendor * getVendor(S32 vendorId) const ; + const Vendor * getVendor(const std::string & vendorName) const ; + const Avp * getAvp(const AvpId & avpId) const ; + const Avp * getAvp(const std::string & avpName) const ; + const Command * getCommand(const CommandId & commandId) const ; + const Command * getCommand(const std::string & commandName) const ; // set - void allowUpdates(bool allow = true) throw() { a_allowUpdates = allow; } - void addFormat(const Format &, bool reserved = false) throw(anna::RuntimeException); - void addVendor(const Vendor &) throw(anna::RuntimeException); - void addAvp(const Avp &) throw(anna::RuntimeException); - void addCommand(const Command &) throw(anna::RuntimeException); + void allowUpdates(bool allow = true) { a_allowUpdates = allow; } + void addFormat(const Format &, bool reserved = false) noexcept(false); + void addVendor(const Vendor &) noexcept(false); + void addAvp(const Avp &) noexcept(false); + void addCommand(const Command &) noexcept(false); // containers - const_format_iterator format_begin() const throw() { return a_formats.begin(); } - const_format_iterator format_end() const throw() { return a_formats.end(); } - int format_size() const throw() { return a_formats.size(); } + const_format_iterator format_begin() const { return a_formats.begin(); } + const_format_iterator format_end() const { return a_formats.end(); } + int format_size() const { return a_formats.size(); } - const_vendor_iterator vendor_begin() const throw() { return a_vendors.begin(); } - const_vendor_iterator vendor_end() const throw() { return a_vendors.end(); } - int vendor_size() const throw() { return a_vendors.size(); } + const_vendor_iterator vendor_begin() const { return a_vendors.begin(); } + const_vendor_iterator vendor_end() const { return a_vendors.end(); } + int vendor_size() const { return a_vendors.size(); } - const_avp_iterator avp_begin() const throw() { return a_avps.begin(); } - const_avp_iterator avp_end() const throw() { return a_avps.end(); } - int avp_size() const throw() { return a_avps.size(); } + const_avp_iterator avp_begin() const { return a_avps.begin(); } + const_avp_iterator avp_end() const { return a_avps.end(); } + int avp_size() const { return a_avps.size(); } - const_command_iterator command_begin() const throw() { return a_commands.begin(); } - const_command_iterator command_end() const throw() { return a_commands.end(); } - int command_size() const throw() { return a_commands.size(); } + const_command_iterator command_begin() const { return a_commands.begin(); } + const_command_iterator command_end() const { return a_commands.end(); } + int command_size() const { return a_commands.size(); } // helpers @@ -167,20 +167,20 @@ public: * * @return String with class content */ - std::string asString(void) const throw(); + std::string asString(void) const ; /** Class XML representation. \param parent XML node over which we will put instance information. \return XML documentcon with class content. */ - anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); + anna::xml::Node* asXML(anna::xml::Node* parent) const ; /** Class XML string representation \return XML string representation with class content. */ - std::string asXMLString() const throw(); + std::string asXMLString() const ; // operators @@ -204,12 +204,12 @@ public: * huaweiStack->load("/var/tmp/huawei_commands.xml"); * */ - virtual void load(const std::string & pathFile) throw(anna::RuntimeException); + virtual void load(const std::string & pathFile) noexcept(false); /** * Clears dictionary content */ - void clear(void) throw() { initialize(); } // initialize and prepares the dictionary + void clear(void) { initialize(); } // initialize and prepares the dictionary }; diff --git a/include/anna/diameter/stack/Engine.hpp b/include/anna/diameter/stack/Engine.hpp index 854ce36..e15ac1b 100644 --- a/include/anna/diameter/stack/Engine.hpp +++ b/include/anna/diameter/stack/Engine.hpp @@ -39,7 +39,7 @@ namespace stack { class Engine : public anna::Singleton { - const anna::xml::DTDMemory * getDictionariesDTD() const throw() { return &a_dtd; } + const anna::xml::DTDMemory * getDictionariesDTD() const { return &a_dtd; } public: @@ -56,14 +56,14 @@ public: * @param stackId Stack identifier. * @return Dictionary reference, NULL if no stack found */ - const Dictionary * getDictionary(unsigned int stackId) const throw(); + const Dictionary * getDictionary(unsigned int stackId) const ; /** Beginning stack iterator */ - const_stack_iterator stack_begin() const throw() { return a_stacks.begin(); } + const_stack_iterator stack_begin() const { return a_stacks.begin(); } /** Ending stack iterator */ - const_stack_iterator stack_end() const throw() { return a_stacks.end(); } + const_stack_iterator stack_end() const { return a_stacks.end(); } /** Stack size */ - int stack_size() const throw() { return a_stacks.size(); } + int stack_size() const { return a_stacks.size(); } // helpers /** @@ -71,7 +71,7 @@ public: * * @return Boolean about empty stack condition */ - bool isEmpty(void) const throw() { return (!a_stacks.size()); } + bool isEmpty(void) const { return (!a_stacks.size()); } /** * Class string representation @@ -80,7 +80,7 @@ public: * * @return String with class content */ - std::string asString(bool all = true) const throw(); + std::string asString(bool all = true) const ; // set @@ -117,7 +117,7 @@ public: * * @return Dictionary registered. When exception happen, dictionary can be accessed by #getDictionary */ - Dictionary * createDictionary(unsigned int stackId, const std::string & xmlPathFile = "") throw(anna::RuntimeException); + Dictionary * createDictionary(unsigned int stackId, const std::string & xmlPathFile = "") noexcept(false); /** * Register a externally created Dictionary or a derived class from Dictionary @@ -128,7 +128,7 @@ public: * * @return Dictionary registered. When exception happen, dictionary can be accessed by #getDictionary */ - Dictionary * registerDictionary(unsigned int stackId, Dictionary *dictionary) throw(anna::RuntimeException); + Dictionary * registerDictionary(unsigned int stackId, Dictionary *dictionary) noexcept(false); /** * Loads an XML dictionary document over the diameter stack identifiers (one or more stack id's). @@ -138,7 +138,7 @@ public: * @param stacks Stacks identifiers over which the dictionary will be load. * @param xmlPathFile Path file to the xml document which represents the diameter dictionary. */ - void loadDictionary(const std::vector & stacks, const std::string & xmlPathFile) throw(anna::RuntimeException); + void loadDictionary(const std::vector & stacks, const std::string & xmlPathFile) noexcept(false); /** * Loads an XML dictionary document over all the diameter engine registered stacks. When more than one stack id is @@ -147,19 +147,19 @@ public: * * @param xmlPathFile Path file to the xml document which represents the diameter dictionary. */ - void loadDictionary(const std::string & xmlPathFile) throw(anna::RuntimeException); + void loadDictionary(const std::string & xmlPathFile) noexcept(false); /** * Remove all stacks registered on diameter stack engine */ - void removeStacks(void) throw() { a_stacks.clear(); } + void removeStacks(void) { a_stacks.clear(); } /** * Remove the stack provided. * * @param stackId Stack identifier for created dictionary */ - void removeStack(unsigned int stackId) throw(); + void removeStack(unsigned int stackId) ; private: diff --git a/include/anna/diameter/stack/Format.hpp b/include/anna/diameter/stack/Format.hpp index 7ff1ce5..ebbd5e5 100644 --- a/include/anna/diameter/stack/Format.hpp +++ b/include/anna/diameter/stack/Format.hpp @@ -47,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 = ""; @@ -66,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 @@ -82,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: @@ -97,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: @@ -112,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 @@ -199,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; @@ -219,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)); } @@ -228,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); }; diff --git a/include/anna/diameter/stack/Vendor.hpp b/include/anna/diameter/stack/Vendor.hpp index f11f8ea..4267a39 100644 --- a/include/anna/diameter/stack/Vendor.hpp +++ b/include/anna/diameter/stack/Vendor.hpp @@ -67,7 +67,7 @@ public: * @param v Vendor code * @return Vendor name */ - static const char* asText(const Code::_v v) throw(anna::RuntimeException) { + static const char* asText(const Code::_v v) noexcept(false) { return asCString(v); } }; @@ -78,27 +78,27 @@ public: // get - S32 getId(void) const throw() { return a_id; } - const S8 * getName(void) const throw() { return a_name.c_str(); } + S32 getId(void) const { return a_id; } + const S8 * getName(void) const { return a_name.c_str(); } // helpers - bool isVendorSpecific(void) const throw() { return (a_id > 0); } + bool isVendorSpecific(void) const { return (a_id > 0); } - 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 friend bool operator == (const Vendor & v1, const Vendor & v2) { return ((v1.getId() == v2.getId())); } // set - void setId(const S32 & id) throw(anna::RuntimeException) { + void setId(const S32 & id) noexcept(false) { if(id < 0) throw anna::RuntimeException("Negative vendor-id not allowed", ANNA_FILE_LOCATION); a_id = id; } - void setName(const std::string & n) throw(anna::RuntimeException) { + void setName(const std::string & n) noexcept(false) { if(n == "") throw anna::RuntimeException("Empty vendor-name string not allowed", ANNA_FILE_LOCATION); a_name = n; diff --git a/include/anna/html/DocumentFile.hpp b/include/anna/html/DocumentFile.hpp index 417efb9..b44ebfd 100644 --- a/include/anna/html/DocumentFile.hpp +++ b/include/anna/html/DocumentFile.hpp @@ -26,8 +26,8 @@ public: DocumentFile() : xml::DocumentFile() {;} private: - _xmlDoc* do_initialize(const char* filename) throw(RuntimeException); - _xmlDoc* do_initialize(const anna::DataBlock&) throw(RuntimeException); + _xmlDoc* do_initialize(const char* filename) noexcept(false); + _xmlDoc* do_initialize(const anna::DataBlock&) noexcept(false); }; } diff --git a/include/anna/html/DocumentMemory.hpp b/include/anna/html/DocumentMemory.hpp index 5a0d079..acc4de9 100644 --- a/include/anna/html/DocumentMemory.hpp +++ b/include/anna/html/DocumentMemory.hpp @@ -26,8 +26,8 @@ public: DocumentMemory() : xml::DocumentMemory() {;} private: - _xmlDoc* do_initialize(const char* contain) throw(RuntimeException); - _xmlDoc* do_initialize(const anna::DataBlock& contain) throw(RuntimeException); + _xmlDoc* do_initialize(const char* contain) noexcept(false); + _xmlDoc* do_initialize(const anna::DataBlock& contain) noexcept(false); }; } diff --git a/include/anna/html/Parser.hpp b/include/anna/html/Parser.hpp index e0403e1..63f17ce 100644 --- a/include/anna/html/Parser.hpp +++ b/include/anna/html/Parser.hpp @@ -36,7 +36,7 @@ public: \li Solo deberia ser llamado despues de Parser::apply. \li El nodo devuelto no puede ser usado despues de invocar al destructor de este Parser. */ - const html::Node* getHead() throw(RuntimeException); + const html::Node* getHead() noexcept(false); /** Obtiene el nodo BODY del documento HTML analizado. Si no esta establecido lanzara una excepcion. @@ -45,13 +45,13 @@ public: \li Solo deberia ser llamado despues de Parser::apply. \li El nodo devuelto no puede ser usado despues de invocar al destructor de este Parser. */ - const html::Node* getBody() throw(RuntimeException); + const html::Node* getBody() noexcept(false); private: const html::Node* a_head; const html::Node* a_body; - void reset() throw() { xml::Parser::reset(); a_head = a_body = NULL; } + void reset() { xml::Parser::reset(); a_head = a_body = NULL; } }; diff --git a/include/anna/html/functions.hpp b/include/anna/html/functions.hpp index 761cbb6..cbfea51 100644 --- a/include/anna/html/functions.hpp +++ b/include/anna/html/functions.hpp @@ -18,7 +18,7 @@ struct functions { Inicializa el modulo de analisis de documentos HTML deber invocado antes usar cualquier clase de este paquete. */ - static void initialize() throw(); + static void initialize() ; }; } diff --git a/include/anna/html/internal/sccs.hpp b/include/anna/html/internal/sccs.hpp index ae6336c..bc15e54 100644 --- a/include/anna/html/internal/sccs.hpp +++ b/include/anna/html/internal/sccs.hpp @@ -15,7 +15,7 @@ namespace html { class sccs { public: - static void activate() throw(); + static void activate() ; }; } diff --git a/include/anna/http/Handler.hpp b/include/anna/http/Handler.hpp index 4d154b2..0e20a64 100644 --- a/include/anna/http/Handler.hpp +++ b/include/anna/http/Handler.hpp @@ -46,7 +46,7 @@ public: en caso de ser necesario. \param message Mensaje HTTP recibido. */ - void apply(comm::ClientSocket& clientSocket, const comm::Message& message) throw(RuntimeException); + void apply(comm::ClientSocket& clientSocket, const comm::Message& message) noexcept(false); protected: /** @@ -59,7 +59,7 @@ protected: Devuelve una instancia de http::Response que puede ser usada para responser a una peticion. \return una instancia de http::Response que puede ser usada para responser a una peticion. */ - Response* allocateResponse() throw(); + Response* allocateResponse() ; /** Metodo virtual que debemos sobreescribir para tratar las peticiones HTTP. @@ -67,14 +67,14 @@ protected: en caso de ser necesario. \param request Peticion HTTP a tratar. */ - virtual void evRequest(comm::ClientSocket& clientSocket, const Request& request) throw(RuntimeException) = 0; + virtual void evRequest(comm::ClientSocket& clientSocket, const Request& request) noexcept(false) = 0; /** Metodo virtual que debemos sobreescribir para tratar las respuestas HTTP. \param clientSocket Socket por el que se recibe la respuesta. \param response respuesta HTTP a tratar. */ - virtual void evResponse(comm::ClientSocket& clientSocket, const Response& response) throw(RuntimeException) = 0; + virtual void evResponse(comm::ClientSocket& clientSocket, const Response& response) noexcept(false) = 0; private: Response* a_response; diff --git a/include/anna/http/Header.hpp b/include/anna/http/Header.hpp index 50786ec..c9a66dc 100644 --- a/include/anna/http/Header.hpp +++ b/include/anna/http/Header.hpp @@ -70,57 +70,57 @@ public: Devuelve el tipo de la cabecera. \return el tipo de la cabecera. */ - Type::_v getType() const throw() { return a_type; } + Type::_v getType() const { return a_type; } /** Devuelve la categoria de la cabecera. \return la categoria de la cabecera. */ - Category::_v getCategory() const throw() { return a_category; } + Category::_v getCategory() const { return a_category; } /** Devuelve el puntero nombre de la extension, puede ser NULL. \return el puntero nombre de la extension, puede ser NULL. */ - const std::string* getExtensionName() const throw() { return a_extensionName; } + const std::string* getExtensionName() const { return a_extensionName; } /** Devuelve el valor asociado a esta cabecera. \return el valor asociado a esta cabecera. */ - const std::string& getStringValue() const throw() { return a_value; } + const std::string& getStringValue() const { return a_value; } /** Devuelve el valor numerico asociado a esta cabecera. \return el valor numerico asociado a esta cabecera. */ - const int getIntegerValue() const throw(); + const int getIntegerValue() const ; /** Establece el valor de esta cabecera. \param token Token del que obtendremos el valor. \warning Exclusivamente uso interno. */ - void setValue(const Token* token) throw(); + void setValue(const Token* token) ; /** Establece el valor asociado a esta cabecera. \param value Valor a establecer. */ - void setValue(const std::string& value) throw() { a_value = value; } + void setValue(const std::string& value) { a_value = value; } /** Establece el valor asociado a esta cabecera. \param value Valor a establecer. */ - void setValue(const int value) throw(); + void setValue(const int value) ; /** Operador de copia. \param other Cabecera de la que copiar. \return La instancia de si misma. */ - Header& operator = (const Header& other) throw(); + Header& operator = (const Header& other) ; /** Compara el contenido actual de esta cabecera con el literal recibido como parametro y @@ -133,7 +133,7 @@ public: \return Un entero menor, igual o mayor que cero si se encuentra que el contenido es, respectivamente, menor que, igual a (concordante), o mayor que \em str. */ - int compare(const char* str, const int flags = Compare::LeftTrim | Compare::NoCase) const throw(); + int compare(const char* str, const int flags = Compare::LeftTrim | Compare::NoCase) const ; /** Compara el contenido actual de esta cabecera con el literal recibido como parametro y @@ -144,7 +144,7 @@ public: \return \em true o \em false dependiendo de si el contenido coincide con \em str. */ - bool match(const char* str, const int flags = Compare::LeftTrim | Compare::NoCase) const throw() { + bool match(const char* str, const int flags = Compare::LeftTrim | Compare::NoCase) const { return compare(str, flags) == 0; } @@ -152,7 +152,7 @@ public: Devuelve una cadena con toda la informacion relevante de este objeto. \return una cadena con toda la informacion relevante de este objeto. */ - std::string asString() const throw(); + std::string asString() const ; /** Interpreta el token recibido como parametro y devuelve el valor de Type con el @@ -161,7 +161,7 @@ public: \warning Exclusivamente uso interno. \return El tipo de cabecera. */ - static Type::_v asType(const Token* token) throw(); + static Type::_v asType(const Token* token) ; /** Interpreta el token recibido como parametro y devuelve el nombre de la cabecera @@ -170,7 +170,7 @@ public: \warning Exclusivamente uso interno. \return El literal con el nombre de la cabecera correspondiente al tipo recibido. */ - static const char* asLiteral(const Type::_v type) throw(); + static const char* asLiteral(const Type::_v type) ; private: Type::_v a_type; @@ -180,9 +180,9 @@ private: static const char* st_names [Type::End]; Header() : a_extensionName(NULL), a_category(Category::Extension) {;} - Header* initialize(const Type::_v type) throw(RuntimeException); - Header* initialize(const std::string& name) throw(RuntimeException); - std::string code() const throw(); + Header* initialize(const Type::_v type) noexcept(false); + Header* initialize(const std::string& name) noexcept(false); + std::string code() const ; friend class Message; friend class Allocator
; diff --git a/include/anna/http/Message.hpp b/include/anna/http/Message.hpp index 6dc8d59..78725bb 100644 --- a/include/anna/http/Message.hpp +++ b/include/anna/http/Message.hpp @@ -53,38 +53,38 @@ public: Devuelve el tipo de este mensaje HTTP. \return el tipo de este mensaje HTTP. */ - Type::_v getType() const throw() { return a_type; } + Type::_v getType() const { return a_type; } /** Devuelve la version del protocolo HTTP usada en el mensaje. \return la version del protocolo HTTP usada en el mensaje. */ - const std::string& getVersion() const throw() { return a_version; } + const std::string& getVersion() const { return a_version; } /* * Devuelve el enumerado que identifica la versión HTTP usada en el mensaje. * \return el enumerado que identifica la versión HTTP usada en el mensaje. */ - Version::_v getVersionAsEnum() const throw() { return Version::asEnum(a_version); } + Version::_v getVersionAsEnum() const { return Version::asEnum(a_version); } /** * Devuelve los parámetros extras que pueden haber estado contenidos en los bloques * de datos, en caso de que el mensaje se haya recibido como un "Transfer-Encoding: chunked". * \return Los parámetros extras que pueden haber estado contenidos en los bloques */ - const std::string& getExtraParameters() const throw() { return a_extraParameters; } + const std::string& getExtraParameters() const { return a_extraParameters; } /** Establece la version a codificar en el mensaje. \param version Texto con la version HTTP a usar, HTTP/1.1, por ejemplo. */ - void setVersion(const std::string& version) throw() { a_version = version; } + void setVersion(const std::string& version) { a_version = version; } /** * Establece la versión a codificar en el mensaje. * \param version Identificador de la versión. */ - void setVersion(const Version::_v version) throw() { a_version = Version::asCString(version); } + void setVersion(const Version::_v version) { a_version = Version::asCString(version); } /** * Establece el cuerpo de este mensaje con el contenido del documento XML correspondiente al @@ -94,7 +94,7 @@ public: * * \param node Nodo XML que contiene el documento XML. */ - comm::Message* setBody(const xml::Node* node) throw(RuntimeException); + comm::Message* setBody(const xml::Node* node) noexcept(false); /** Crea una nueva cabecera en este mensaje. @@ -102,7 +102,7 @@ public: \return La instancia de la nueva cabecera. */ Header* createHeader(const Header::Type::_v type) - throw(RuntimeException) { + noexcept(false) { return a_headers.create()->initialize(type); } @@ -112,7 +112,7 @@ public: \return La instancia de la nueva cabecera. */ Header* createHeader(const std::string& name) - throw(RuntimeException) { + noexcept(false) { return a_headers.create()->initialize(name); } @@ -123,7 +123,7 @@ public: \param type Tipo de cabecera buscado. \return La primera cabecera que coincide con el tipo recibido como parametro. */ - const Header* find(const Header::Type::_v type) const throw() { + const Header* find(const Header::Type::_v type) const { return const_cast (this)->find(type); } @@ -134,7 +134,7 @@ public: \param type Tipo de cabecera buscado. \return La primera cabecera que coincide con el tipo recibido como parametro. */ - Header* find(const Header::Type::_v type) throw(); + Header* find(const Header::Type::_v type) ; /** Devuelve la instancia de la primera cabecera de tipo Header::Category::Extension cuyo @@ -142,48 +142,48 @@ public: \param name Nombre de la extension buscada. \return La primera cabecera que coincide con el tipo recibido como parametro. */ - Header* find(const char* name) throw(); + Header* find(const char* name) ; /** Inicializa el contenido de este mensaje. Libera las cabeceras y el cuerpo del mensaje. */ - void clear() throw() { a_headers.clear(); clearBody(); a_extraParameters.clear();} + void clear() { a_headers.clear(); clearBody(); a_extraParameters.clear();} /** Devuelve un iterador al comienzo de la lista de cabeceras. \return un iterador al comienzo de la lista de cabeceras. */ - header_iterator header_begin() throw() { return a_headers.begin(); } + header_iterator header_begin() { return a_headers.begin(); } /** Devuelve un iterador al final de la lista de cabeceras. \return un iterador al final de la lista de cabeceras. */ - header_iterator header_end() throw() { return a_headers.end(); } + header_iterator header_end() { return a_headers.end(); } /** Devuelve un iterador al comienzo de la lista de cabeceras. \return un iterador al comienzo de la lista de cabeceras. */ - const_header_iterator header_begin() const throw() { return a_headers.begin(); } + const_header_iterator header_begin() const { return a_headers.begin(); } /** Devuelve un iterador al final de la lista de cabeceras. \return un iterador al final de la lista de cabeceras. */ - const_header_iterator header_end() const throw() { return a_headers.end(); } + const_header_iterator header_end() const { return a_headers.end(); } /** Codifica este mensaje. \return El bloque de datos que contiene el mensaje codificado. */ - const DataBlock& code() throw(anna::RuntimeException); + const DataBlock& code() noexcept(false); /** Devuelve una cadena con toda la informacion relevante de este objeto. \return una cadena con toda la informacion relevante de este objeto. */ - virtual std::string asString() const throw() = 0; + virtual std::string asString() const = 0; /** Devuelve la instancia de la cabecera a la que referencia el iterator @@ -191,7 +191,7 @@ public: \return la instancia de la cabecera a la que referencia el iterator recibido como parametro. */ - static Header* header(header_iterator& ii) throw() { return Recycler
::data(ii); } + static Header* header(header_iterator& ii) { return Recycler
::data(ii); } /** Devuelve la instancia de la cabecera a la que referencia el iterator @@ -199,7 +199,7 @@ public: \return la instancia de la cabecera a la que referencia el iterator recibido como parametro. */ - static const Header* header(const_header_iterator& ii) throw() { return Recycler
::data(ii); } + static const Header* header(const_header_iterator& ii) { return Recycler
::data(ii); } protected: /** @@ -216,14 +216,14 @@ private: Recycler
a_headers; std::string a_extraParameters; - void codeLine(const std::string& line) throw(RuntimeException); + void codeLine(const std::string& line) noexcept(false); - void appendExtraParameter(const std::string& extraParameter) throw() { + void appendExtraParameter(const std::string& extraParameter) { a_extraParameters += ' '; a_extraParameters += extraParameter; } - virtual std::string codeStartLine() const throw(anna::RuntimeException) = 0; + virtual std::string codeStartLine() const noexcept(false) = 0; friend class parser::Abstract; }; diff --git a/include/anna/http/MessageFactory.hpp b/include/anna/http/MessageFactory.hpp index c607604..5646470 100644 --- a/include/anna/http/MessageFactory.hpp +++ b/include/anna/http/MessageFactory.hpp @@ -30,7 +30,7 @@ public: \return Una nueva instancia de mensaje HTTP. \warning Cada una de las instancias recibidas con este metodo debe ser liberada con #release. */ - Message* create(const Message::Type::_v type) throw(RuntimeException); + Message* create(const Message::Type::_v type) noexcept(false); /** Libera los recursos del mensaje HTTP recibido como parametro. @@ -38,7 +38,7 @@ public: \warning Si el mensaje recibido no fue obtenido mediante #create los resultado obtenidos no estan documentados. */ - void release(Message* message) throw(); + void release(Message* message) ; private: Recycler a_requests; diff --git a/include/anna/http/Method.hpp b/include/anna/http/Method.hpp index 8357d17..84e62a8 100644 --- a/include/anna/http/Method.hpp +++ b/include/anna/http/Method.hpp @@ -43,14 +43,14 @@ public: \warning Exclusivamente uso interno. \return El tipo de metodo. */ - static Type::_v asType(const Token* token) throw(); + static Type::_v asType(const Token* token) ; /** Devuelve el nombre del metodo con el que esta asociado el tipo recibido. \param type Tipo de metodo. \return el nombre del metodo con el que esta asociado el tipo recibido. */ - static std::string asString(const Type::_v type) throw(); + static std::string asString(const Type::_v type) ; private: Method() {;} diff --git a/include/anna/http/Request.hpp b/include/anna/http/Request.hpp index af9fce7..b371f83 100644 --- a/include/anna/http/Request.hpp +++ b/include/anna/http/Request.hpp @@ -30,37 +30,37 @@ public: Devuelve el metodo asociado a esta peticion. \return el metodo asociado a esta peticion. */ - Method::Type::_v getMethod() const throw() { return a_method; } + Method::Type::_v getMethod() const { return a_method; } /** Devuelve la URI asociado a esta peticion. \return la URI asociado a esta peticion. */ - const std::string& getURI() const throw() { return a_uri; } + const std::string& getURI() const { return a_uri; } /** Establece el metodo de esta peticion. \param method Metodo a establecer para la peticion. */ - void setMethod(const Method::Type::_v method) throw() { a_method = method; } + void setMethod(const Method::Type::_v method) { a_method = method; } /** Establece el URI de esta peticion. \param uri URI a establecer para la peticion. */ - void setURI(const std::string& uri) throw() { a_uri = uri; } + void setURI(const std::string& uri) { a_uri = uri; } /** Devuelve una cadena con toda la informacion relevante de este objeto. \return una cadena con toda la informacion relevante de este objeto. */ - std::string asString() const throw(); + std::string asString() const ; private: Method::Type::_v a_method; std::string a_uri; - std::string codeStartLine() const throw(anna::RuntimeException); + std::string codeStartLine() const noexcept(false); }; } diff --git a/include/anna/http/Response.hpp b/include/anna/http/Response.hpp index aaa51a6..1241f80 100644 --- a/include/anna/http/Response.hpp +++ b/include/anna/http/Response.hpp @@ -30,13 +30,13 @@ public: Devuelve el codigo de estado contenido en la respuesta. \return El codigo de estado contenido en la respuesta */ - int getStatusCode() const throw() { return a_statusCode; } + int getStatusCode() const { return a_statusCode; } /** Devuelve el campo ReasePhrase contenido en la respuesta. \return el campo ReasePhrase contenido en la respuesta. */ - const std::string& getReasonPhrase() const throw() { return a_reasonPhrase; } + const std::string& getReasonPhrase() const { return a_reasonPhrase; } /** Establece el codigo de retorno de la respuesta HTTP. Si es un codigo reconocido por la RFC 2616 @@ -86,31 +86,31 @@ public: 505: HTTP Version not supported \endcode */ - void setStatusCode(const int statusCode) throw(); + void setStatusCode(const int statusCode) ; /** Establece la frase asociada a la respuesta. \param reasonPhrase Frase asociada a la respuesta. */ - void setReasonPhrase(const std::string& reasonPhrase) throw() { a_reasonPhrase = reasonPhrase; } + void setReasonPhrase(const std::string& reasonPhrase) { a_reasonPhrase = reasonPhrase; } /** Establece la frase asociada a la respuesta. \param reasonPhrase Frase asociada a la respuesta. */ - void setReasonPhrase(const char* reasonPhrase) throw() { a_reasonPhrase = reasonPhrase; } + void setReasonPhrase(const char* reasonPhrase) { a_reasonPhrase = reasonPhrase; } /** Devuelve una cadena con toda la informacion relevante de este objeto. \return una cadena con toda la informacion relevante de este objeto. */ - std::string asString() const throw(); + std::string asString() const ; private: int a_statusCode; std::string a_reasonPhrase; - std::string codeStartLine() const throw(anna::RuntimeException); + std::string codeStartLine() const noexcept(false); }; } diff --git a/include/anna/http/Transport.hpp b/include/anna/http/Transport.hpp index 2143f6e..34df3f6 100644 --- a/include/anna/http/Transport.hpp +++ b/include/anna/http/Transport.hpp @@ -51,34 +51,34 @@ public: \return la longitud del cuerpo del mensaje asociado. \warning Exclusivamente de uso interno. */ - int getContentLength() const throw() { return a_contentLength; } + int getContentLength() const { return a_contentLength; } /** Devuelve el mensaje de entrada asociado. \return La instancia del mensaje de entrada asociado. \warning Exclusivamente de uso interno. */ - http::Message* getInputMessage() throw(RuntimeException); + http::Message* getInputMessage() noexcept(false); /** Establece la longitud del cuerpo del mensaje asociado. \param contentLength Longitud del cuerpo del mensaje asociado. \warning Exclusivamente de uso interno. */ - void setContentLength(const int contentLength) throw(RuntimeException) { a_contentLength = contentLength; } + void setContentLength(const int contentLength) noexcept(false) { a_contentLength = contentLength; } /** Establece la posicion donde comienza el cuerpo del mensaje asociado. \param bodyOffset Posicion donde comienza el cuerpor del mensaje. \warning Exclusivamente de uso interno. */ - void setBodyOffset(const int bodyOffset) throw(RuntimeException) { a_bodyOffset = bodyOffset; } + void setBodyOffset(const int bodyOffset) noexcept(false) { a_bodyOffset = bodyOffset; } /** Metodo que inicializa el estado de esta capa de transporte. Se invoca directamente por el nucleo cuando sea necesario. */ - void clear() throw(); + void clear() ; /** * Permite obtener una instancia de anna::http::Message correspondiente al búfer recibido como parámetro. @@ -88,7 +88,7 @@ public: * proteja, porque lo que si se invoca en modo MT desde varios thread habrá que establecer las secciones * críticas necesarias para que sólo un thread pueda acceder a este método. */ - const http::Message* externalDecode(const char* buffer, const int length) throw(RuntimeException); + const http::Message* externalDecode(const char* buffer, const int length) noexcept(false); /** Instancia un mensaje HTTP de entrada del tipo determinado por \em type. @@ -96,13 +96,13 @@ public: \return La instancia del mensaje creado. \internal */ - http::Message* allocateInputMessage(const Message::Type::_v type) throw(RuntimeException); + http::Message* allocateInputMessage(const Message::Type::_v type) noexcept(false); /** * Devuelve el bloque de datos codificados asociados a esta instancia. * \warning Exclusivamente uso interno. */ - EncodedBlock* getEncodedBlock() throw(); + EncodedBlock* getEncodedBlock() ; /** Separa el token recibido como parametro en distintos componentes basicos, usando @@ -112,7 +112,7 @@ public: \return Una instancia del Tokenizer con el que poder recorrer todos los componentes. */ - const Tokenizer& split(const Token& token) throw(RuntimeException); + const Tokenizer& split(const Token& token) noexcept(false); /** Separa el token recibido como parametro en distintos componentes basicos. @@ -122,7 +122,7 @@ public: \return Una instancia del Tokenizer con el que poder recorrer todos los componentes. */ - const Tokenizer& split(const Token& token, const char* separator) throw(RuntimeException); + const Tokenizer& split(const Token& token, const char* separator) noexcept(false); /** Separa el token recibido como parametro en distintos componentes basicos. @@ -132,19 +132,19 @@ public: \return Una instancia del Tokenizer con el que poder recorrer todos los componentes. */ - const Tokenizer& split(const Token& token, const char separator) throw(RuntimeException); + const Tokenizer& split(const Token& token, const char separator) noexcept(false); /** Devuelve el literal que identifica de esta clase. \return el literal que identifica de esta clase. */ - static const char* className() throw() { return "anna::http::Transport"; } + static const char* className() { return "anna::http::Transport"; } /** Devuelve el gestor de capas de transporte asociado a esta clase. \return El gestor de capas de transporte asociado a esta clase. */ - static comm::TransportFactory& getFactory() throw() { return st_factory; } + static comm::TransportFactory& getFactory() { return st_factory; } private: //------------------------------------------------------------------------------------- @@ -174,15 +174,15 @@ private: static comm::TransportFactoryImpl st_factory; - void setParserState(const parser::Abstract* parser) throw(RuntimeException); + void setParserState(const parser::Abstract* parser) noexcept(false); - int calculeSize(const DataBlock&) throw(RuntimeException); - const comm::Message* decode(const DataBlock&) throw(RuntimeException); - const DataBlock& code(comm::Message&) throw(RuntimeException); + int calculeSize(const DataBlock&) noexcept(false); + const comm::Message* decode(const DataBlock&) noexcept(false); + const DataBlock& code(comm::Message&) noexcept(false); /* - static const Token* tryRequest (const Tokenizer&) throw (); - static const Token* tryResponse (const Tokenizer&) throw (); + static const Token* tryRequest (const Tokenizer&) ; + static const Token* tryResponse (const Tokenizer&) ; */ friend class anna::Allocator ; friend class parser::Abstract; diff --git a/include/anna/http/functions.hpp b/include/anna/http/functions.hpp index f65b808..8815e80 100644 --- a/include/anna/http/functions.hpp +++ b/include/anna/http/functions.hpp @@ -25,7 +25,7 @@ struct functions { Inicializa el modulo de analisis de mensajes HTTP, debe ser invocado antes usar cualquier clase de este paquete. */ - static void initialize() throw(); + static void initialize() ; /** Devuelve la posicion dentro del buffer definido por \em data en la que se @@ -40,7 +40,7 @@ struct functions { encuentra la primera ocurrencia de \em str o \em -1 en caso de no encontrarse la cadena. */ - static int find(const void* data, const int size, const char* str) throw(); + static int find(const void* data, const int size, const char* str) ; }; } diff --git a/include/anna/http/http.hpp b/include/anna/http/http.hpp index 04ab49f..d7bf0e2 100644 --- a/include/anna/http/http.hpp +++ b/include/anna/http/http.hpp @@ -20,7 +20,7 @@ namespace anna { \code void MyHTTPServer::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); @@ -36,7 +36,7 @@ namespace anna { \code void MyHTTPClient::initialize () - throw (RuntimeException) + noexcept(false) { CommandLine& cl (CommandLine::instantiate ()); diff --git a/include/anna/http/internal/EncodedBlock.hpp b/include/anna/http/internal/EncodedBlock.hpp index e8358fd..058669a 100644 --- a/include/anna/http/internal/EncodedBlock.hpp +++ b/include/anna/http/internal/EncodedBlock.hpp @@ -22,15 +22,15 @@ public: EncodedBlock() : DataBlock(true), a_chunk(true), a_expectedSize(-1), a_type(Type::None) {;} - Type::_v getType() const throw() { return a_type; } - bool isValid() const throw() { return a_type != Type::None; } + Type::_v getType() const { return a_type; } + bool isValid() const { return a_type != Type::None; } - void setType(const Type::_v type) throw() { a_type = type; } - void setExpectedSize(const int expectedSize) throw() { a_expectedSize = expectedSize; } + void setType(const Type::_v type) { a_type = type; } + void setExpectedSize(const int expectedSize) { a_expectedSize = expectedSize; } void clear() { DataBlock::clear(); a_expectedSize = -1; a_chunk.clear(); a_type = Type::None; } - State::_v append(const DataBlock& chunk) throw(); + State::_v append(const DataBlock& chunk) ; private: Type::_v a_type; diff --git a/include/anna/http/internal/Token.hpp b/include/anna/http/internal/Token.hpp index b0bc138..77cec22 100644 --- a/include/anna/http/internal/Token.hpp +++ b/include/anna/http/internal/Token.hpp @@ -21,16 +21,16 @@ class Token : public DataBlock { public: Token() : DataBlock(false) {;} - const std::string& getStringValue() const throw(); - int getIntegerValue() const throw(); - bool contains(const char byte) const throw(); + const std::string& getStringValue() const ; + int getIntegerValue() const ; + bool contains(const char byte) const ; - void setValue(const char* content, const int size) throw() { + void setValue(const char* content, const int size) { setBuffer(content); setSize(size); } - bool match(const char* str) const throw(); - int calculeOffset(const DataBlock& base) const throw(RuntimeException); + bool match(const char* str) const ; + int calculeOffset(const DataBlock& base) const noexcept(false); private: std::string a_aux; diff --git a/include/anna/http/internal/Tokenizer.hpp b/include/anna/http/internal/Tokenizer.hpp index c830d97..7e7f66c 100644 --- a/include/anna/http/internal/Tokenizer.hpp +++ b/include/anna/http/internal/Tokenizer.hpp @@ -21,28 +21,28 @@ namespace http { class Tokenizer : public Recycler { public: - void apply(const DataBlock&) throw(RuntimeException); - void apply(const DataBlock&, const char* separator) throw(RuntimeException); - void apply(const DataBlock&, const char separator) throw(RuntimeException); + void apply(const DataBlock&) noexcept(false); + void apply(const DataBlock&, const char* separator) noexcept(false); + void apply(const DataBlock&, const char separator) noexcept(false); - const Token* operator [](int index) const throw(); + const Token* operator [](int index) const ; - const Token* operator [](const_iterator ii) const throw() { + const Token* operator [](const_iterator ii) const { return (ii == end()) ? NULL : token(ii); } - static const Token* token(const_iterator ii) throw() { return data(ii); } - static Token* token(iterator ii) throw() { return data(ii); } + static const Token* token(const_iterator ii) { return data(ii); } + static Token* token(iterator ii) { return data(ii); } private: - int createToken(const char* p, const int size) throw() { + int createToken(const char* p, const int size) { create()->setValue(p, size); return size; } - static int find(const char* data, const int size, const char character) throw(); - static int find(const char* data, const int size, const char* searched) throw(); - static bool isSpace(const int c) throw() { return c <= '\t' || c == ' ' || c >= 128; } + static int find(const char* data, const int size, const char character) ; + static int find(const char* data, const int size, const char* searched) ; + static bool isSpace(const int c) { return c <= '\t' || c == ' ' || c >= 128; } }; } diff --git a/include/anna/http/internal/sccs.hpp b/include/anna/http/internal/sccs.hpp index 8c98838..fae6cad 100644 --- a/include/anna/http/internal/sccs.hpp +++ b/include/anna/http/internal/sccs.hpp @@ -15,7 +15,7 @@ namespace http { class sccs { public: - static void activate() throw(); + static void activate() ; }; } diff --git a/include/anna/http/parser/Abstract.hpp b/include/anna/http/parser/Abstract.hpp index c8e4f1c..c68e1fe 100644 --- a/include/anna/http/parser/Abstract.hpp +++ b/include/anna/http/parser/Abstract.hpp @@ -35,18 +35,18 @@ public: protected: Abstract(const ClassType::_v classType) : a_classType(classType) {;} - static void setState(Transport&, const ClassType::_v) throw(); - static void setLastChunkedByte(Transport&, const int lastChunkedByte) throw(); - static const DataBlock& getFullMessage(Transport&) throw(); - static void appendExtraParameter(Message*, const std::string& extraParameter) throw(); + static void setState(Transport&, const ClassType::_v) ; + static void setLastChunkedByte(Transport&, const int lastChunkedByte) ; + static const DataBlock& getFullMessage(Transport&) ; + static void appendExtraParameter(Message*, const std::string& extraParameter) ; - virtual int processLine(Transport&, const DataBlock&, const Token& line) const throw(RuntimeException) = 0; + virtual int processLine(Transport&, const DataBlock&, const Token& line) const noexcept(false) = 0; private: const ClassType::_v a_classType; - ClassType::_v getClassType() const throw() { return a_classType; } - std::string asString() const throw(); + ClassType::_v getClassType() const { return a_classType; } + std::string asString() const ; friend class http::Transport; }; diff --git a/include/anna/http/parser/ReadChunkData.hpp b/include/anna/http/parser/ReadChunkData.hpp index 67ab698..054f4e7 100644 --- a/include/anna/http/parser/ReadChunkData.hpp +++ b/include/anna/http/parser/ReadChunkData.hpp @@ -22,7 +22,7 @@ public: ReadChunkData() : ReadHeader(ClassType::ReadChunkData) {;} private: - int processLine(Transport&, const DataBlock&, const Token& line) const throw(RuntimeException); + int processLine(Transport&, const DataBlock&, const Token& line) const noexcept(false); }; } diff --git a/include/anna/http/parser/ReadChunkSize.hpp b/include/anna/http/parser/ReadChunkSize.hpp index ff21355..4977896 100644 --- a/include/anna/http/parser/ReadChunkSize.hpp +++ b/include/anna/http/parser/ReadChunkSize.hpp @@ -22,7 +22,7 @@ public: ReadChunkSize() : ReadHeader(ClassType::ReadChunkSize) {;} private: - int processLine(Transport&, const DataBlock&, const Token& line) const throw(RuntimeException); + int processLine(Transport&, const DataBlock&, const Token& line) const noexcept(false); }; } diff --git a/include/anna/http/parser/ReadChunkTrailers.hpp b/include/anna/http/parser/ReadChunkTrailers.hpp index 79eb0f6..cbf3317 100644 --- a/include/anna/http/parser/ReadChunkTrailers.hpp +++ b/include/anna/http/parser/ReadChunkTrailers.hpp @@ -22,7 +22,7 @@ public: ReadChunkTrailers() : ReadHeader(ClassType::ReadChunkTrailers) {;} private: - int processLine(Transport&, const DataBlock&, const Token& line) const throw(RuntimeException); + int processLine(Transport&, const DataBlock&, const Token& line) const noexcept(false); }; } diff --git a/include/anna/http/parser/ReadHeader.hpp b/include/anna/http/parser/ReadHeader.hpp index 33d2830..38dca66 100644 --- a/include/anna/http/parser/ReadHeader.hpp +++ b/include/anna/http/parser/ReadHeader.hpp @@ -25,7 +25,7 @@ protected: ReadHeader(const ClassType::_v classType) : parser::Abstract(classType) {;} virtual int processLine(Transport&, const DataBlock&, const Token& line) const - throw(RuntimeException); + noexcept(false); }; } diff --git a/include/anna/http/parser/WaitChunkSize.hpp b/include/anna/http/parser/WaitChunkSize.hpp index 9e8764c..6157e57 100644 --- a/include/anna/http/parser/WaitChunkSize.hpp +++ b/include/anna/http/parser/WaitChunkSize.hpp @@ -22,7 +22,7 @@ public: WaitChunkSize() : ReadHeader(ClassType::WaitChunkSize) {;} private: - int processLine(Transport&, const DataBlock&, const Token& line) const throw(RuntimeException); + int processLine(Transport&, const DataBlock&, const Token& line) const noexcept(false); }; } diff --git a/include/anna/http/parser/WaitEndOfHeader.hpp b/include/anna/http/parser/WaitEndOfHeader.hpp index bc2c229..a3d0343 100644 --- a/include/anna/http/parser/WaitEndOfHeader.hpp +++ b/include/anna/http/parser/WaitEndOfHeader.hpp @@ -22,7 +22,7 @@ public: WaitEndOfHeader() : ReadHeader(ClassType::WaitEndOfHeader) {;} private: - int processLine(Transport&, const DataBlock&, const Token& line) const throw(RuntimeException); + int processLine(Transport&, const DataBlock&, const Token& line) const noexcept(false); }; } diff --git a/include/anna/http/parser/WaitMessage.hpp b/include/anna/http/parser/WaitMessage.hpp index 18a5ada..271865c 100644 --- a/include/anna/http/parser/WaitMessage.hpp +++ b/include/anna/http/parser/WaitMessage.hpp @@ -24,10 +24,10 @@ public: WaitMessage() : parser::Abstract(ClassType::WaitMessage) {;} private: - int processLine(Transport&, const DataBlock&, const Token& line) const throw(RuntimeException); + int processLine(Transport&, const DataBlock&, const Token& line) const noexcept(false); - static bool setupRequest(Transport&, const Tokenizer&) throw(); - static void setupResponse(Transport&, const Tokenizer&) throw(); + static bool setupRequest(Transport&, const Tokenizer&) ; + static void setupResponse(Transport&, const Tokenizer&) ; }; } diff --git a/include/anna/http/wims20/Abstract.hpp b/include/anna/http/wims20/Abstract.hpp index 88c27d4..ac9a783 100644 --- a/include/anna/http/wims20/Abstract.hpp +++ b/include/anna/http/wims20/Abstract.hpp @@ -69,56 +69,56 @@ public: * Devuelve el campo \em domain-openapis establecido en el contructor. * \return el campo \em domain-openapis establecido en el contructor. */ - const std::string& getDomain() const throw() { return a_domain; } + const std::string& getDomain() const { return a_domain; } /** * Devuelve el campo \em path-openapis * \return El campo \em path-openapis, puede ser NULL. */ - const std::string* getPath() const throw() { return a_path; } + const std::string* getPath() const { return a_path; } /** * Devuelve el servicio de la OpenAPI. * \param Identificador de servicio usado en la OpenAPI. */ - const std::string& getServiceID() const throw() { return a_serviceID; } + const std::string& getServiceID() const { return a_serviceID; } /** * Devuelve identificador de usuario que interacciona con el servicio. * \return El identificador de usuario que interacciona con el servicio. */ - const std::string& getGUID() const throw() { return a_guid; } + const std::string& getGUID() const { return a_guid; } /** * Establece el servicio de la OpenAPI. * \param serviceID Identificador de servicio usado en la OpenAPI. */ - void setServiceID(const std::string& serviceID) throw() { a_serviceID = serviceID; a_fixedPart.clear(); } + void setServiceID(const std::string& serviceID) { a_serviceID = serviceID; a_fixedPart.clear(); } /** * Establece el identificador de usuario que interacciona con el servicio. * \param guid Identificador de usuario. Dónde por usuario se entiende cualquier elemento * que pueda intereccionar con nuestro servicio */ - void setGUID(const std::string& guid) throw() { a_guid = guid; a_fixedPart.clear(); } + void setGUID(const std::string& guid) { a_guid = guid; a_fixedPart.clear(); } /** * Devuelve \em true si la estructura contiene parámetros o \em false en otro caso. * \return \em true si la estructura contiene parámetros o \em false en otro caso. */ - bool hasParameters() const throw() { return a_parameters != NULL && a_parameters->empty() == false; } + bool hasParameters() const { return a_parameters != NULL && a_parameters->empty() == false; } /** * Devuelve \em true si la estructura contiene niveles opcionales o \em false en otro caso. * \return \em true si la estructura contiene niveles opcionales o \em false en otro caso. */ - bool hasOtherLevels() const throw() { return a_otherLevels != NULL && a_otherLevels->empty() == false; } + bool hasOtherLevels() const { return a_otherLevels != NULL && a_otherLevels->empty() == false; } /** * Limpia el contenido asociado al parámetro \em other_possible_level. Sólo debería * invocarse a este método en caso de que el servicio destino de la petición haya cambiado. */ - virtual void clearOtherLevels() throw(); + virtual void clearOtherLevels() ; /** * Limpia el contenido asociado a los parámetros. Sólo debería invocarse a éste método en caso @@ -126,12 +126,12 @@ public: * Si son los mismos parámetros con el mismo nombre, deberíamos reutilizar el máximo número * de veces. */ - virtual void clearParameters() throw(); + virtual void clearParameters() ; /** * Inicializa los toda la información asociada a esta instancia. */ - void clear() throw() { + void clear() { clearOtherLevels(); clearParameters(); } @@ -140,77 +140,77 @@ public: * Devuelce una cadena con la información relevante sobre esta clase. * \return una cadena con la información relevante sobre esta clase. */ - std::string asString() const throw(); + std::string asString() const ; /** * Devuelve un iterator al comienzo de la lista de niveles adicionales. * \return un iterator al comienzo de la lista de niveles adicionales. * \warning Sólo se puede invocar a este método si #hasOtherLevels devuelve \em true. */ - other_level_iterator other_level_begin() throw() { return a_otherLevels->begin(); } + other_level_iterator other_level_begin() { return a_otherLevels->begin(); } /** * Devuelve un iterator al final de la lista de niveles adicionales. * \return un iterator al final de la lista de niveles adicionales. * \warning Sólo se puede invocar a este método si #hasOtherLevels devuelve \em true. */ - other_level_iterator other_level_end() throw() { return a_otherLevels->end(); } + other_level_iterator other_level_end() { return a_otherLevels->end(); } /** * Devuelve el valor asociado al iterador. * \param ii Iterador sobre los niveles opcionales. * \return el valor asociado al iterador. */ - static std::string* otherLevel(other_level_iterator ii) throw() { return *ii; } + static std::string* otherLevel(other_level_iterator ii) { return *ii; } /** * Devuelve un iterator al comienzo de la lista de niveles adicionales. * \return un iterator al comienzo de la lista de niveles adicionales. * \warning Sólo se puede invocar a este método si #hasOtherLevels devuelve \em true. */ - const_other_level_iterator other_level_begin() const throw() { return a_otherLevels->begin(); } + const_other_level_iterator other_level_begin() const { return a_otherLevels->begin(); } /** * Devuelve un iterator al final de la lista de niveles adicionales. * \return un iterator al final de la lista de niveles adicionales. * \warning Sólo se puede invocar a este método si #hasOtherLevels devuelve \em true. */ - const_other_level_iterator other_level_end() const throw() { return a_otherLevels->end(); } + const_other_level_iterator other_level_end() const { return a_otherLevels->end(); } /** * Devuelve el valor asociado al iterador. * \param ii Iterador sobre los niveles opcionales. * \return el valor asociado al iterador. */ - static const std::string& otherLevel(const_other_level_iterator ii) throw() { return **ii; } + static const std::string& otherLevel(const_other_level_iterator ii) { return **ii; } /** * Devuelve un iterator al comienzo de la lista de niveles adicionales. * \return un iterator al comienzo de la lista de niveles adicionales. * \warning Sólo se puede invocar a este método si #hasParameters devuelve \em true. */ - const_parameter_iterator parameter_begin() const throw() { return a_parameters->begin(); } + const_parameter_iterator parameter_begin() const { return a_parameters->begin(); } /** * Devuelve un iterator al final de la lista de niveles adicionales. * \return un iterator al final de la lista de niveles adicionales. * \warning Sólo se puede invocar a este método si #hasParameters devuelve \em true. */ - const_parameter_iterator parameter_end() const throw() { return a_parameters->end(); } + const_parameter_iterator parameter_end() const { return a_parameters->end(); } /** * Devuelve el nombre del parámetro asociado al iterador. * \param ii Iterador sobre los niveles opcionales. * \return el nombre del parámetro asociado al iterador. */ - static const std::string& parameter_name(const_parameter_iterator ii) throw() { return *(ii->first); } + static const std::string& parameter_name(const_parameter_iterator ii) { return *(ii->first); } /** * Devuelve el valor del parámetro asociado al iterador. * \param ii Iterador sobre los niveles opcionales. * \return el valor del parámetro asociado al iterador. */ - static const std::string& parameter_value(const_parameter_iterator ii) throw() { return *(ii->second); } + static const std::string& parameter_value(const_parameter_iterator ii) { return *(ii->second); } protected: other_level_container* a_otherLevels; @@ -236,26 +236,26 @@ protected: * Mientras estos dos últimos campos se mantengan constrantes, el resultado de este método no cambia. * \return Una cadena con la parte fija de la petición. */ - const std::string& calculeFixedPart() throw(RuntimeException); + const std::string& calculeFixedPart() noexcept(false); /** * Calcula la parte fija corta de la petición. Tiene en cuenta el \em domain-openapis y si existe * el path-openapis. Si fuera necesario incluye el identificador de protocolo "http://". * \return Una cadena con la parte fija corta de la petición. */ - const std::string& calculeShortFixedPart() throw(RuntimeException); + const std::string& calculeShortFixedPart() noexcept(false); /** * Optimiza la creación y liberación de cadenas que usa el proceso de interpretación continuamente. * \warning Exclusivamente uso interno. */ - std::string* createString() throw(RuntimeException) { return a_string_pool.create(); } + std::string* createString() noexcept(false) { return a_string_pool.create(); } /** * Optimiza la creación y liberación de cadenas que usa el proceso de interpretación continuamente. * \warning Exclusivamente uso interno. */ - std::string* createString(const char* value) throw(RuntimeException) { + std::string* createString(const char* value) noexcept(false) { std::string* result = a_string_pool.create(); *result = value; return result; @@ -265,59 +265,59 @@ protected: * Optimiza la creación y liberación de cadenas que usa el proceso de interpretación continuamente. * \warning Exclusivamente uso interno. */ - std::string* createString(const std::string& value) throw(RuntimeException) { return createString(value.c_str()); } + std::string* createString(const std::string& value) noexcept(false) { return createString(value.c_str()); } /** * Optimiza la creación y liberación de cadenas que usa el proceso de interpretación continuamente. * \warning Exclusivamente uso interno. */ - void destroyString(std::string* str) throw() { a_string_pool.release(str); } + void destroyString(std::string* str) { a_string_pool.release(str); } /** * Amplía la lista de niveles. * \param otherLevel Nombre del nivel con el que ampliar las lista. */ - void other_level_add(const std::string& otherLevel) throw(RuntimeException); + void other_level_add(const std::string& otherLevel) noexcept(false); /** * Amplía la lista de parámetros con una nueva pareja (Nombre, Valor). * \param name Nombre del parámetro a crear. * \param value Valor asociado al parámetro. */ - void parameter_set(const std::string& name, const std::string& value) throw(RuntimeException); + void parameter_set(const std::string& name, const std::string& value) noexcept(false); /** * Devuelve un iterator al comienzo de la lista de niveles adicionales. * \return un iterator al comienzo de la lista de niveles adicionales. * \warning Sólo se puede invocar a este método si #hasParameters devuelve \em true. */ - parameter_iterator parameter_begin() throw() { return a_parameters->begin(); } + parameter_iterator parameter_begin() { return a_parameters->begin(); } /** * Devuelve un iterator al final de la lista de niveles adicionales. * \return un iterator al final de la lista de niveles adicionales. * \warning Sólo se puede invocar a este método si #hasParameters devuelve \em true. */ - parameter_iterator parameter_end() throw() { return a_parameters->end(); } + parameter_iterator parameter_end() { return a_parameters->end(); } /** * Devuelve el nombre del parámetro asociado al iterador. * \param ii Iterador sobre los niveles opcionales. * \return el nombre del parámetro asociado al iterador. */ - static std::string* parameter_name(parameter_iterator ii) throw() { return ii->first; } + static std::string* parameter_name(parameter_iterator ii) { return ii->first; } /** * Devuelve el valor del parámetro asociado al iterador. * \param ii Iterador sobre los niveles opcionales. * \return el valor del parámetro asociado al iterador. */ - static std::string* parameter_value(parameter_iterator ii) throw() { return ii->second; } + static std::string* parameter_value(parameter_iterator ii) { return ii->second; } /** * Concatena las cadenas recibidas teniendo en entre ambas debe de haber un carácter '/'. */ - static void appendWithSlash(std::string& target, const std::string& other) throw(); + static void appendWithSlash(std::string& target, const std::string& other) ; private: const std::string a_whatis; diff --git a/include/anna/http/wims20/ClientSide.hpp b/include/anna/http/wims20/ClientSide.hpp index 789270d..1e53ac1 100644 --- a/include/anna/http/wims20/ClientSide.hpp +++ b/include/anna/http/wims20/ClientSide.hpp @@ -76,13 +76,13 @@ public: * Amplía el campo \em other_possible_level con el valor recibido. * \param otherLevel Valor con el que ampliar la ruta. */ - void addOtherLevel(const std::string& otherLevel) throw(RuntimeException); + void addOtherLevel(const std::string& otherLevel) noexcept(false); /** * Amplía el campo \em other_possible_level con el valor recibido. * \param otherLevel Valor con el que ampliar la ruta. */ - void addOtherLevel(const char* otherLevel) throw(RuntimeException) { + void addOtherLevel(const char* otherLevel) noexcept(false) { std::string aux(otherLevel); addOtherLevel(aux); } @@ -93,7 +93,7 @@ public: * \param parameter Nombre del parámetro a establecer. * \param value Valor asociado al parámetro. */ - void setParameter(const char* parameter, const char* value) throw(RuntimeException) { + void setParameter(const char* parameter, const char* value) noexcept(false) { std::string p(parameter); std::string v(value); Abstract::parameter_set(p, v); @@ -105,7 +105,7 @@ public: * \param parameter Nombre del parámetro a establecer. * \param value Valor asociado al parámetro. */ - void setParameter(const char* parameter, const int value) throw(RuntimeException) { + void setParameter(const char* parameter, const int value) noexcept(false) { std::string p(parameter); Abstract::parameter_set(p, anna::functions::asString(value)); } @@ -116,7 +116,7 @@ public: * \param parameter Nombre del parámetro a establecer. * \param value Valor asociado al parámetro. */ - void setParameter(const std::string& parameter, const std::string& value) throw(RuntimeException) { + void setParameter(const std::string& parameter, const std::string& value) noexcept(false) { Abstract::parameter_set(parameter, value); } @@ -126,7 +126,7 @@ public: * \param parameter Nombre del parámetro a establecer. * \param value Valor asociado al parámetro. */ - void setParameter(const std::string& parameter, const int value) throw(RuntimeException) { + void setParameter(const std::string& parameter, const int value) noexcept(false) { Abstract::parameter_set(parameter, anna::functions::asString(value)); } @@ -134,7 +134,7 @@ public: * Limpia el contenido asociado al parámetro \em other_possible_level. Sólo debería * invocarse a este método en caso de que el servicio destino de la petición haya cambiado. */ - void clearOtherLevels() throw() { + void clearOtherLevels() { Abstract::clearOtherLevels(); Abstract::destroyString(a_strOtherLevels); a_strOtherLevels = NULL; @@ -146,7 +146,7 @@ public: * \param message Mensaje HTTP sobre el que se establecerá la URI necesaria para * realizar la peticion WIMS 2.0. */ - void codeOn(http::Request& message) throw(RuntimeException); + void codeOn(http::Request& message) noexcept(false); private: std::string* a_strOtherLevels; diff --git a/include/anna/http/wims20/ServerSide.hpp b/include/anna/http/wims20/ServerSide.hpp index 69508ed..884389f 100644 --- a/include/anna/http/wims20/ServerSide.hpp +++ b/include/anna/http/wims20/ServerSide.hpp @@ -77,7 +77,7 @@ public: * \param mode Modo de actuar en caso de que no se encuentre el parámetro. * \return El valor asociado al parámetro recibido como parémtro. Puede ser NULL. */ - const std::string* getValue(const char* name, const Exception::Mode::_v mode = Exception::Mode::Throw) const throw(RuntimeException); + const std::string* getValue(const char* name, const Exception::Mode::_v mode = Exception::Mode::Throw) const noexcept(false); /** * Obtiene el valor asociado a parámetro recibido como parámetro, que habrá sido obtenido @@ -86,7 +86,7 @@ public: * \param mode Modo de actuar en caso de que no se encuentre el parámetro. * \return El valor asociado al parámetro recibido como parémtro. Puede ser NULL. */ - const char* getCStringValue(const char* name, const Exception::Mode::_v mode = Exception::Mode::Throw) const throw(RuntimeException); + const char* getCStringValue(const char* name, const Exception::Mode::_v mode = Exception::Mode::Throw) const noexcept(false); /** * Obtiene el valor asociado a parámetro recibido como parámetro, que habrá sido obtenido @@ -95,7 +95,7 @@ public: * \param mode Modo de actuar en caso de que no se encuentre el parámetro. * \return El valor asociado al parámetro recibido como parémtro. Puede ser NULL. */ - int getIntegerValue(const char* name, const Exception::Mode::_v mode = Exception::Mode::Throw) const throw(RuntimeException); + int getIntegerValue(const char* name, const Exception::Mode::_v mode = Exception::Mode::Throw) const noexcept(false); /** * Decodifica la URI de la petición enviada como parámetro y la interpreta según @@ -103,15 +103,15 @@ public: * * \param request Petición HTTP que va a tratar este servidor. */ - void decode(const http::Request& request) throw(RuntimeException); + void decode(const http::Request& request) noexcept(false); private: struct SplitCode { enum _v { HierarchyAndParameter, HierarchyItem, Parameters, ParameterAndArgument, Max }; }; - void decodeHierarchy(const std::string& hierarchy) throw(RuntimeException); - void decodeParameters(const std::string& parameters) throw(RuntimeException); + void decodeHierarchy(const std::string& hierarchy) noexcept(false); + void decodeParameters(const std::string& parameters) noexcept(false); - const Tokenizer& split(const SplitCode::_v splitZone, const std::string&) throw(RuntimeException); + const Tokenizer& split(const SplitCode::_v splitZone, const std::string&) noexcept(false); anna::Tokenizer a_tokenizer [SplitCode::Max]; }; diff --git a/include/anna/io/AbstractReader.hpp b/include/anna/io/AbstractReader.hpp index 9f4b018..c855350 100644 --- a/include/anna/io/AbstractReader.hpp +++ b/include/anna/io/AbstractReader.hpp @@ -32,7 +32,7 @@ public: Devuelve la estructura de bajo nivel con la que leemos el archivo. \return La estructura de bajo nivel con la que leemos el archivo. */ - FILE* getFile() throw() { return a_file; } + FILE* getFile() { return a_file; } /** Devuelve \em true si el fichero indicado en el constructor puede ser tratado @@ -40,18 +40,18 @@ public: \return \em true si el fichero indicado en el constructor puede ser tratado \em false en otro caso. */ - bool isok() const throw() { return a_file != NULL; } + bool isok() const { return a_file != NULL; } /** Prepara esta instancia para trabajar con un nuevo archivo. \param filename Nombre del archivo con el que trabajar. */ - void open(const std::string& filename) throw(anna::RuntimeException); + void open(const std::string& filename) noexcept(false); /** Libera los recursos del fichero. */ - void close() throw(); + void close() ; protected: FILE* a_file; @@ -82,7 +82,7 @@ protected: * Verifica que el fichero fué abierto correctamente. * \warning Exclusivamente de uso interno. */ - void verify() throw(RuntimeException); + void verify() noexcept(false); private: const std::string a_filename; diff --git a/include/anna/io/BinaryReader.hpp b/include/anna/io/BinaryReader.hpp index 0529f22..3fd15b7 100644 --- a/include/anna/io/BinaryReader.hpp +++ b/include/anna/io/BinaryReader.hpp @@ -52,7 +52,7 @@ public: Devuelve el contenido de la línea actual o NULL si se ha llegado al fin del fichero. \return El contenido de la línea actual o NULL si se ha llegado al fin del fichero. */ - const DataBlock* fetch() throw(anna::RuntimeException); + const DataBlock* fetch() noexcept(false); private: const int a_blockSize; diff --git a/include/anna/io/Directory.hpp b/include/anna/io/Directory.hpp index 2d43ef4..9145fba 100644 --- a/include/anna/io/Directory.hpp +++ b/include/anna/io/Directory.hpp @@ -34,7 +34,7 @@ namespace io { #include void f () - throw (anna::RuntimeException) + noexcept(false) { Directory dir; @@ -79,50 +79,50 @@ public: \param expression Expresion regular que deben cumplir los archivos. \warning Este metodo debe ser invocado antes de #read. */ - void setPattern(const char* expression) throw(RuntimeException); + void setPattern(const char* expression) noexcept(false); /** Elimina cualquier otro filtro que pudiera haber sido establecido mediante #setPattern. */ - void clearPattern() throw() { setPattern(NULL); } + void clearPattern() { setPattern(NULL); } /** Lee las entradas del directorio indicado como parametro. \param dirName Ruta al nombre de directorio. \param mode Forma de obtener el nombre del los archivos. */ - void read(const char* dirName, const Mode::_v mode) throw(RuntimeException); + void read(const char* dirName, const Mode::_v mode) noexcept(false); /** Lee las entradas del directorio indicado como parametro. \param dirName Ruta al nombre de directorio. \param mode Forma de obtener el nombre del los archivos. */ - void read(const std::string& dirName, const Mode::_v mode) throw(RuntimeException) { read(dirName.c_str(), mode); } + void read(const std::string& dirName, const Mode::_v mode) noexcept(false) { read(dirName.c_str(), mode); } /** Devuelve un iterador a la primera entrada del directorio. \return Un iterador a la primera entrada del directorio. */ - const_iterator begin() const throw() { return a_files.begin(); } + const_iterator begin() const { return a_files.begin(); } /** Devuelve un iterador a la ultima entrada del directorio. \return Un iterador a la utlima entrada del directorio. */ - const_iterator end() const throw() { return a_files.end(); } + const_iterator end() const { return a_files.end(); } /** Devuelve un iterador a la entrada del directorio que corresponde con el nombre indicado. \return un iterador a la entrada del directorio que corresponde con el nombre indicado. */ - const_iterator find(const std::string& file) const throw(); + const_iterator find(const std::string& file) const ; /** Devuelve la entrada referenciado por el iterador recibido. \return La entrada referenciado por el iterador recibido. */ - static const std::string& data(const_iterator& ii) throw() { return *ii; } + static const std::string& data(const_iterator& ii) { return *ii; } private: regex_t a_regex; diff --git a/include/anna/io/TextReader.hpp b/include/anna/io/TextReader.hpp index 555e71d..730fac6 100644 --- a/include/anna/io/TextReader.hpp +++ b/include/anna/io/TextReader.hpp @@ -53,7 +53,7 @@ public: Devuelve el contenido de la línea actual o NULL si se ha llegado al fin del fichero. \return El contenido de la línea actual o NULL si se ha llegado al fin del fichero. */ - const char* fetch() throw(anna::RuntimeException); + const char* fetch() noexcept(false); private: char* a_buffer; diff --git a/include/anna/io/functions.hpp b/include/anna/io/functions.hpp index f2a1eb3..7cfa648 100644 --- a/include/anna/io/functions.hpp +++ b/include/anna/io/functions.hpp @@ -27,49 +27,49 @@ struct functions { /** Crea el arbol de directorios recibido como parametro. */ - static void mkdir(const std::string& path) throw(RuntimeException); + static void mkdir(const std::string& path) noexcept(false); /** Indica si el PATH recibido como parametro existe o no. \return Devuelve \em true si el PATH recibido como parametro existe o \em false en otro caso. */ - static bool exists(const std::string& path) throw(RuntimeException) { return exists(path.c_str()); } + static bool exists(const std::string& path) noexcept(false) { return exists(path.c_str()); } /** Indica si el PATH recibido como parametro existe o no. \return Devuelve \em true si el PATH recibido como parametro existe o \em false en otro caso. */ - static bool exists(const char* path) throw(RuntimeException); + static bool exists(const char* path) noexcept(false); /** Indica si el PATH recibido como parametro es un directorio o no. \return Devuelve \em true si el PATH recibido como parametro es un directorio o \em false en otro caso. */ - static bool isADirectory(const std::string& path) throw(RuntimeException) { return isADirectory(path.c_str()); } + static bool isADirectory(const std::string& path) noexcept(false) { return isADirectory(path.c_str()); } /** Indica si el PATH recibido como parametro es un directorio o no. \return Devuelve \em true si el PATH recibido como parametro es un directorio o \em false en otro caso. */ - static bool isADirectory(const char* path) throw(RuntimeException); + static bool isADirectory(const char* path) noexcept(false); /** * Devuelve el i-nodo asociado al nombre de fichero de recibido como parámetro. * \param path Ruta completa del fichero a comprobar. * \return El nº de i-nodo asociado al fichero */ - static ino_t getINode(const std::string& path) throw(RuntimeException) { return getINode(path.c_str()); } + static ino_t getINode(const std::string& path) noexcept(false) { return getINode(path.c_str()); } /** * Devuelve el i-nodo asociado al nombre de fichero de recibido como parámetro. * \param path Ruta completa del fichero a comprobar. * \return El nº de i-nodo asociado al fichero */ - static ino_t getINode(const char* path) throw(RuntimeException); + static ino_t getINode(const char* path) noexcept(false); /** * Espera a que haya actividad de entrada en el fd recibido como parámetro. @@ -77,7 +77,7 @@ struct functions { * \param timeout Número máximo de milisegundos que puede quedar a la espera. Si vale 0 no realiza ninguna espera. * \return \em true si el proceso detecta actividad o \em false si se cumplió el timeout sin recibir información. */ - static bool waitInput(const int fd, const Millisecond&) throw(RuntimeException); + static bool waitInput(const int fd, const Millisecond&) noexcept(false); }; } diff --git a/include/anna/io/internal/sccs.hpp b/include/anna/io/internal/sccs.hpp index 409d89f..6373d8b 100644 --- a/include/anna/io/internal/sccs.hpp +++ b/include/anna/io/internal/sccs.hpp @@ -15,7 +15,7 @@ namespace io { class sccs { public: - static void activate() throw(); + static void activate() ; }; } diff --git a/include/anna/ldap/Attribute.hpp b/include/anna/ldap/Attribute.hpp index fde5c79..0447c75 100644 --- a/include/anna/ldap/Attribute.hpp +++ b/include/anna/ldap/Attribute.hpp @@ -36,19 +36,19 @@ public: Devuelve el nombre del atributo. \return El nombre del atributo. */ - const std::string& getName() const throw() { return a_name; } + const std::string& getName() const { return a_name; } /** Devuelve el iterador al comienzo de la lista de valores asociados a este atributo. \return El iterador al comienzo de la lista de valores asociados a este atributo. */ - const_value_iterator value_begin() const throw() { return a_values.begin(); } + const_value_iterator value_begin() const { return a_values.begin(); } /** Devuelve el iterador al final de la lista de valores asociados a este atributo. \return El iterador al final de la lista de valores asociados a este atributo. */ - const_value_iterator value_end() const throw() { return a_values.end(); } + const_value_iterator value_end() const { return a_values.end(); } /** Devuelve el valor asociado al iterador recibido como parametro. @@ -56,7 +56,7 @@ public: entre [#value_begin, #value_end). \return El valor referenciado por el iterador. */ - static const std::string& value(const_value_iterator ii) throw() { return *value_container::data(ii); } + static const std::string& value(const_value_iterator ii) { return *value_container::data(ii); } private: std::string a_name; @@ -64,13 +64,13 @@ private: Attribute() {;} - void setName(const std::string& name) throw() { a_name = name; } + void setName(const std::string& name) { a_name = name; } - void add(const std::string& value) throw(RuntimeException) { + void add(const std::string& value) noexcept(false) { std::string* newValue = a_values.create(); *newValue = value; } - void clear() throw() { a_name.clear(); a_values.clear(); } + void clear() { a_name.clear(); a_values.clear(); } friend class Session; friend class Response; diff --git a/include/anna/ldap/ClassCode.hpp b/include/anna/ldap/ClassCode.hpp index da042cc..692f2e9 100644 --- a/include/anna/ldap/ClassCode.hpp +++ b/include/anna/ldap/ClassCode.hpp @@ -32,7 +32,7 @@ struct ClassCode { \param v Codigo de tipo de clase a traducir. \return Una cadena que identifica el tipo de clase. */ - static std::string asString(const _v v) throw(); + static std::string asString(const _v v) ; }; } diff --git a/include/anna/ldap/Engine.hpp b/include/anna/ldap/Engine.hpp index ea035d0..91c392e 100644 --- a/include/anna/ldap/Engine.hpp +++ b/include/anna/ldap/Engine.hpp @@ -37,9 +37,9 @@ class Session; private: anna::Recycler a_sessions; - anna::ldap::Session* allocateSession (const int category) throw () { return a_sessions.create (); } + anna::ldap::Session* allocateSession (const int category) { return a_sessions.create (); } - void releaseSession (anna::ldap::Session* session) throw () { + void releaseSession (anna::ldap::Session* session) { MySession* aux = static_cast (session); a_sessions.release (aux); } @@ -59,7 +59,7 @@ public: * Devuelve el valor del indicador de conexión automática. Por defecto este indicador será \em true. * \return el valor del indicador de conexión automática. */ - bool getAutoBind() const throw() { return a_autoBind; } + bool getAutoBind() const { return a_autoBind; } /** * Establece el indicador de conexión automática. En caso de no indicarse será \em true. @@ -69,7 +69,7 @@ public: * crearla sin conexión automática, cambiar el temporizador asociado e invocar al Bind invocando * implícitamente al método ldap::Session::bind. */ - void setAutoBind(const bool autoBind) throw() { a_autoBind = autoBind; } + void setAutoBind(const bool autoBind) { a_autoBind = autoBind; } /** Crea o reusa una sesión LDAP con los parámetros recibidos. @@ -97,7 +97,7 @@ public: realizado correctamente. */ Session* createSession(const char* url, const char* user, const char* password, const int category = 0) - throw(RuntimeException); + noexcept(false); /** Crea o reusa una sesión LDAP con los parámetros recibidos. @@ -126,7 +126,7 @@ public: realizado correctamente. */ Session* createSession(const char* url, const int id, const char* user, const char* password, const int category = 0) - throw(RuntimeException); + noexcept(false); /** Crea o reusa una sesión LDAP con los parámetros recibidos a un servidor que no requiera identificar @@ -149,7 +149,7 @@ public: correspondiente en el metodo Session::eventResponse confirmando que el ClassCode::Bind se ha realizado correctamente. */ - Session* createSession(const char* url, const int category = 0) throw(RuntimeException) { + Session* createSession(const char* url, const int category = 0) noexcept(false) { return createSession(url, NULL, NULL, category); } @@ -164,7 +164,7 @@ public: \warning Si no hay ninguna sesión identificada por la pareja (url, user) se devolvera una excepción. */ - Session* findSession(const char* url, const char* user, Exception::Mode::_v emode = Exception::Mode::Throw) throw(RuntimeException); + Session* findSession(const char* url, const char* user, Exception::Mode::_v emode = Exception::Mode::Throw) noexcept(false); /** Devuelve la instancia de la sesión identificada por la pareja (url, id) recibidos como parámetros. @@ -177,7 +177,7 @@ public: \warning Si no hay ninguna sesión identificada por la pareja (url, id) se devolvera una excepción. */ - Session* findSession(const char* url, const int id, Exception::Mode::_v emode = Exception::Mode::Throw) throw(RuntimeException); + Session* findSession(const char* url, const int id, Exception::Mode::_v emode = Exception::Mode::Throw) noexcept(false); /** Devuelve la instancia de la sesión identificada por la pareja (url, user="") recibidos como parámetros. @@ -189,7 +189,7 @@ public: \warning Si no hay ninguna sesión identificada por la pareja (url, user) se devolvera una excepción. */ - Session* findSession(const char* url, Exception::Mode::_v emode = Exception::Mode::Throw) throw(RuntimeException) { + Session* findSession(const char* url, Exception::Mode::_v emode = Exception::Mode::Throw) noexcept(false) { return findSession(url, (const char*) NULL, emode); } @@ -198,20 +198,20 @@ public: * fuera NULL esta operación no tendrá ningún efecto. * \param session Session LDAP a liberar. */ - void closeSession(Session* session) throw(RuntimeException); + void closeSession(Session* session) noexcept(false); /** Devuelve un documento XML con la informacion relevante sobre esta instancia. \param parent Nodo XML del que colgar la informacion referente a esta instancia. \return Un documento XML con la informacion relevante sobre esta instancia. */ - virtual xml::Node* asXML(xml::Node* parent) const throw(); + virtual xml::Node* asXML(xml::Node* parent) const ; /** Devuelve el nombre lógico de este anna::app::Component. \return El nombre lógico de este anna::app::Component. */ - static const char* getClassName() throw() { return "anna::ldap::Engine"; } + static const char* getClassName() { return "anna::ldap::Engine"; } /** * Establece el nivel de depuración de las operaciones del OpenLDAP. @@ -221,7 +221,7 @@ public: * \see http://www.openldap.org/doc/admin23/runningslapd.html para más niveles. * \see DebugLevel */ - static int setDebugLevel(const int level) throw(RuntimeException); + static int setDebugLevel(const int level) noexcept(false); protected: /** @@ -241,7 +241,7 @@ protected: \see anna::Recycler */ - virtual Session* allocateSession(const int category) throw() = 0; + virtual Session* allocateSession(const int category) = 0; /** Metodo invocado para liberar sesiónes. En caso de que nuestra aplicacion requiera varios tipos de @@ -249,7 +249,7 @@ protected: el tipo adecuado de sesión. \see anna::Recycler */ - virtual void releaseSession(Session*) throw() = 0; + virtual void releaseSession(Session*) = 0; private: typedef std::pair session_key; @@ -262,29 +262,29 @@ private: std::string a_auxURL; // Usada para contenar el ldap:// si fuera necesario bool a_autoBind; - void do_initialize() throw() {;} - void do_stop() throw(); + void do_initialize() {;} + void do_stop() ; - const char* completeURL(const char* url) throw(); + const char* completeURL(const char* url) ; - session_iterator session_find(const char* url, const char* user) throw() { + session_iterator session_find(const char* url, const char* user) { return a_sessions.find(session_key(url, user)); } - session_iterator session_find(const std::string& url, const std::string& user) throw() { + session_iterator session_find(const std::string& url, const std::string& user) { return a_sessions.find(session_key(url, user)); } - session_iterator session_find(const char* url, const int id) throw(); + session_iterator session_find(const char* url, const int id) ; - session_iterator session_begin() throw() { return a_sessions.begin(); } - session_iterator session_end() throw() { return a_sessions.end(); } - static Session* session(session_iterator ii) throw() { return ii->second; } + session_iterator session_begin() { return a_sessions.begin(); } + session_iterator session_end() { return a_sessions.end(); } + static Session* session(session_iterator ii) { return ii->second; } - const_session_iterator session_begin() const throw() { return a_sessions.begin(); } - const_session_iterator session_end() const throw() { return a_sessions.end(); } - static const Session* session(const_session_iterator ii) throw() { return ii->second; } + const_session_iterator session_begin() const { return a_sessions.begin(); } + const_session_iterator session_end() const { return a_sessions.end(); } + static const Session* session(const_session_iterator ii) { return ii->second; } // Para el truco de poner a la alarma antes de invocar al ldap_result - static void alarmnCatcher(int) throw(); + static void alarmnCatcher(int) ; }; diff --git a/include/anna/ldap/Request.hpp b/include/anna/ldap/Request.hpp index cd58e20..c4bb3b7 100644 --- a/include/anna/ldap/Request.hpp +++ b/include/anna/ldap/Request.hpp @@ -36,13 +36,13 @@ public: Devuelve el tipo de la clase de esta peticion indicada en el contructor. \return El tipo de la clase de esta peticion indicada en el contructor. */ - ClassCode::_v getClassCode() const throw() { return a_classCode; } + ClassCode::_v getClassCode() const { return a_classCode; } /** * Devuelve la acción a realizar en caso de que el temporizador asociado a esta petición expire. * \return la acción a realizar en caso de que el temporizador asociado a esta petición expire. */ - OnExpiry::_v getOnExpiry() const throw() { return a_onExpiry; } + OnExpiry::_v getOnExpiry() const { return a_onExpiry; } /** * Establece la acción a realizar en caso de que el temporizador asociado a esta petición expire. @@ -50,25 +50,25 @@ public: * * \warning Establecer el valor OnExpiry::Ignore podría causar pérdida de memoria y uso innecesario de recursos. */ - void setOnExpiry(const OnExpiry::_v onExpiry) throw() { a_onExpiry = onExpiry; } + void setOnExpiry(const OnExpiry::_v onExpiry) { a_onExpiry = onExpiry; } /** Devuelve una cadena con la informacion mas relevante de esta instancia. \return Una cadena con la informacion mas relevante de esta instancia. */ - virtual std::string asString() const throw(); + virtual std::string asString() const ; /** Devuelve un documento XML con la informacion mas relevante de esta instancia. \param parent Nodo XML del que colgar la informacion referente a esta instancia. \return Un documento XML con la informacion mas relevante de esta instancia. */ - virtual xml::Node* asXML(xml::Node* parent) const throw(); + virtual xml::Node* asXML(xml::Node* parent) const ; /** Inicializa los parametros de esta peticion. */ - virtual void clear() throw() = 0; + virtual void clear() = 0; /** Devuelve \em NULL si la \em std::string recibida como parametro esta vacia o el contenido de la @@ -77,7 +77,7 @@ public: misma en otro caso. \warning Uso interno. */ - static const char* asCString(const std::string& value) throw() { + static const char* asCString(const std::string& value) { return (value.empty() == true) ? NULL : value.c_str(); } @@ -87,7 +87,7 @@ public: \return \em "" si la std::string recibida como parametro esta vacia o el contenido de la misma en otro caso. */ - static const char* asText(const std::string& value) throw() { + static const char* asText(const std::string& value) { return (value.empty() == true) ? "" : value.c_str(); } @@ -103,7 +103,7 @@ private: ClassCode::_v a_classCode; OnExpiry::_v a_onExpiry; - virtual IdMessage send(Session&) const throw() = 0; + virtual IdMessage send(Session&) const = 0; friend class Session; }; diff --git a/include/anna/ldap/Response.hpp b/include/anna/ldap/Response.hpp index 0a5247e..9284922 100644 --- a/include/anna/ldap/Response.hpp +++ b/include/anna/ldap/Response.hpp @@ -45,7 +45,7 @@ public: Devuelve el tipo de la clase de esta respuesta. \return El tipo de la clase de esta respuesta. */ - ClassCode::_v getClassCode() const throw() { return a_classCode; } + ClassCode::_v getClassCode() const { return a_classCode; } /** Devuelve la identificacion del mensaje LDAP. @@ -53,74 +53,74 @@ public: \return Identificacion del mensaje asociado a esta peticion/respuesta. \see ldap::Session::send */ - IdMessage getIdMessage() const throw() { return a_idMessage; } + IdMessage getIdMessage() const { return a_idMessage; } /** Devuelve la sesion que genera esta respuesta. \return La instancia de la sesion que genera esta respuesta. */ - const Session* getSession() const throw() { return a_session; } + const Session* getSession() const { return a_session; } /** Devuelve el resultado de la peticion LDAP solicitada. \return El resultado de la peticion LDAP solicitada. */ - const ResultCode& getResultCode() const throw() { return a_resultCode; } + const ResultCode& getResultCode() const { return a_resultCode; } /** Devuelve el nombre del DN asociado a esta peticion. \return El nombre del DN asociado a esta peticion. */ - const std::string& getName() const throw() { return a_name; } + const std::string& getName() const { return a_name; } /** Devuelve la peticion que origino la creacion de esta respuesta. \return La peticion que origino la creacion de esta respuesta. \see ldap::Session::send */ - const Request* getRequest()const throw() { return a_request; } + const Request* getRequest()const { return a_request; } /** Devuelve la sesion que origino la creacion de esta respuesta. \return La sesion que origino la creacion de esta respuesta. */ - Session* getSession() throw() { return a_session; } + Session* getSession() { return a_session; } /** * Devuelve el nº de atributos que contiene la respuesta. * \return el nº de atributos que contiene la respuesta. */ - int attribute_size() const throw() { return a_attributes.size(); } + int attribute_size() const { return a_attributes.size(); } /** Devuelve el iterador al comienzo de la lista de atributos asociados a esta respuesta. \return El iterador al comienzo de la lista de atributos asociados a esta respuesta. */ - const_attribute_iterator attribute_begin() const throw() { return a_attributes.begin(); } + const_attribute_iterator attribute_begin() const { return a_attributes.begin(); } /** Devuelve el iterador al final de la lista de atributos asociados a esta respuesta. \return El iterador al final de la lista de atributos asociados a esta respuesta. */ - const_attribute_iterator attribute_end() const throw() { return a_attributes.end(); } + const_attribute_iterator attribute_end() const { return a_attributes.end(); } /** * Devuelve el nº de referencias que contiene la respuesta. * \return el nº de referencias que contiene la respuesta. */ - int referral_size() const throw() { return a_referrals.size(); } + int referral_size() const { return a_referrals.size(); } /** Devuelve el iterador al comienzo de la lista de referencias asociados a esta respuesta. \return El iterador al comienzo de la lista de referencias asociados a esta respuesta. */ - const_referral_iterator referral_begin() const throw() { return a_referrals.begin(); } + const_referral_iterator referral_begin() const { return a_referrals.begin(); } /** Devuelve el iterador al final de la lista de referencias asociados a esta respuesta. \return El iterador al final de la lista de referencias asociados a esta respuesta. */ - const_referral_iterator referral_end() const throw() { return a_referrals.end(); } + const_referral_iterator referral_end() const { return a_referrals.end(); } /** Devuelve el atributo asociado al iterador recibido como parametro. @@ -128,7 +128,7 @@ public: entre [#attribute_begin, #attribute_end). \return El atributo referenciado por el iterador. */ - static const Attribute* attribute(const_attribute_iterator ii) throw() { return attribute_container::data(ii); } + static const Attribute* attribute(const_attribute_iterator ii) { return attribute_container::data(ii); } /** Devuelve la referencia asociada al iterador recibido como parametro. @@ -136,13 +136,13 @@ public: entre [#referral_begin, #referral_end). \return La referencia apuntada por el iterador. */ - static const std::string& referral(const_referral_iterator ii) throw() { return *referral_container::data(ii); } + static const std::string& referral(const_referral_iterator ii) { return *referral_container::data(ii); } /** Devuelve una cadena con la informacion relevante sobre esta instancia. \return Una cadena con la informacion relevante sobre esta instancia. */ - std::string asString() const throw(); + std::string asString() const ; private: ClassCode::_v a_classCode; @@ -160,29 +160,29 @@ private: Response(); - static Response* instance(const ClassCode::_v, const IdMessage) throw(RuntimeException); - static void release(Response* response) throw(); + static Response* instance(const ClassCode::_v, const IdMessage) noexcept(false); + static void release(Response* response) ; - void clear() throw(); + void clear() ; - void setName(const std::string& name) throw() { a_name = name; } - void setSession(Session* session) throw() { a_session = session; } - void setRequest(const Request* request) throw() { a_request = request; } - void activateTimer() throw(RuntimeException); - void cancelTimer() throw(); - void setResultCode(const ResultCode& resultCode) throw() { a_resultCode = resultCode; } + void setName(const std::string& name) { a_name = name; } + void setSession(Session* session) { a_session = session; } + void setRequest(const Request* request) { a_request = request; } + void activateTimer() noexcept(false); + void cancelTimer() ; + void setResultCode(const ResultCode& resultCode) { a_resultCode = resultCode; } - Attribute* createAttribute(const std::string& name) throw(RuntimeException); + Attribute* createAttribute(const std::string& name) noexcept(false); - void createReferral(const char* value) throw(RuntimeException) { + void createReferral(const char* value) noexcept(false) { std::string* newReferral = a_referrals.create(); *newReferral = value; } - attribute_iterator attribute_begin() throw() { return a_attributes.begin(); } - attribute_iterator attribute_end() throw() { return a_attributes.end(); } - static Attribute* attribute(attribute_iterator ii) throw() { return attribute_container::data(ii); } + attribute_iterator attribute_begin() { return a_attributes.begin(); } + attribute_iterator attribute_end() { return a_attributes.end(); } + static Attribute* attribute(attribute_iterator ii) { return attribute_container::data(ii); } friend class Session; friend class Allocator; diff --git a/include/anna/ldap/ResultCode.hpp b/include/anna/ldap/ResultCode.hpp index cdecea5..c1e77ae 100644 --- a/include/anna/ldap/ResultCode.hpp +++ b/include/anna/ldap/ResultCode.hpp @@ -34,7 +34,7 @@ public: Devuelve \em true si la respuesta recibida es correcta o \em false en otro caso. \return \em true si la respuesta recibida es correcta o \em false en otro caso. */ - bool isOk() const throw() { return a_value == 0; } + bool isOk() const { return a_value == 0; } /** Devuelve \em true si la respuesta recibida es un error debido a que las credenciales del usuario @@ -46,7 +46,7 @@ public: \warning El valor retornado por este método sólo tendrá validez en caso de que el método #isOk haya retornado \em false. */ - bool isInvalidCredential() const throw(); + bool isInvalidCredential() const ; /** Devuelve \em true si la resulta recibida es LDAP_OPERATIONS_ERROR o \em false en otro caso. @@ -56,7 +56,7 @@ public: \warning El valor retornado por este método sólo tendrá validez en caso de que el método #isOk haya retornado \em false. */ - bool isOperationsError() const throw(); + bool isOperationsError() const ; /** Devuelve \em true si la resulta recibida es LDAP_PROTOCOL_ERROR o \em false en otro caso. @@ -66,7 +66,7 @@ public: \warning El valor retornado por este método sólo tendrá validez en caso de que el método #isOk haya retornado \em false. */ - bool isProtocolError() const throw(); + bool isProtocolError() const ; /** Devuelve \em true si la resulta recibida es LDAP_TIMELIMIT_EXCEEDED o \em false en otro caso. @@ -76,7 +76,7 @@ public: \warning El valor retornado por este método sólo tendrá validez en caso de que el método #isOk haya retornado \em false. */ - bool isTimeLimitExceeded() const throw(); + bool isTimeLimitExceeded() const ; /** Devuelve \em true si la resulta recibida es LDAP_SIZELIMIT_EXCEEDED o \em false en otro caso. @@ -86,7 +86,7 @@ public: \warning El valor retornado por este método sólo tendrá validez en caso de que el método #isOk haya retornado \em false. */ - bool isSizeLimitExceeded() const throw(); + bool isSizeLimitExceeded() const ; /** Devuelve \em true si la resulta recibida es LDAP_AUTH_METHOD_NOT_SUPPORTED o \em false en otro caso. @@ -96,7 +96,7 @@ public: \warning El valor retornado por este método sólo tendrá validez en caso de que el método #isOk haya retornado \em false. */ - bool isAuthMethodNotSupported() const throw(); + bool isAuthMethodNotSupported() const ; /** Devuelve \em true si la resulta recibida es LDAP_STRONG_AUTH_REQUIRED o \em false en otro caso. @@ -106,7 +106,7 @@ public: \warning El valor retornado por este método sólo tendrá validez en caso de que el método #isOk haya retornado \em false. */ - bool isStrongAuthRequired() const throw(); + bool isStrongAuthRequired() const ; /** Devuelve \em true si la resulta recibida es LDAP_SASL_BIND_IN_PROGRESS o \em false en otro caso. @@ -116,7 +116,7 @@ public: \warning El valor retornado por este método sólo tendrá validez en caso de que el método #isOk haya retornado \em false. */ - bool isSASLBindInProgress() const throw(); + bool isSASLBindInProgress() const ; /** Devuelve \em true si la resulta recibida es un error de tipo LDAP_ATTR_ERROR o \em false en otro caso, @@ -128,7 +128,7 @@ public: \warning El valor retornado por este método sólo tendrá validez en caso de que el método #isOk haya retornado \em false. */ - bool isAttrError() const throw(); + bool isAttrError() const ; /** Devuelve \em true si la resulta recibida es un error de tipo LDAP_NAME_ERROR o \em false en otro caso. @@ -139,7 +139,7 @@ public: \warning El valor retornado por este método sólo tendrá validez en caso de que el método #isOk haya retornado \em false. */ - bool isNameError() const throw(); + bool isNameError() const ; /** Devuelve \em true si la resulta recibida es un error de tipo LDAP_SECURITY_ERROR o \em false en otro caso. @@ -153,7 +153,7 @@ public: \warning El valor retornado por este método sólo tendrá validez en caso de que el método #isOk haya retornado \em false. */ - bool isSecurityError() const throw(); + bool isSecurityError() const ; /** Devuelve \em true si la resulta recibida es un error de tipo LDAP_SERVICE_ERROR o \em false en otro caso. @@ -164,7 +164,7 @@ public: \warning El valor retornado por este método sólo tendrá validez en caso de que el método #isOk haya retornado \em false. */ - bool isServiceError() const throw(); + bool isServiceError() const ; /** Devuelve \em true si la resulta recibida es un error de tipo LDAP_TIMEOUT o \em false en otro caso. @@ -174,7 +174,7 @@ public: \warning El valor retornado por este método sólo tendrá validez en caso de que el método #isOk haya retornado \em false. */ - bool isTimeout() const throw(); + bool isTimeout() const ; /** Devuelve \em true si la resulta recibida es un error de tipo LDAP_UNAVAILABLE o \em false en otro caso. @@ -184,7 +184,7 @@ public: \warning El valor retornado por este método sólo tendrá validez en caso de que el método #isOk haya retornado \em false. */ - bool isUnavailable() const throw(); + bool isUnavailable() const ; /** Devuelve \em true si la resulta recibida es un error de tipo LDAP_SERVER_DOWN o \em false en otro caso. @@ -194,7 +194,7 @@ public: \warning El valor retornado por este método sólo tendrá validez en caso de que el método #isOk haya retornado \em false. */ - bool isServerDown() const throw(); + bool isServerDown() const ; /** Devuelve \em true si la resulta recibida es un error de tipo LDAP_LOCAL_ERROR o \em false en otro caso. @@ -204,7 +204,7 @@ public: \warning El valor retornado por este método sólo tendrá validez en caso de que el método #isOk haya retornado \em false. */ - bool isLocalError() const throw(); + bool isLocalError() const ; /** Devuelve \em true si la resulta recibida es un error de tipo LDAP_DECODING_ERROR o \em false en otro caso. @@ -214,7 +214,7 @@ public: \warning El valor retornado por este método sólo tendrá validez en caso de que el método #isOk haya retornado \em false. */ - bool isDecodingError() const throw(); + bool isDecodingError() const ; /** Devuelve \em true si la resulta recibida es un error de tipo LDAP_FILTER_ERROR o \em false en otro caso. @@ -224,7 +224,7 @@ public: \warning El valor retornado por este método sólo tendrá validez en caso de que el método #isOk haya retornado \em false. */ - bool isFilterError() const throw(); + bool isFilterError() const ; /** Devuelve \em true si la resulta recibida es un error de tipo LDAP_CONNECT_ERROR o \em false en otro caso. @@ -234,43 +234,43 @@ public: \warning El valor retornado por este método sólo tendrá validez en caso de que el método #isOk haya retornado \em false. */ - bool isConnectError() const throw(); + bool isConnectError() const ; /** Devuelve el codigo de error asociado a esta instancia. \return El codigo de error asociado a esta instancia. */ - int getValue() const throw() { return a_value; } + int getValue() const { return a_value; } /** Devuelve el texto explicativo del error asociado a esta instancia. \return El texto explicativo del error asociado a esta instancia. */ - const std::string& getText() const throw() { return a_text; } + const std::string& getText() const { return a_text; } /** Establece el codigo de error asociado a esta instancia. \param value Codigo de error */ -// void setValue (const int value) throw () { a_value = value; } +// void setValue (const int value) { a_value = value; } /** Establece el texto explicativo del error asociado a esta instancia. \param text Texto explicativo del error */ -// void setText (const std::string& text) throw () { a_text = text; } +// void setText (const std::string& text) { a_text = text; } /** Inicializa el codigo de error y el texto de esta instancia. */ - void clear() throw() { a_value = 0; a_text.clear(); } + void clear() { a_value = 0; a_text.clear(); } /** Operador copia. \param other Instancia de la que copiar. \return La instancia de el mismo despues de copiar los valores. */ - ResultCode& operator= (const ResultCode& other) throw() { + ResultCode& operator= (const ResultCode& other) { a_value = other.a_value; a_text = other.a_text; return *this; @@ -282,18 +282,18 @@ public: * \warning Si el valor de \em ldap_result no fue obtenido como resultado de ejecutar alguna operacion LDAP * el resultado de este método no está definido. */ - ResultCode& operator= (const int ldap_result) throw(); + ResultCode& operator= (const int ldap_result) ; - bool operator == (const int n) const throw() { return a_value == n; } - bool operator != (const int n) const throw() { return a_value != n; } - bool operator < (const int n) const throw() { return a_value < n; } - bool operator <= (const int n) const throw() { return a_value <= n; } + bool operator == (const int n) const { return a_value == n; } + bool operator != (const int n) const { return a_value != n; } + bool operator < (const int n) const { return a_value < n; } + bool operator <= (const int n) const { return a_value <= n; } /** Devuelve una cadena con la informacion relevante sobre esta instancia. \return Una cadena con la informacion relevante sobre esta instancia. */ - const std::string asString() const throw(); + const std::string asString() const ; private: int a_value; @@ -301,9 +301,9 @@ private: ResultCode(const int ldap_method_result); - void setValue(const int ldap_method_result, const int ldap_method_error) throw(); + void setValue(const int ldap_method_result, const int ldap_method_error) ; - bool extractResultCode(const Session*) throw(); + bool extractResultCode(const Session*) ; friend class Session; }; diff --git a/include/anna/ldap/Scope.hpp b/include/anna/ldap/Scope.hpp index 28eb905..9c28e8c 100644 --- a/include/anna/ldap/Scope.hpp +++ b/include/anna/ldap/Scope.hpp @@ -37,7 +37,7 @@ struct Scope { \param v Codigo de ambito a traducir. \return Una cadena que identifica el tipo de ambito. */ - static const char* asText(const Scope::_v v) throw(RuntimeException) { + static const char* asText(const Scope::_v v) noexcept(false) { return asCString(v); } }; diff --git a/include/anna/ldap/Search.hpp b/include/anna/ldap/Search.hpp index f7a2284..5ea0047 100644 --- a/include/anna/ldap/Search.hpp +++ b/include/anna/ldap/Search.hpp @@ -44,94 +44,94 @@ public: Devuelve el DN de la entrada en la que se comienza la busqueda. \return El DN de la entrada en la que se comienza la busqueda. */ - const std::string& getBase() const throw() { return a_base; } + const std::string& getBase() const { return a_base; } /** Devuelve el ambito de la busqueda. \return El ambito de la busqueda. */ - Scope::_v getScope() const throw() { return a_scope; } + Scope::_v getScope() const { return a_scope; } /** Devuelve el filtro aplicado a la busqueda. \return El filtro aplicado a la busqueda. */ - const std::string& getFilter() const throw() { return a_filter; } + const std::string& getFilter() const { return a_filter; } /** Devuelve el indicador de tratamiento de busquedas. \return El indicador de tratamiento de busquedas. */ - bool getOnlyType() const throw() { return a_onlyType; } + bool getOnlyType() const { return a_onlyType; } /** Devuelve el numero maximo de elementos devueltos como resultado de la consulta. \return El numero maximo de elementos devueltos como resultado de la consulta. \see clearSizeLimit. */ - int getSizeLimit() const throw() { return a_sizeLimit; } + int getSizeLimit() const { return a_sizeLimit; } /** Establece el DN de la entrada en la que comenzar la busqueda. \param base DN de la entrada en la que comenzar la busqueda. */ - void setBase(const std::string& base) throw() { a_base = base; } + void setBase(const std::string& base) { a_base = base; } /** Establece el ambito de la busqueda. \param scope Ambito de la busqueda. */ - void setScope(const Scope::_v scope) throw() { a_scope = scope; } + void setScope(const Scope::_v scope) { a_scope = scope; } /** Establece el ambito de la busqueda. \param scope Texto que identifica el ambito de la busqueda. Si no se trata de un texto reconocido se devolvera una excepcion. */ - void setScope(const char* scope) throw(RuntimeException) { a_scope = Scope::asEnumEx(scope); } + void setScope(const char* scope) noexcept(false) { a_scope = Scope::asEnumEx(scope); } /** Establece el filtro aplicado a la busqueda. \param filter Filtro aplicado a la busqueda. \see clearFilter */ - void setFilter(const std::string& filter) throw() { a_filter = filter; } + void setFilter(const std::string& filter) { a_filter = filter; } /** Determina como se van a tratar los atributos. \param onlyType Un valor \em true indica que solo se requieren los tipos de atributos, un valor \em false indica que se requieren tipos y valores asociados a los atributos. */ - void setOnlyType(const bool onlyType) throw() { a_onlyType = onlyType; } + void setOnlyType(const bool onlyType) { a_onlyType = onlyType; } /** Establece el numero maximo de elementos devueltos como resultado de la consulta. \param sizeLimit Numero de entradas retornadas por la busqueda. \see clearSizeLimit. */ - void setSizeLimit(const int sizeLimit) throw() { a_sizeLimit = sizeLimit; } + void setSizeLimit(const int sizeLimit) { a_sizeLimit = sizeLimit; } /** Elimina el filtro asociado a esta consulta. */ - void clearFilter() throw() { a_filter.clear(); } + void clearFilter() { a_filter.clear(); } /** Elimina el limite en cuanto al numero de elementos indicados en la consulta. */ - void clearSizeLimit() throw() { a_sizeLimit = 0; } + void clearSizeLimit() { a_sizeLimit = 0; } /** * Elimina los atributos asociados a esta consulta. */ - void clearAttributes() throw(); + void clearAttributes() ; /** Incorpora un elemento a la lista de atributos que deseamos obtener de cada una de las entradas que cumplen el filtro establecido. Si esta lista esta vacia se devolvera la informacion de todos los atributos implicados. */ - void addAttribute(const std::string& attribute) throw() { + void addAttribute(const std::string& attribute) { std::string* newString = st_attributes.create(); *newString = attribute; a_attributes.push_back(newString); @@ -140,45 +140,45 @@ public: /** Inicializa el contenido de esta clase. */ - void clear() throw(); + void clear() ; /** Devuelve un iterador que apunta el primer atributo contenido en la consulta. \return un iterador que apunta el primer atributo contenido en la consulta. */ - const_attribute_iterator attribute_begin() const throw() { return a_attributes.begin(); } + const_attribute_iterator attribute_begin() const { return a_attributes.begin(); } /** Devuelve un iterador que apunta el ultimo atributo contenido en la consulta. \return un iterador que apunta el ultimo atributo contenido en la consulta. */ - const_attribute_iterator attribute_end() const throw() { return a_attributes.end(); } + const_attribute_iterator attribute_end() const { return a_attributes.end(); } /** Devuelve el numero de atributos contenidos en la consulta. \return El numero de atributos contenidos en la consulta. */ - int attribute_size() const throw() { return a_attributes.size(); } + int attribute_size() const { return a_attributes.size(); } /** Devuelve el atributo apuntado por el iterador recibido. \param ii Iterador con el que estamos recorriendo los atributos. \return El atributo apuntado por el iterador recibido. */ - static const std::string& attribute(const_attribute_iterator ii) throw() { return **ii; } + static const std::string& attribute(const_attribute_iterator ii) { return **ii; } /** Devuelve una cadena con la informacion referente a este objeto. \return Una cadena con la informacion referente a este objeto. */ - virtual std::string asString() const throw(); + virtual std::string asString() const ; /** Devuelve un nodo XML con la informacion referente a este objeto. \param parent Nodo XML a partir del cual introducir la informacion. \return Un nodo XML con la informacion referente a este objeto. */ - virtual xml::Node* asXML(xml::Node* parent) const throw(); + virtual xml::Node* asXML(xml::Node* parent) const ; private: std::string a_base; @@ -190,12 +190,12 @@ private: static attribute_pool st_attributes; - attribute_iterator attribute_begin() throw() { return a_attributes.begin(); } - attribute_iterator attribute_end() throw() { return a_attributes.end(); } - int attribute_size() throw() { return a_attributes.size(); } - static std::string& attribute(attribute_iterator ii) throw() { return **ii; } + attribute_iterator attribute_begin() { return a_attributes.begin(); } + attribute_iterator attribute_end() { return a_attributes.end(); } + int attribute_size() { return a_attributes.size(); } + static std::string& attribute(attribute_iterator ii) { return **ii; } - IdMessage send(Session&) const throw(); + IdMessage send(Session&) const ; }; } diff --git a/include/anna/ldap/Session.hpp b/include/anna/ldap/Session.hpp index a84b5be..fc8090f 100644 --- a/include/anna/ldap/Session.hpp +++ b/include/anna/ldap/Session.hpp @@ -83,49 +83,49 @@ public: Devuelve la direccion del servidor LDAP. Coincidira con la indicada en ldap::Engine::createSession. \return La direccion del servidor LDAP. Coincidira con la indicada en ldap::Engine::createSession. */ - const std::string& getURL() const throw() { return a_url; } + const std::string& getURL() const { return a_url; } /** Devuelve el usuario de esta sesion. Coincidira con la indicada en ldap::Engine::createSession. \return El usuario de esta sesion. Coincidira con la indicada en ldap::Engine::createSession. */ - const std::string& getUser() const throw() { return a_user; } + const std::string& getUser() const { return a_user; } /** Devuelve el password de esta sesion. Coincidira con la indicada en ldap::Engine::createSession. \return El password de esta sesion. Coincidira con la indicada en ldap::Engine::createSession. */ - const std::string& getPassword() const throw() { return a_password; } + const std::string& getPassword() const { return a_password; } /** Devuelve la categoria de esta sesion. Coincidira con la indicada en ldap::Engine::createSession. \return La categoria de esta sesion. Coincidira con la indicada en ldap::Engine::createSession. */ - int getCategory() const throw() { return a_category; } + int getCategory() const { return a_category; } /** * Devuelve la clave externa con la que fué creada esta sesión. */ - int getExternalID() const throw() { return a_externalID; } + int getExternalID() const { return a_externalID; } /** Devuelve el manejador usado para conectar con el servidor LDAP. \warning Exclusivamente uso interno. */ - void* getLDAP() throw() { return a_ldap; } + void* getLDAP() { return a_ldap; } /** * Devuelve el fd asociado a esta sesión de LDAP. * \return el fd asociado a esta sesión de LDAP. * \warning Las operaciones sobre este fd podrían influir negativamente en el sistema. */ - int getDangerousFileDescriptor() const throw(RuntimeException); + int getDangerousFileDescriptor() const noexcept(false); /** Devuelve el modo de interpretar las referencias establecido en esta sesion. \return El modo de interpretar las referencias establecido en esta sesion. */ - Option::Defer::_v getDefer() const throw() { return a_defer; } + Option::Defer::_v getDefer() const { return a_defer; } /** Devuelve \em true si la biblioteca LDAP realiza de forma automatica el siguimiento de las referencias @@ -133,26 +133,26 @@ public: \return \em true si la biblioteca LDAP realiza de forma automatica el siguimiento de las referencias retornadas por los servidores LDAP o \em false en otro caso. */ - Option::Referral::_v getReferral() const throw() { return a_referral; } + Option::Referral::_v getReferral() const { return a_referral; } /** Devuelve el estado de esta sesion. \return El estado de esta sesion. */ - State::_v getState() const throw() { return a_state; } + State::_v getState() const { return a_state; } /** * Devuelve el periodo de espera establecido para las peticiones del tipo \em v. * \return el periodo de espera establecido para las peticiones del tipo \em v. */ - const Millisecond &getTimeout(const ClassCode::_v v) const throw() { return a_timeouts [v]; } + const Millisecond &getTimeout(const ClassCode::_v v) const { return a_timeouts [v]; } /** * Devuelve el valor establecido en #setNetworkTimeout * \return Los miligundos establecidos por #setNetworkTimeout. * \warning El valor retornado sólo tendrá valided si #hasNetworkTimeout devolvió \em true. */ - Millisecond getNetworkTimeout() const throw() { + Millisecond getNetworkTimeout() const { Millisecond result(1000 * a_networkTimeout.tv_sec); return Millisecond(result + a_networkTimeout.tv_usec / 1000); } @@ -161,7 +161,7 @@ public: * Devuelve \em true si se estableció el tiempo de espera de conexión o \em false en otro caso. * \return \em true si se estableció el tiempo de espera de conexión o \em false en otro caso. */ - bool hasNetworkTimeout() const throw() { return a_networkTimeout.tv_sec != -1; } + bool hasNetworkTimeout() const { return a_networkTimeout.tv_sec != -1; } /** Solicita la conexion al servidor asociado a esta sesion. @@ -169,25 +169,25 @@ public: \warning Solo deberia invocarse directamente este metodo en caso de que el #eventResponse notifique no ha sido posible contactar con el servidor indicado. */ - void bind() throw(RuntimeException); + void bind() noexcept(false); /** Devuelve \em true si la sesion esta conectada al servidor LDAP o \em false en otro caso. \return \em true si la sesion esta conectada al servidor LDAP o \em false en otro caso. */ - bool isBound() const throw() { return a_state == State::Bound; } + bool isBound() const { return a_state == State::Bound; } /** Establece el modo de interpretar las referencias. \param defer Indica el modo de interpretar las referencias. */ - void setOption(const Option::Defer::_v defer) throw() { a_defer = defer; } + void setOption(const Option::Defer::_v defer) { a_defer = defer; } /** Establece el modo en que la biblioteca LDAP actua a la hora de realizar el siguimiento de las referencias. \param referral Indica el modo de realizar el seguimiento de las referncias. */ - void setOption(const Option::Referral::_v referral) throw() { a_referral = referral; } + void setOption(const Option::Referral::_v referral) { a_referral = referral; } /** * Establece el periodo de tiempo máximo que esperará la conexión a un servidor LDAP antes de considerar que @@ -198,7 +198,7 @@ public: * \see http://manpages.courier-mta.org/htmlman3/ldap_get_option.3.html * \warning Sólo tiene efecto antes de invocar al #bind, por lo que habrá que desactivar la auto conexión, para establecer el valor. */ - void setNetworkTimeout(const Millisecond &timeout) throw() { a_networkTimeout.tv_sec = timeout / 1000; a_networkTimeout.tv_usec = (timeout % 1000) * 1000; } + void setNetworkTimeout(const Millisecond &timeout) { a_networkTimeout.tv_sec = timeout / 1000; a_networkTimeout.tv_usec = (timeout % 1000) * 1000; } /** * Elimina el tiempo asignado en #setNetworkTimeout. @@ -206,7 +206,7 @@ public: * \see http://manpages.courier-mta.org/htmlman3/ldap_get_option.3.html * \warning Sólo tiene efecto antes de invocar al #bind */ - void clearNetworkTimeout() throw() { a_networkTimeout.tv_sec = -1; a_networkTimeout.tv_usec = 0; } + void clearNetworkTimeout() { a_networkTimeout.tv_sec = -1; a_networkTimeout.tv_usec = 0; } /** Establece el tiempo de espera maximo antes de considerar fallida una peticion LDAP. @@ -216,7 +216,7 @@ public: Los temporizadores correspondientes las peticiones LDAP se activaran automaticamente al invocar a los distintos métodos de esta clase. */ - void setTimeout(const ClassCode::_v v, const Millisecond &millisecond) throw() { a_timeouts [v] = millisecond; } + void setTimeout(const ClassCode::_v v, const Millisecond &millisecond) { a_timeouts [v] = millisecond; } /** Envia la peticion recibida como parametro al servidor con el que estamos conectados mediante esta @@ -231,7 +231,7 @@ public: \return La instancia de la respuesta LDAP asociada la peticion realizada. \warning Solo se podra hacer uso de este metodo cuando el metodo #isBound devuelva \em true. */ - const Response* send(const Request* request) throw(RuntimeException); + const Response* send(const Request* request) noexcept(false); /** Envia la peticion recibida como parametro al servidor con el que estamos conectados mediante esta @@ -246,7 +246,7 @@ public: \return La instancia de la respuesta LDAP asociada la peticion realizada. \warning Solo se podra hacer uso de este metodo cuando el metodo #isBound devuelva \em true. */ - const Response* send(const Request& request) throw(RuntimeException) { return send(&request); } + const Response* send(const Request& request) noexcept(false) { return send(&request); } /** * Desconecta este cliente LDAP del servidor LDAP. @@ -255,20 +255,20 @@ public: * \warning Después de invocar a este método habría que volver a invocar a ldap::Session::bind y esperar la conexión * antes de volver a usar esta sessión. */ - void unbind() throw(RuntimeException); + void unbind() noexcept(false); /** Devuelve una cadena con la informacion relevante sobre esta instancia. \return Una cadena con la informacion relevante sobre esta instancia. */ - std::string asString() const throw(); + std::string asString() const ; /** Devuelve un documento XML con la informacion relevante sobre esta instancia. \param parent Nodo XML del que colgar la informacion referente a esta instancia. \return Un documento XML con la informacion relevante sobre esta instancia. */ - xml::Node* asXML(xml::Node* parent) const throw(); + xml::Node* asXML(xml::Node* parent) const ; protected: /** @@ -284,14 +284,14 @@ protected: Una vez que se ha notificado la caida de la sesion, el nucleo de ANNA.ldap genera un ldap::Session::eventResponse para cada una de las peticiones que hay pendientes de contestar. */ - virtual void eventServerShutdown() throw() {;} + virtual void eventServerShutdown() {;} /** Metodo-manejador de las respuestas provenientes del servidor LDAP. \param response Objeto que contiene la respuesta correspondiente a la peticion LDAP realizada. */ - virtual void eventResponse(const Response& response) throw(RuntimeException) = 0; + virtual void eventResponse(const Response& response) noexcept(false) = 0; /** Metodo-manejador de los errores provenientes del servidor LDAP. @@ -299,7 +299,7 @@ protected: \param disconnect Incicador que informa al nivel de aplicación sobre cómo actuará la ANNA.ldap para recuperar este error, si vale \em true la conexión se cerrará o \em false en otro caso. */ - virtual void eventResponseError(const ResultCode& resultCode, const bool disconnect) throw() {;} + virtual void eventResponseError(const ResultCode& resultCode, const bool disconnect) {;} /** * Método-manejador que se invoca cuando alguno de los mensajes intermedios requeridos para formar @@ -307,11 +307,11 @@ protected: * \param response Objeto que contiene la respuesta correspondiente a la peticion LDAP realizada. */ - virtual void eventIntermediateResponseError(const Response& response) throw() {;} + virtual void eventIntermediateResponseError(const Response& response) {;} private: struct SortById { - static IdMessage value(const Response*) throw(); + static IdMessage value(const Response*) ; }; typedef SortedVector response_container; typedef response_container::iterator response_iterator; @@ -338,28 +338,28 @@ private: */ std::string a_keymap; - void apply() throw(RuntimeException); - void receiveBind(const IdMessage, HandleMessage) throw(RuntimeException); - void receiveEntry(const IdMessage, HandleMessage) throw(RuntimeException); - void receiveReference(const IdMessage, HandleMessage) throw(RuntimeException); - void receiveResult(const IdMessage, HandleMessage) throw(RuntimeException); - void expireResponse(Response*) throw(); + void apply() noexcept(false); + void receiveBind(const IdMessage, HandleMessage) noexcept(false); + void receiveEntry(const IdMessage, HandleMessage) noexcept(false); + void receiveReference(const IdMessage, HandleMessage) noexcept(false); + void receiveResult(const IdMessage, HandleMessage) noexcept(false); + void expireResponse(Response*) ; - void finalize() throw(); + void finalize() ; - response_iterator response_begin() throw() { return a_responses.begin(); } - response_iterator response_end() throw() { return a_responses.end(); } - void response_add(Response* response) throw(); - void response_erase(Response* response) throw(); - Response* response_find(const IdMessage idMessage) throw(RuntimeException); + response_iterator response_begin() { return a_responses.begin(); } + response_iterator response_end() { return a_responses.end(); } + void response_add(Response* response) ; + void response_erase(Response* response) ; + Response* response_find(const IdMessage idMessage) noexcept(false); - static Response* response(response_iterator ii) throw() { return response_container::data(ii); } + static Response* response(response_iterator ii) { return response_container::data(ii); } - const_response_iterator response_begin() const throw() { return a_responses.begin(); } - const_response_iterator response_end() const throw() { return a_responses.end(); } - static const Response* response(const_response_iterator ii) throw() { return response_container::data(ii); } + const_response_iterator response_begin() const { return a_responses.begin(); } + const_response_iterator response_end() const { return a_responses.end(); } + static const Response* response(const_response_iterator ii) { return response_container::data(ii); } - static const char* asText(const State::_v) throw(); + static const char* asText(const State::_v) ; friend class Timer; friend class Engine; diff --git a/include/anna/ldap/TimerManager.hpp b/include/anna/ldap/TimerManager.hpp index 069c468..f17702b 100644 --- a/include/anna/ldap/TimerManager.hpp +++ b/include/anna/ldap/TimerManager.hpp @@ -44,10 +44,10 @@ class TimerManager : public timex::TimeEventObserver, public Singleton ; friend class Response; diff --git a/include/anna/ldap/internal/Timer.hpp b/include/anna/ldap/internal/Timer.hpp index 0cb6803..5b5bc30 100644 --- a/include/anna/ldap/internal/Timer.hpp +++ b/include/anna/ldap/internal/Timer.hpp @@ -22,16 +22,16 @@ class TimerManager; class Timer : public timex::Transaction { public: - Response* getResponse() throw() { return reinterpret_cast (getContext()); } - const Response* getResponse() const throw() { return reinterpret_cast (getContext()); } + Response* getResponse() { return reinterpret_cast (getContext()); } + const Response* getResponse() const { return reinterpret_cast (getContext()); } - std::string asString() const throw(); + std::string asString() const ; private: Timer() {;} - void setResponse(Response* response) throw() { setContext(response); } - void expire(timex::Engine*) throw(RuntimeException); + void setResponse(Response* response) { setContext(response); } + void expire(timex::Engine*) noexcept(false); friend class ldap::TimerManager; friend class Allocator; diff --git a/include/anna/ldap/internal/sccs.hpp b/include/anna/ldap/internal/sccs.hpp index b4b6356..61592c4 100644 --- a/include/anna/ldap/internal/sccs.hpp +++ b/include/anna/ldap/internal/sccs.hpp @@ -15,7 +15,7 @@ namespace ldap { class sccs { public: - static void activate() throw(); + static void activate() ; }; } diff --git a/include/anna/statistics/Accumulator.hpp b/include/anna/statistics/Accumulator.hpp index d86c65f..6c76c78 100644 --- a/include/anna/statistics/Accumulator.hpp +++ b/include/anna/statistics/Accumulator.hpp @@ -88,18 +88,18 @@ class Accumulator { std::string a_name; - void initialize(const int & conceptId) throw(); - _concept_data_t * getConcept(const int & conceptId) const throw(anna::RuntimeException); + void initialize(const int & conceptId) ; + _concept_data_t * getConcept(const int & conceptId) const noexcept(false); // Gets the data structure for a existing concept Id. // Initializes and returns the new data structure for a new stored concept Id which is valid (exists for the engine). // Launch exception if concept id is not a valid concept registered at Engine. /*mutable */_concept_data_map_t a_concept_data_map; - std::string floatFormat(const int & numberOfDecimals) const throw(); + std::string floatFormat(const int & numberOfDecimals) const ; - double getStandardDeviation(const _concept_data_t * conceptData) const throw(anna::RuntimeException); - double getBesselStandardDeviation(const _concept_data_t * conceptData) const throw(anna::RuntimeException); + double getStandardDeviation(const _concept_data_t * conceptData) const noexcept(false); + double getBesselStandardDeviation(const _concept_data_t * conceptData) const noexcept(false); public: @@ -122,7 +122,7 @@ public: * * @param name Name provided */ - void setName(const std::string &name) throw() { a_name = name; } + void setName(const std::string &name) { a_name = name; } /** * Adds a new statistic concept through the accumulator, to ease the concept name creation, @@ -139,7 +139,7 @@ public: * * @return Assigned concept identification number (sequence) */ - int addConcept(const std::string & description, const std::string & unit, const bool & integerNatureSample = true, const char *conceptNameFormat = "%s [%s]") throw(); + int addConcept(const std::string & description, const std::string & unit, const bool & integerNatureSample = true, const char *conceptNameFormat = "%s [%s]") ; /** * Process new value for the sample regarding a concept identifier previously registered through the engine. @@ -149,7 +149,7 @@ public: * * @see reset() */ - void process(const int & conceptId, const double & value) throw(anna::RuntimeException); + void process(const int & conceptId, const double & value) noexcept(false); /** @@ -157,7 +157,7 @@ public: * * @see process() */ - void reset(void) throw(); + void reset(void) ; /** @@ -167,7 +167,7 @@ public: * * @see process() */ - void reset(const int & conceptId) throw(anna::RuntimeException); + void reset(const int & conceptId) noexcept(false); /** @@ -188,7 +188,7 @@ public: * * @result Accumulator name */ - const std::string &getName() const throw() { return a_name; } + const std::string &getName() const { return a_name; } /** * Gets current sample size for any concept id @@ -200,7 +200,7 @@ public: * @see getValue() * @see asXML() */ - unsigned long long int sampleSize(const int & conceptId) const throw(anna::RuntimeException); + unsigned long long int sampleSize(const int & conceptId) const noexcept(false); /** @@ -214,7 +214,7 @@ public: * @see sampleSize() * @see asXML() */ - double getValue(const int & conceptId, const Operation::Type & operation) const throw(anna::RuntimeException); + double getValue(const int & conceptId, const Operation::Type & operation) const noexcept(false); /** @@ -224,7 +224,7 @@ public: * * @return String with class content */ - std::string asString(const int & numberOfDecimals = 2) const throw(); + std::string asString(const int & numberOfDecimals = 2) const ; /** @@ -234,7 +234,7 @@ public: * * @return XML with class content */ - anna::xml::Node* asXML(anna::xml::Node* parent, const int & numberOfDecimals = 2) const throw(); + anna::xml::Node* asXML(anna::xml::Node* parent, const int & numberOfDecimals = 2) const ; }; } diff --git a/include/anna/statistics/Engine.hpp b/include/anna/statistics/Engine.hpp index 1852e1a..e0c9233 100644 --- a/include/anna/statistics/Engine.hpp +++ b/include/anna/statistics/Engine.hpp @@ -82,19 +82,19 @@ public: * * @return Assigned concept identification number (sequence) */ - int addConcept(const std::string & description, const std::string & unit, const bool & integerNatureSample = true) throw(); + int addConcept(const std::string & description, const std::string & unit, const bool & integerNatureSample = true) ; /** * Stops statistics engine */ - void enable(void) throw() { a_enabled = true; } + void enable(void) { a_enabled = true; } /** * Starts statistics engine */ - void disable(void) throw() { a_enabled = false; } + void disable(void) { a_enabled = false; } /** * Enable sample log for statistics processings. Engine starts with this feature disabled. When a new concept id is added @@ -109,7 +109,7 @@ public: * @return @em false if not concept is registered with provided id * @warning Many systems add concepts dynamically. This method only affects to current concepts registered at statistics engine. */ - bool enableSampleLog(const int & id = -1, const char *sampleFileName = NULL) throw(); + bool enableSampleLog(const int & id = -1, const char *sampleFileName = NULL) ; /** @@ -120,7 +120,7 @@ public: * @return @em false if not concept is registered with provided id * @warning Many systems add concepts dynamically. This method only affects to current concepts registered at statistics engine. */ - bool disableSampleLog(const int & id = -1) throw(); + bool disableSampleLog(const int & id = -1) ; // Gets @@ -134,13 +134,13 @@ public: * * @return @em false if not concept is registered with provided id */ - bool getConcept(const int & id, std::string & description, std::string & unit, bool & integerNatureSample) const throw(); + bool getConcept(const int & id, std::string & description, std::string & unit, bool & integerNatureSample) const ; /** * Boolean about engine state (enabled / disabled) */ - bool enabled(void) const throw() { return (a_enabled); } + bool enabled(void) const { return (a_enabled); } /** @@ -150,7 +150,7 @@ public: * * \return The accumulator created or exception when already exists for the provided name. */ - Accumulator *createAccumulator(const std::string &name) throw(anna::RuntimeException); + Accumulator *createAccumulator(const std::string &name) noexcept(false); /** * Returns accumulator instance identified by name. @@ -159,7 +159,7 @@ public: * * \return The accumulator instance identified by name provided, NULL if not found */ - Accumulator* getAccumulator(const std::string &name) throw(); + Accumulator* getAccumulator(const std::string &name) ; @@ -168,7 +168,7 @@ public: * * @return String with class content */ - std::string asString(void) const throw(); + std::string asString(void) const ; /** @@ -178,7 +178,7 @@ public: * * @return XML with class content */ - anna::xml::Node* asXML(anna::xml::Node* parent, const int & numberOfDecimals = 2) const throw(); + anna::xml::Node* asXML(anna::xml::Node* parent, const int & numberOfDecimals = 2) const ; private: @@ -191,7 +191,7 @@ private: int a_sequence_concept_id; anna::Mutex a_mutex; // for logSample - bool logSample(const int & conceptId, const anna::Millisecond & unixTimestamp, const double & value) const throw(); + bool logSample(const int & conceptId, const anna::Millisecond & unixTimestamp, const double & value) const ; friend class anna::Singleton ; friend class Accumulator; diff --git a/include/anna/statistics/Meter.hpp b/include/anna/statistics/Meter.hpp index 82f3ee3..c0bb9b9 100644 --- a/include/anna/statistics/Meter.hpp +++ b/include/anna/statistics/Meter.hpp @@ -59,13 +59,13 @@ public: /** * Sets the time control point for processing measure */ - void setControlPoint(void) throw() { a_meter.setControlPoint(); } + void setControlPoint(void) { a_meter.setControlPoint(); } /** * Reset sample */ - void reset(void) throw() { a_accumulator.reset(); } + void reset(void) { a_accumulator.reset(); } /** @@ -73,7 +73,7 @@ public: * * @return Returns processed delay */ - Millisecond process(void) throw() { a_accumulator.process(a_single_accumulator_concept_id, a_meter.getDelay()); return (a_meter.getDelay()); } + Millisecond process(void) { a_accumulator.process(a_single_accumulator_concept_id, a_meter.getDelay()); return (a_meter.getDelay()); } /** @@ -92,7 +92,7 @@ public: // /** // * Gets accumulator information in order to extract statistics indicators // */ -// const Accumulator & getAccumulator(void) const throw() { return (a_accumulator); } +// const Accumulator & getAccumulator(void) const { return (a_accumulator); } /** * Gets accumulator value information (statistics indicators) @@ -101,7 +101,7 @@ public: * * @return Value for solicited operation */ - double getAccumulatorValue(const Operation::Type &operation) const throw() { return (a_accumulator.getValue(a_single_accumulator_concept_id, operation)); } + double getAccumulatorValue(const Operation::Type &operation) const { return (a_accumulator.getValue(a_single_accumulator_concept_id, operation)); } /** @@ -111,7 +111,7 @@ public: * * @return String with class content */ - std::string asString(const int & numberOfDecimals = 2) const throw(); + std::string asString(const int & numberOfDecimals = 2) const ; /** @@ -121,7 +121,7 @@ public: * * @return XML with class content */ - anna::xml::Node* asXML(anna::xml::Node* parent, const int & numberOfDecimals = 2) const throw(); + anna::xml::Node* asXML(anna::xml::Node* parent, const int & numberOfDecimals = 2) const ; diff --git a/include/anna/statistics/internal/sccs.hpp b/include/anna/statistics/internal/sccs.hpp index ccf22ab..a2c4b62 100644 --- a/include/anna/statistics/internal/sccs.hpp +++ b/include/anna/statistics/internal/sccs.hpp @@ -15,7 +15,7 @@ namespace statistics { class sccs { public: - static void activate() throw(); + static void activate() ; }; } diff --git a/include/anna/test/Communicator.hpp b/include/anna/test/Communicator.hpp index e3b6a89..babdbfc 100644 --- a/include/anna/test/Communicator.hpp +++ b/include/anna/test/Communicator.hpp @@ -26,16 +26,16 @@ public: a_delay (0) {;} - void setDelay (const Millisecond delay) throw () { a_delay = delay; } - void setMaxMessage (const int maxMessage) throw () { a_maxMessage = maxMessage; } + void setDelay (const Millisecond delay) { a_delay = delay; } + void setMaxMessage (const int maxMessage) { a_maxMessage = maxMessage; } - int getMaxMessage () const throw () { return a_maxMessage; } - int getMessage () const throw () { return a_messageCounter; } + int getMaxMessage () const { return a_maxMessage; } + int getMessage () const { return a_messageCounter; } - bool canContinue (const comm::ClientSocket&) throw (RuntimeException); - void delay () throw (RuntimeException); + bool canContinue (const comm::ClientSocket&) noexcept(false); + void delay () noexcept(false); - void terminate () throw (); + void terminate () ; private: Millisecond a_delay; Millisecond a_initTime; @@ -44,7 +44,7 @@ private: int a_successCounter; Average a_avgDelay; - void eventOverQuota (const comm::ClientSocket&) throw (); + void eventOverQuota (const comm::ClientSocket&) ; }; diff --git a/include/anna/test/Control.hpp b/include/anna/test/Control.hpp index 81c08af..6d366ec 100644 --- a/include/anna/test/Control.hpp +++ b/include/anna/test/Control.hpp @@ -34,19 +34,19 @@ class Control : public Mutex { public: Control (comm::Communicator* engine); - void setDelay (const Millisecond delay) throw () { a_delay = delay; } - void setMaxMessage (const int maxMessage) throw () { a_maxMessage = maxMessage; } + void setDelay (const Millisecond delay) { a_delay = delay; } + void setMaxMessage (const int maxMessage) { a_maxMessage = maxMessage; } - int getMaxMessage () const throw () { return a_maxMessage; } + int getMaxMessage () const { return a_maxMessage; } - bool canContinue (const comm::socket::Client& clientSocket) throw (RuntimeException); - void delay () throw (RuntimeException); - Millisecond latency (const Millisecond& init) throw (RuntimeException); + bool canContinue (const comm::socket::Client& clientSocket) noexcept(false); + void delay () noexcept(false); + Millisecond latency (const Millisecond& init) noexcept(false); - void report () throw (); - void stop () throw (RuntimeException); + void report () ; + void stop () noexcept(false); - xml::Node* asXML (xml::Node* parent) throw (); + xml::Node* asXML (xml::Node* parent) ; private: comm::Communicator& a_engine; diff --git a/include/anna/test/Menu.hpp b/include/anna/test/Menu.hpp index 6e9447c..58e3c5d 100644 --- a/include/anna/test/Menu.hpp +++ b/include/anna/test/Menu.hpp @@ -32,15 +32,15 @@ public: Menu (anna::comm::Communicator*); - void paint () const throw (); + void paint () const ; private: Data a_data; int a_status; - void initialize () throw (anna::RuntimeException) {;} - void apply () throw (anna::RuntimeException); - void finalize () throw () {;} + void initialize () noexcept(false) {;} + void apply () noexcept(false); + void finalize () {;} }; diff --git a/include/anna/test/Statistic.hpp b/include/anna/test/Statistic.hpp index c5f1cf1..6f23c7f 100644 --- a/include/anna/test/Statistic.hpp +++ b/include/anna/test/Statistic.hpp @@ -29,7 +29,7 @@ public: a_errorCounter (0) {} - void initTime () throw (RuntimeException) { + void initTime () noexcept(false) { if (a_initTime == 0) { Guard guard (this, "Statistic::initTime"); if (a_initTime == 0) @@ -37,31 +37,31 @@ public: } } - Millisecond getInitTime () const throw () { return a_initTime; } - int getMessageCounter () const throw () { return a_messageCounter; } - int getSuccessCounter () const throw () { return a_successCounter; } + Millisecond getInitTime () const { return a_initTime; } + int getMessageCounter () const { return a_messageCounter; } + int getSuccessCounter () const { return a_successCounter; } - void countMessage () throw () { a_messageCounter ++; } - void countSuccess () throw () { a_successCounter ++; } - int countError () throw (RuntimeException) { + void countMessage () { a_messageCounter ++; } + void countSuccess () { a_successCounter ++; } + int countError () noexcept(false) { Guard guard (this, "Statistic::countError"); return ++ a_errorCounter; } - void resetError () throw (RuntimeException) { + void resetError () noexcept(false) { if (a_errorCounter > 0) { Guard guard (this, "Statistic::countError"); a_errorCounter = 0; } } - void countDelay (const Millisecond value) throw (RuntimeException) { + void countDelay (const Millisecond value) noexcept(false) { Guard guard (this, "Statistic::countDelay"); a_avgDelay += value; } - const Average & getAvgDelay () const throw () { return a_avgDelay; } + const Average & getAvgDelay () const { return a_avgDelay; } - int getMessage () const throw () { return a_messageCounter; } + int getMessage () const { return a_messageCounter; } private: Millisecond a_initTime; diff --git a/include/anna/testing/TestCase.hpp b/include/anna/testing/TestCase.hpp index 3ebd535..6eab8df 100644 --- a/include/anna/testing/TestCase.hpp +++ b/include/anna/testing/TestCase.hpp @@ -41,8 +41,8 @@ namespace testing { class TestStepWaitDiameter; class TestCase { - void assertInitialized() const throw(anna::RuntimeException); - void assertMessage(const anna::DataBlock &db, bool toEntity) throw(anna::RuntimeException); + void assertInitialized() const noexcept(false); + void assertMessage(const anna::DataBlock &db, bool toEntity) noexcept(false); public: @@ -56,90 +56,90 @@ public: std::vector a_events; public: - void addHint(const std::string &hint) throw(); - void clear() throw(); - int events() const throw() { return a_events.size(); } - anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); - std::string asString() const throw(); + void addHint(const std::string &hint) ; + void clear() ; + int events() const { return a_events.size(); } + anna::xml::Node* asXML(anna::xml::Node* parent) const ; + std::string asString() const ; }; TestCase(unsigned int id, const std::string &description = ""); ~TestCase(); struct State { enum _v { Initialized, InProgress, Failed, Success }; }; - static const char* asText(const State::_v state) throw(); - const State::_v &getState() const throw() { return a_state; } - const anna::Millisecond &getStartTimestamp() const throw() { return a_startTimestamp; } - const anna::Millisecond &getFinishTimestamp() const throw() { return a_finishTimestamp; } - anna::Millisecond getLapseMs() const throw(); - anna::Millisecond getProcessingTimeMs() const throw(); - void addDebugSummaryHint(const std::string &hint) throw() { a_debugSummary.addHint(hint); } - void setState(const State::_v &state) throw(); - bool isFinished() const throw() { return (getState() == State::Failed || getState() == State::Success); } - bool inProgress() const throw() { return (getState() == State::InProgress); } - bool isFailed() const throw() { return (getState() == State::Failed); } - bool isSuccess() const throw() { return (getState() == State::Success); } - bool hasSameCondition(const TestDiameterCondition &condition) const throw(); - const DebugSummary & getDebugSummary() const throw() { return a_debugSummary; } + static const char* asText(const State::_v state) ; + const State::_v &getState() const { return a_state; } + const anna::Millisecond &getStartTimestamp() const { return a_startTimestamp; } + const anna::Millisecond &getFinishTimestamp() const { return a_finishTimestamp; } + anna::Millisecond getLapseMs() const ; + anna::Millisecond getProcessingTimeMs() const ; + void addDebugSummaryHint(const std::string &hint) { a_debugSummary.addHint(hint); } + void setState(const State::_v &state) ; + bool isFinished() const { return (getState() == State::Failed || getState() == State::Success); } + bool inProgress() const { return (getState() == State::InProgress); } + bool isFailed() const { return (getState() == State::Failed); } + bool isSuccess() const { return (getState() == State::Success); } + bool hasSameCondition(const TestDiameterCondition &condition) const ; + const DebugSummary & getDebugSummary() const { return a_debugSummary; } // Interactivity: - void makeInteractive(bool yes = true) throw() { a_interactiveAmount = (yes ? 0:-1); } - void addInteractiveAmount(unsigned int amount) throw() { + void makeInteractive(bool yes = true) { a_interactiveAmount = (yes ? 0:-1); } + void addInteractiveAmount(unsigned int amount) { if (a_interactiveAmount == -1) makeInteractive(); if (amount == 0) return; a_interactiveAmount += amount; process(); } - int interactiveAmount() const throw() { return a_interactiveAmount; } - void interactiveExecution() throw() { a_interactiveAmount --; } + int interactiveAmount() const { return a_interactiveAmount; } + void interactiveExecution() { a_interactiveAmount --; } // Step type & information - void addTimeout(const anna::Millisecond &timeout) throw(anna::RuntimeException); - void addDelay(const anna::Millisecond &delay) throw(anna::RuntimeException); + void addTimeout(const anna::Millisecond &timeout) noexcept(false); + void addDelay(const anna::Millisecond &delay) noexcept(false); void addWaitDiameter(bool fromEntity, const std::string &code, const std::string &bitR, const std::string &hopByHop, const std::string &applicationId, const std::string &sessionId, const std::string &resultCode, - const std::string &msisdn, const std::string &imsi, const std::string &serviceContextId) throw(anna::RuntimeException); - void addCommand(const std::string &cmd) throw(anna::RuntimeException); - void addIpLimit(unsigned int ipLimit) throw(anna::RuntimeException); + const std::string &msisdn, const std::string &imsi, const std::string &serviceContextId) noexcept(false); + void addCommand(const std::string &cmd) noexcept(false); + void addIpLimit(unsigned int ipLimit) noexcept(false); // Diameter-specifc - void addSendDiameterXml2e(const anna::DataBlock &db, anna::diameter::comm::OriginHost *host, int stepNumber) throw(anna::RuntimeException); - void addSendDiameterXml2c(const anna::DataBlock &db, anna::diameter::comm::OriginHost *host, int stepNumber) throw(anna::RuntimeException); - void addWaitDiameterAnswer(bool fromEntity, int stepNumber) throw(anna::RuntimeException); - void addWaitDiameterRegexpHex(bool fromEntity, const std::string ®exp) throw(anna::RuntimeException); - void addWaitDiameterRegexpXml(bool fromEntity, const std::string ®exp) throw(anna::RuntimeException); + void addSendDiameterXml2e(const anna::DataBlock &db, anna::diameter::comm::OriginHost *host, int stepNumber) noexcept(false); + void addSendDiameterXml2c(const anna::DataBlock &db, anna::diameter::comm::OriginHost *host, int stepNumber) noexcept(false); + void addWaitDiameterAnswer(bool fromEntity, int stepNumber) noexcept(false); + void addWaitDiameterRegexpHex(bool fromEntity, const std::string ®exp) noexcept(false); + void addWaitDiameterRegexpXml(bool fromEntity, const std::string ®exp) noexcept(false); // Process: - void nextStep() throw() { a_stepsIt++; } - bool done() throw(); - bool process() throw(); // false to stop + void nextStep() { a_stepsIt++; } + bool done() ; + bool process() ; // false to stop // Reset test case and underlaying information (steps context) - bool reset(bool hard /* hard reset includes in-progress test cases */) throw(); + bool reset(bool hard /* hard reset includes in-progress test cases */) ; // Check for clear (destroy steps) bool safeToClear(); // false if something pending (running threads steps) // getters - const unsigned int &getId() const throw() { return a_id; } - const std::string &getDescription() const throw() { return a_description; } + const unsigned int &getId() const { return a_id; } + const std::string &getDescription() const { return a_description; } // setters - void setDescription(const std::string &description) throw() { a_description = description; } + void setDescription(const std::string &description) { a_description = description; } //helpers - int steps() const throw() { return a_steps.size(); } - void addStep(TestStep *step) throw() { a_steps.push_back(step); } + int steps() const { return a_steps.size(); } + void addStep(TestStep *step) { a_steps.push_back(step); } - TestStepWaitDiameter *searchNextWaitConditionFulfilled(const anna::DataBlock &message, bool waitFromEntity) throw(); + TestStepWaitDiameter *searchNextWaitConditionFulfilled(const anna::DataBlock &message, bool waitFromEntity) ; // When a message arrives, we identify the test case by mean the Session-Id. Then, from the current step iterator (included), // we search for a fulfilling condition for that message. The first found, is 'completed' and then breaks the search. - const TestStep *getStep(int stepNumber) const throw(); + const TestStep *getStep(int stepNumber) const ; - anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); - std::string asXMLString() const throw(); + anna::xml::Node* asXML(anna::xml::Node* parent) const ; + std::string asXMLString() const ; private: diff --git a/include/anna/testing/TestClock.hpp b/include/anna/testing/TestClock.hpp index 9ae98f4..4a5da6c 100644 --- a/include/anna/testing/TestClock.hpp +++ b/include/anna/testing/TestClock.hpp @@ -26,7 +26,7 @@ public: TestClock(const char *clockName, const anna::Millisecond & timeout, TestManager *manager) : a_manager(manager), anna::timex::Clock(clockName, timeout) {;} - virtual bool tick() throw(anna::RuntimeException); + virtual bool tick() noexcept(false); }; } diff --git a/include/anna/testing/TestDiameterCondition.hpp b/include/anna/testing/TestDiameterCondition.hpp index 64ddc14..9b153b5 100644 --- a/include/anna/testing/TestDiameterCondition.hpp +++ b/include/anna/testing/TestDiameterCondition.hpp @@ -32,7 +32,7 @@ class TestDiameterCondition { // RegexpHex = Regexp against HEX representation for incoming messages // Fields = Compare specific message fields struct Type { enum _v { RegexpXml, RegexpHex, Fields }; }; - static const char* asText(const Type::_v type) throw(); + static const char* asText(const Type::_v type) ; TestDiameterCondition() : a_rcvFromEntity(true), @@ -44,26 +44,26 @@ class TestDiameterCondition { // Source of the received message - void setReceivedFromEntity(bool rfe) throw() { a_rcvFromEntity = rfe; } - bool receivedFromEntity() const throw() { return a_rcvFromEntity; } + void setReceivedFromEntity(bool rfe) { a_rcvFromEntity = rfe; } + bool receivedFromEntity() const { return a_rcvFromEntity; } // Regexp - void setRegexpXml(const std::string ®exp) throw() { a_regexp = regexp; a_type = Type::RegexpXml; } - void setRegexpHex(const std::string ®exp) throw() { a_regexp = regexp; a_type = Type::RegexpHex; } + void setRegexpXml(const std::string ®exp) { a_regexp = regexp; a_type = Type::RegexpXml; } + void setRegexpHex(const std::string ®exp) { a_regexp = regexp; a_type = Type::RegexpHex; } // Fields - void setCode(const std::string &value) throw() { a_code = value; a_type = Type::Fields; } - void setBitR(const std::string &value) throw() { a_bitR = value; a_type = Type::Fields; } - void setHopByHop(const std::string &value) throw() { a_hopByHop = value; a_type = Type::Fields; } - void setApplicationId(const std::string &value) throw() { a_applicationId = value; a_type = Type::Fields; } - void setSessionId(const std::string &value) throw() { a_sessionId = value; a_type = Type::Fields; } - void setResultCode(const std::string &value) throw() { a_resultCode = value; a_type = Type::Fields; } - void setMsisdn(const std::string &value) throw() { a_msisdn = value; a_type = Type::Fields; } - void setImsi(const std::string &value) throw() { a_imsi = value; a_type = Type::Fields; } - void setServiceContextId(const std::string &value) throw() { a_serviceContextId = value; a_type = Type::Fields; } - - bool exists() const throw(); - friend bool operator==(const TestDiameterCondition &c1, const TestDiameterCondition &c2) throw() { + void setCode(const std::string &value) { a_code = value; a_type = Type::Fields; } + void setBitR(const std::string &value) { a_bitR = value; a_type = Type::Fields; } + void setHopByHop(const std::string &value) { a_hopByHop = value; a_type = Type::Fields; } + void setApplicationId(const std::string &value) { a_applicationId = value; a_type = Type::Fields; } + void setSessionId(const std::string &value) { a_sessionId = value; a_type = Type::Fields; } + void setResultCode(const std::string &value) { a_resultCode = value; a_type = Type::Fields; } + void setMsisdn(const std::string &value) { a_msisdn = value; a_type = Type::Fields; } + void setImsi(const std::string &value) { a_imsi = value; a_type = Type::Fields; } + void setServiceContextId(const std::string &value) { a_serviceContextId = value; a_type = Type::Fields; } + + bool exists() const ; + friend bool operator==(const TestDiameterCondition &c1, const TestDiameterCondition &c2) { if (c1.getType() != c2.getType()) return false; @@ -86,25 +86,25 @@ class TestDiameterCondition { } - const Type::_v &getType() const throw() { return a_type; } + const Type::_v &getType() const { return a_type; } // Regexp: - const std::string & getRegexp() const throw() { return a_regexp; } + const std::string & getRegexp() const { return a_regexp; } // Basic - const std::string & getCode() const throw() { return a_code; } - const std::string & getBitR() const throw() { return a_bitR; } - const std::string & getHopByHop() const throw() { return a_hopByHop; } - const std::string & getApplicationId() const throw() { return a_applicationId; } - const std::string & getSessionId() const throw() { return a_sessionId; } - const std::string & getResultCode() const throw() { return a_resultCode; } - const std::string & getMsisdn() const throw() { return a_msisdn; } - const std::string & getImsi() const throw() { return a_imsi; } - const std::string & getServiceContextId() const throw() { return a_serviceContextId; } + const std::string & getCode() const { return a_code; } + const std::string & getBitR() const { return a_bitR; } + const std::string & getHopByHop() const { return a_hopByHop; } + const std::string & getApplicationId() const { return a_applicationId; } + const std::string & getSessionId() const { return a_sessionId; } + const std::string & getResultCode() const { return a_resultCode; } + const std::string & getMsisdn() const { return a_msisdn; } + const std::string & getImsi() const { return a_imsi; } + const std::string & getServiceContextId() const { return a_serviceContextId; } - bool comply (const anna::DataBlock &message) const throw(); + bool comply (const anna::DataBlock &message) const ; - anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); + anna::xml::Node* asXML(anna::xml::Node* parent) const ; private: diff --git a/include/anna/testing/TestManager.hpp b/include/anna/testing/TestManager.hpp index 40d5370..916177a 100644 --- a/include/anna/testing/TestManager.hpp +++ b/include/anna/testing/TestManager.hpp @@ -61,16 +61,16 @@ class TestManager : public anna::timex::TimeEventObserver, public anna::Singleto public: StatSummary() { clear(); } - void newTCState(const TestCase::State::_v beginState, const TestCase::State::_v endState) throw(); - void clear() throw(); - unsigned int getInitializedCount() const throw() { return a_initializedTcs; } - unsigned int getInProgressCount() const throw() { return a_inprogressTcs; } - unsigned int getFailedCount() const throw() { return a_failedTcs; } - unsigned int getSuccessCount() const throw() { return a_sucessTcs; } - unsigned int getFinishedCount() const throw() { return a_sucessTcs + a_failedTcs; } - unsigned int getTotal() const throw() { return (a_initializedTcs + a_inprogressTcs + a_failedTcs + a_sucessTcs); } - - anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); + void newTCState(const TestCase::State::_v beginState, const TestCase::State::_v endState) ; + void clear() ; + unsigned int getInitializedCount() const { return a_initializedTcs; } + unsigned int getInProgressCount() const { return a_inprogressTcs; } + unsigned int getFailedCount() const { return a_failedTcs; } + unsigned int getSuccessCount() const { return a_sucessTcs; } + unsigned int getFinishedCount() const { return a_sucessTcs + a_failedTcs; } + unsigned int getTotal() const { return (a_initializedTcs + a_inprogressTcs + a_failedTcs + a_sucessTcs); } + + anna::xml::Node* asXML(anna::xml::Node* parent) const ; }; @@ -96,8 +96,8 @@ class TestManager : public anna::timex::TimeEventObserver, public anna::Singleto // Test clock int a_synchronousAmount; TestClock *a_clock; - bool tick() throw(); - bool nextTestCase() throw(); + bool tick() ; + bool nextTestCase() ; // Test timers timer_container a_timers; @@ -116,90 +116,90 @@ class TestManager : public anna::timex::TimeEventObserver, public anna::Singleto TestManager(const TestManager&); virtual ~TestManager() {;} - TestTimer* createTimer(TestCaseStep*, const anna::Millisecond &, const TestTimer::Type::_v type) throw(anna::RuntimeException); - void cancelTimer(TestTimer*) throw(); - void release(anna::timex::TimeEvent*) throw(); + TestTimer* createTimer(TestCaseStep*, const anna::Millisecond &, const TestTimer::Type::_v type) noexcept(false); + void cancelTimer(TestTimer*) ; + void release(anna::timex::TimeEvent*) ; public: - void registerKey1(const std::string &key, const TestCase *testCase) throw(anna::RuntimeException); - void registerKey2(const std::string &key, const TestCase *testCase) throw(anna::RuntimeException); + void registerKey1(const std::string &key, const TestCase *testCase) noexcept(false); + void registerKey2(const std::string &key, const TestCase *testCase) noexcept(false); - int tests() const throw() { return a_testPool.size(); } - void setTimerController(anna::timex::Engine *engine) throw() { a_timeController = engine; } + int tests() const { return a_testPool.size(); } + void setTimerController(anna::timex::Engine *engine) { a_timeController = engine; } - void setReportsDirectory(const std::string &rd) throw() { a_reportsDirectory = rd; } - const std::string &getReportsDirectory() const throw() { return a_reportsDirectory; } + void setReportsDirectory(const std::string &rd) { a_reportsDirectory = rd; } + const std::string &getReportsDirectory() const { return a_reportsDirectory; } - void setDumpHex(bool dh) throw() { a_dumpHexMessages = dh; } - bool getDumpHex() const throw() { return a_dumpHexMessages; } + void setDumpHex(bool dh) { a_dumpHexMessages = dh; } + bool getDumpHex() const { return a_dumpHexMessages; } - void setDumpStdout(bool ds) throw() { a_dumpStdout = ds; } - bool getDumpStdout() const throw() { return a_dumpStdout; } + void setDumpStdout(bool ds) { a_dumpStdout = ds; } + bool getDumpStdout() const { return a_dumpStdout; } - void setDumpInitializedReports(bool enable) throw() { a_dumpInitializedReports = enable; } - void setDumpInProgressReports(bool enable) throw() { a_dumpInProgressReports = enable; } - void setDumpFailedReports(bool enable) throw() { a_dumpFailedReports = enable; } - void setDumpSuccessReports(bool enable) throw() { a_dumpSuccessReports = enable; } - void setDumpAllReports(bool enable) throw() { + void setDumpInitializedReports(bool enable) { a_dumpInitializedReports = enable; } + void setDumpInProgressReports(bool enable) { a_dumpInProgressReports = enable; } + void setDumpFailedReports(bool enable) { a_dumpFailedReports = enable; } + void setDumpSuccessReports(bool enable) { a_dumpSuccessReports = enable; } + void setDumpAllReports(bool enable) { setDumpInitializedReports(enable); setDumpInProgressReports(enable); setDumpFailedReports(enable); setDumpSuccessReports(enable); } - bool getDumpInitializedReports() const throw() { return a_dumpInitializedReports; } - bool getDumpInProgressReports() const throw() { return a_dumpInProgressReports; } - bool getDumpFailedReports() const throw() { return a_dumpFailedReports; } - bool getDumpSuccessReports() const throw() { return a_dumpSuccessReports; } + bool getDumpInitializedReports() const { return a_dumpInitializedReports; } + bool getDumpInProgressReports() const { return a_dumpInProgressReports; } + bool getDumpFailedReports() const { return a_dumpFailedReports; } + bool getDumpSuccessReports() const { return a_dumpSuccessReports; } // Helper to calculate time interval and synchronous amount of execution tests to guarantee the input rate (tests per second) // through the time manager. The first call to this method will start the time trigger system and check for new test cases to be launched. - bool configureTTPS(int testTicksPerSecond) throw(); + bool configureTTPS(int testTicksPerSecond) ; - bool clearPool(std::string &result) throw(); - bool resetPool(bool hard /* hard reset includes in-progress test cases */) throw(); - void setPoolRepeats(int repeats) throw() { a_poolRepeats = repeats; } - int getPoolRepeats() const throw() { return a_poolRepeats; } - int getPoolCycle() const throw() { return a_poolCycle; } + bool clearPool(std::string &result) ; + bool resetPool(bool hard /* hard reset includes in-progress test cases */) ; + void setPoolRepeats(int repeats) { a_poolRepeats = repeats; } + int getPoolRepeats() const { return a_poolRepeats; } + int getPoolCycle() const { return a_poolCycle; } - bool getAutoResetHard() const throw() { return a_autoResetHard; } - void setAutoResetHard(bool hard = true) throw() { a_autoResetHard = hard; } + bool getAutoResetHard() const { return a_autoResetHard; } + void setAutoResetHard(bool hard = true) { a_autoResetHard = hard; } - unsigned int getInProgressCount() const throw() { return a_statSummary.getInProgressCount(); } - unsigned int getInitializedCount() const throw() { return a_statSummary.getInitializedCount(); } - unsigned int getFinishedCount() const throw() { return a_statSummary.getFinishedCount(); } - unsigned int getInProgressLimit() const throw() { return a_inProgressLimit; } - void setInProgressLimit(unsigned int limit) throw() { a_inProgressLimit = limit; } // -1 = UINT_MAX (no limit) + unsigned int getInProgressCount() const { return a_statSummary.getInProgressCount(); } + unsigned int getInitializedCount() const { return a_statSummary.getInitializedCount(); } + unsigned int getFinishedCount() const { return a_statSummary.getFinishedCount(); } + unsigned int getInProgressLimit() const { return a_inProgressLimit; } + void setInProgressLimit(unsigned int limit) { a_inProgressLimit = limit; } // -1 = UINT_MAX (no limit) - bool gotoTestCase(unsigned int id) throw(); - bool runTestCase(unsigned int id) throw(); - TestCase *findTestCase(unsigned int id) const throw(); // id = -1 provides current test case triggered - TestCase *getTestCase(unsigned int id, const std::string &description = "") throw(); // creates/reuses a test case + bool gotoTestCase(unsigned int id) ; + bool runTestCase(unsigned int id) ; + TestCase *findTestCase(unsigned int id) const ; // id = -1 provides current test case triggered + TestCase *getTestCase(unsigned int id, const std::string &description = "") ; // creates/reuses a test case // Diameter-specific - TestCase *getDiameterTestCaseFromSessionId(const anna::DataBlock &message, std::string &sessionId) throw(); - TestCase *getDiameterTestCaseFromSubscriberId(const anna::DataBlock &message, std::string &subscriberId) throw(); - void receiveDiameterMessage(const anna::DataBlock &message, const anna::diameter::comm::ClientSession *clientSession) throw(anna::RuntimeException); - void receiveDiameterMessage(const anna::DataBlock &message, const anna::diameter::comm::ServerSession *serverSession) throw(anna::RuntimeException); + TestCase *getDiameterTestCaseFromSessionId(const anna::DataBlock &message, std::string &sessionId) ; + TestCase *getDiameterTestCaseFromSubscriberId(const anna::DataBlock &message, std::string &subscriberId) ; + void receiveDiameterMessage(const anna::DataBlock &message, const anna::diameter::comm::ClientSession *clientSession) noexcept(false); + void receiveDiameterMessage(const anna::DataBlock &message, const anna::diameter::comm::ServerSession *serverSession) noexcept(false); // Non-trasactional (kafka) // // - bool execTestCases(int sync_amount) throw(); + bool execTestCases(int sync_amount) ; - anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); - anna::xml::Node* junitAsXML(anna::xml::Node* parent) const throw(); - std::string asXMLString() const throw(); - std::string junitAsXMLString() const throw(); - std::string summaryCounts() const throw(); - std::string summaryStates() const throw(); + anna::xml::Node* asXML(anna::xml::Node* parent) const ; + anna::xml::Node* junitAsXML(anna::xml::Node* parent) const ; + std::string asXMLString() const ; + std::string junitAsXMLString() const ; + std::string summaryCounts() const ; + std::string summaryStates() const ; // stats - void tcsStateStats(const TestCase::State::_v beginState, const TestCase::State::_v endState) throw() { + void tcsStateStats(const TestCase::State::_v beginState, const TestCase::State::_v endState) { a_statSummary.newTCState(beginState, endState); } diff --git a/include/anna/testing/TestStep.hpp b/include/anna/testing/TestStep.hpp index 844b6be..8f771cc 100644 --- a/include/anna/testing/TestStep.hpp +++ b/include/anna/testing/TestStep.hpp @@ -50,32 +50,32 @@ class TestStep { anna::Millisecond a_endTimestamp; // unix time bool a_executed; // used for interactive mode in order to not repeat a execution step if before completing, the user add interactive amount - void setBeginTimestamp(const anna::Millisecond &t) throw() { a_beginTimestamp = t; } - const anna::Millisecond &getBeginTimestamp() const throw() { return a_beginTimestamp; } - void setEndTimestamp(const anna::Millisecond &t) throw() { a_endTimestamp = t; } - const anna::Millisecond &getEndTimestamp() const throw() { return a_endTimestamp; } + void setBeginTimestamp(const anna::Millisecond &t) { a_beginTimestamp = t; } + const anna::Millisecond &getBeginTimestamp() const { return a_beginTimestamp; } + void setEndTimestamp(const anna::Millisecond &t) { a_endTimestamp = t; } + const anna::Millisecond &getEndTimestamp() const { return a_endTimestamp; } void initialize(TestCase *testCase); public: struct Type { enum _v { Unconfigured, Timeout, Sendxml2e, Sendxml2c, Delay, Wait, Cmd, IpLimit }; }; - static const char* asText(const Type::_v type) throw(); + static const char* asText(const Type::_v type) ; TestStep(TestCase *testCase) : a_message(true), a_messageCodec(NULL), a_executed(false) { initialize(testCase); } virtual ~TestStep() {;} // setter & getters - const Type::_v &getType() const throw() { return a_type; } - const int &getNumber() const throw() { return a_number; } - bool isCompleted() const throw() { return a_completed; } - anna::Millisecond getLapseMs() const throw() { return a_endTimestamp - a_beginTimestamp; } - - bool execute() throw(); - void complete() throw(); - void reset() throw(); - void next() throw(); - virtual anna::xml::Node* asXML(anna::xml::Node* parent) throw(); - std::string asXMLString() throw(); + const Type::_v &getType() const { return a_type; } + const int &getNumber() const { return a_number; } + bool isCompleted() const { return a_completed; } + anna::Millisecond getLapseMs() const { return a_endTimestamp - a_beginTimestamp; } + + bool execute() ; + void complete() ; + void reset() ; + void next() ; + virtual anna::xml::Node* asXML(anna::xml::Node* parent) ; + std::string asXMLString() ; protected: TestCase *a_testCase; @@ -85,14 +85,14 @@ class TestStep { // Message (not for all step types) anna::DataBlock a_message; anna::diameter::codec::Message *a_messageCodec; // used as helper and for traffic logs - bool decodeMessage(bool trust = false) throw(); // If trust=true: decoding the previously encoded message (sendxml sentences). + bool decodeMessage(bool trust = false) ; // If trust=true: decoding the previously encoded message (sendxml sentences). // The only error would be validation ones, and we are going to ignore them here. - virtual bool do_execute() throw() = 0; // returns true if next step must be executed - virtual void do_complete() throw() = 0; // end of transaction (delay/timeout expired, wait condition fulfilled, sending done) + virtual bool do_execute() = 0; // returns true if next step must be executed + virtual void do_complete() = 0; // end of transaction (delay/timeout expired, wait condition fulfilled, sending done) // In all cases, the next step will be executed except 'timeout' which is asynchronous // and will move to the next step just after timer creation (no complete waited) - virtual void do_reset() throw() = 0; + virtual void do_reset() = 0; }; @@ -106,15 +106,15 @@ class TestStepTimeout : public TestStep { ~TestStepTimeout() { do_reset(); } // setter & getters - void setTimeout(const anna::Millisecond &t) throw() { a_timeout = t; } - const anna::Millisecond &getTimeout() const throw() { return a_timeout; } + void setTimeout(const anna::Millisecond &t) { a_timeout = t; } + const anna::Millisecond &getTimeout() const { return a_timeout; } // virtuals - bool do_execute() throw(); - void do_complete() throw(); // timeout reached, test case failed - void do_reset() throw(); - void cancelTimer() throw(); - anna::xml::Node* asXML(anna::xml::Node* parent) throw(); + bool do_execute() ; + void do_complete() ; // timeout reached, test case failed + void do_reset() ; + void cancelTimer() ; + anna::xml::Node* asXML(anna::xml::Node* parent) ; }; @@ -138,18 +138,18 @@ class TestStepSendDiameterXml : public TestStep { ~TestStepSendDiameterXml() { do_reset(); } // setter & getters - void setOriginHost(anna::diameter::comm::OriginHost *host) throw() { a_originHost = host; } - anna::diameter::comm::OriginHost *getOriginHost() const throw() { return a_originHost; } - void setWaitForRequestStepNumber(int stepNumber) throw() { a_waitForRequestStepNumber = stepNumber; } - int getWaitForRequestStepNumber() const throw() { return a_waitForRequestStepNumber; } - void setMsgDataBlock(const anna::DataBlock &db) throw() { a_message = db; } - const anna::DataBlock &getMsgDataBlock() const throw() { return a_message; } + void setOriginHost(anna::diameter::comm::OriginHost *host) { a_originHost = host; } + anna::diameter::comm::OriginHost *getOriginHost() const { return a_originHost; } + void setWaitForRequestStepNumber(int stepNumber) { a_waitForRequestStepNumber = stepNumber; } + int getWaitForRequestStepNumber() const { return a_waitForRequestStepNumber; } + void setMsgDataBlock(const anna::DataBlock &db) { a_message = db; } + const anna::DataBlock &getMsgDataBlock() const { return a_message; } // virtuals - bool do_execute() throw(); - void do_complete() throw() {;} - void do_reset() throw(); - anna::xml::Node* asXML(anna::xml::Node* parent) throw(); + bool do_execute() ; + void do_complete() {;} + void do_reset() ; + anna::xml::Node* asXML(anna::xml::Node* parent) ; }; class TestStepSendDiameterXml2e : public TestStepSendDiameterXml { @@ -172,15 +172,15 @@ class TestStepDelay : public TestStep { ~TestStepDelay() { do_reset(); } // setter & getters - void setDelay(const anna::Millisecond &d) throw() { a_delay = d; } - const anna::Millisecond &getDelay() const throw() { return a_delay; } + void setDelay(const anna::Millisecond &d) { a_delay = d; } + const anna::Millisecond &getDelay() const { return a_delay; } // virtuals - bool do_execute() throw(); - void do_complete() throw(); // delay reached - void do_reset() throw(); - void cancelTimer() throw(); - anna::xml::Node* asXML(anna::xml::Node* parent) throw(); + bool do_execute() ; + void do_complete() ; // delay reached + void do_reset() ; + void cancelTimer() ; + anna::xml::Node* asXML(anna::xml::Node* parent) ; }; @@ -202,26 +202,26 @@ class TestStepWaitDiameter : public TestStep { void setCondition(bool fromEntity, const std::string &code, const std::string &bitR, const std::string &hopByHop, const std::string &applicationId, const std::string &sessionId, const std::string &resultCode, - const std::string &msisdn, const std::string &imsi, const std::string &serviceContextId) throw(); - void setConditionRegexpXml(bool fromEntity, const std::string ®exp) throw(); - void setConditionRegexpHex(bool fromEntity, const std::string ®exp) throw(); + const std::string &msisdn, const std::string &imsi, const std::string &serviceContextId) ; + void setConditionRegexpXml(bool fromEntity, const std::string ®exp) ; + void setConditionRegexpHex(bool fromEntity, const std::string ®exp) ; - void setClientSession(anna::diameter::comm::ClientSession *cs) throw() { a_clientSession = cs; } - void setServerSession(anna::diameter::comm::ServerSession *ss) throw() { a_serverSession = ss; } - anna::diameter::comm::ClientSession *getClientSession() const throw() { return a_clientSession; } - anna::diameter::comm::ServerSession *getServerSession() const throw() { return a_serverSession; } + void setClientSession(anna::diameter::comm::ClientSession *cs) { a_clientSession = cs; } + void setServerSession(anna::diameter::comm::ServerSession *ss) { a_serverSession = ss; } + anna::diameter::comm::ClientSession *getClientSession() const { return a_clientSession; } + anna::diameter::comm::ServerSession *getServerSession() const { return a_serverSession; } - const TestDiameterCondition &getCondition() const throw() { return a_condition; } - //void setMsgDataBlock(const anna::DataBlock &db) throw() { a_message = db; } - bool fulfilled(const anna::DataBlock &db/*, bool matchSessionId = true*/) throw(); - const anna::DataBlock &getMsgDataBlock() const throw() { return a_message; } + const TestDiameterCondition &getCondition() const { return a_condition; } + //void setMsgDataBlock(const anna::DataBlock &db) { a_message = db; } + bool fulfilled(const anna::DataBlock &db/*, bool matchSessionId = true*/) ; + const anna::DataBlock &getMsgDataBlock() const { return a_message; } // virtuals - bool do_execute() throw(); // this will be executed when test case starts (at least we could measure the time until condition is fulfilled) - void do_complete() throw(); // condition fulfilled - void do_reset() throw(); - anna::xml::Node* asXML(anna::xml::Node* parent) throw(); + bool do_execute() ; // this will be executed when test case starts (at least we could measure the time until condition is fulfilled) + void do_complete() ; // condition fulfilled + void do_reset() ; + anna::xml::Node* asXML(anna::xml::Node* parent) ; }; @@ -242,28 +242,28 @@ class TestStepCmd : public TestStep { ~TestStepCmd() { do_reset(); } // setter & getters - void setThreadRunning() throw() { a_threadRunning = true; } - void setThreadNotRunning() throw() { a_threadRunning = false; } - bool threadRunning() const throw() { return a_threadRunning; } - bool threadNotRunning() const throw() { return !a_threadRunning; } - - void setResultCode(int rc) throw() { a_resultCode = rc; } - int getResultCode() const throw() { return a_resultCode; } - void setErrorMsg(const std::string &em) throw() { a_errorMsg = em; } - const std::string &getErrorMsg() const throw() { return a_errorMsg; } - //void appendOutput(const std::string &output) throw() { a_output += output; } - //const std::string &getOutput() const throw() { return a_output; } - void setChildPid(pid_t pid) throw() { a_childPid = pid; } - const pid_t &getChildPid() const throw() { return a_childPid; } - - void setScript(const std::string &script) throw() { a_script = script; } - const std::string &getScript() const throw() { return a_script; } + void setThreadRunning() { a_threadRunning = true; } + void setThreadNotRunning() { a_threadRunning = false; } + bool threadRunning() const { return a_threadRunning; } + bool threadNotRunning() const { return !a_threadRunning; } + + void setResultCode(int rc) { a_resultCode = rc; } + int getResultCode() const { return a_resultCode; } + void setErrorMsg(const std::string &em) { a_errorMsg = em; } + const std::string &getErrorMsg() const { return a_errorMsg; } + //void appendOutput(const std::string &output) { a_output += output; } + //const std::string &getOutput() const { return a_output; } + void setChildPid(pid_t pid) { a_childPid = pid; } + const pid_t &getChildPid() const { return a_childPid; } + + void setScript(const std::string &script) { a_script = script; } + const std::string &getScript() const { return a_script; } // virtuals - bool do_execute() throw(); - void do_complete() throw(); - void do_reset() throw(); - anna::xml::Node* asXML(anna::xml::Node* parent) throw(); + bool do_execute() ; + void do_complete() ; + void do_reset() ; + anna::xml::Node* asXML(anna::xml::Node* parent) ; }; @@ -276,14 +276,14 @@ class TestStepIpLimit : public TestStep { ~TestStepIpLimit() { do_reset(); } // setter & getters - void setIpLimit(unsigned int limit) throw() { a_ipLimit = limit; } - unsigned int getIpLimit() const throw() { return a_ipLimit; } + void setIpLimit(unsigned int limit) { a_ipLimit = limit; } + unsigned int getIpLimit() const { return a_ipLimit; } // virtuals - bool do_execute() throw(); - void do_complete() throw(); - void do_reset() throw() {;} - anna::xml::Node* asXML(anna::xml::Node* parent) throw(); + bool do_execute() ; + void do_complete() ; + void do_reset() {;} + anna::xml::Node* asXML(anna::xml::Node* parent) ; }; } diff --git a/include/anna/testing/TestTimer.hpp b/include/anna/testing/TestTimer.hpp index 54ece7b..a236f31 100644 --- a/include/anna/testing/TestTimer.hpp +++ b/include/anna/testing/TestTimer.hpp @@ -27,23 +27,23 @@ class TestTimer : public anna::timex::Transaction { public: struct Type { enum _v { TimeLeft, Delay }; }; - static const char* asText(const Type::_v type) throw(); + static const char* asText(const Type::_v type) ; - TestStep* getTestCaseStep() throw() { return reinterpret_cast (getContext()); } - const TestStep* getTestCaseStep() const throw() { return reinterpret_cast (getContext()); } + TestStep* getTestCaseStep() { return reinterpret_cast (getContext()); } + const TestStep* getTestCaseStep() const { return reinterpret_cast (getContext()); } - void setType(const Type::_v type) throw() { a_type = type; } - const Type::_v &getType(const Type::_v type) const throw() { return a_type; } + void setType(const Type::_v type) { a_type = type; } + const Type::_v &getType(const Type::_v type) const { return a_type; } - std::string asString() const throw(); + std::string asString() const ; private: Type::_v a_type; TestTimer() {;} - void expire(anna::timex::Engine*) throw(anna::RuntimeException); + void expire(anna::timex::Engine*) noexcept(false); friend class anna::Allocator; }; diff --git a/include/anna/time/Date.hpp b/include/anna/time/Date.hpp index 9fea4c2..c661419 100644 --- a/include/anna/time/Date.hpp +++ b/include/anna/time/Date.hpp @@ -122,10 +122,10 @@ class Date { // sets the current date/time (time(NULL)) and provided TimeZone as described in constructor - void initialize(const char *TZ = NULL) throw(); + void initialize(const char *TZ = NULL) ; // main refresh method regarding timestamp - void refresh(void) throw(); + void refresh(void) ; anna::Mutex a_mutex; @@ -154,7 +154,7 @@ public: /** * Sets the current date/time (time(NULL)) and provided TimeZone as described in constructor */ - void setNow(const char *TZ = NULL) throw() { initialize(TZ); } + void setNow(const char *TZ = NULL) { initialize(TZ); } /** @@ -173,13 +173,13 @@ public: * timezone, only helps to know the valid TZ values and shows how to change * the timezone settings if you would want to do that). */ - void setTz(const char *TZ = NULL) throw(); + void setTz(const char *TZ = NULL) ; /** Sets the local host timezone (even if it is based on TZ or in /usr/share/zoneinfo) */ - void setSystemTimezone() throw(); + void setSystemTimezone() ; /** @@ -187,8 +187,8 @@ public: * * @param unixTimestamp Time since 01-Jan-1970 GMT */ - void store(const time_t & unixTimestamp) throw(); - void storeUnix(const time_t & unixTimestamp) throw() { store(unixTimestamp); } + void store(const time_t & unixTimestamp) ; + void storeUnix(const time_t & unixTimestamp) { store(unixTimestamp); } /** @@ -196,7 +196,7 @@ public: * * @param ntpTimestamp Time since 01-Jan-1900 GMT */ - void storeNtp(const unsigned int &ntpTimestamp) throw(); + void storeNtp(const unsigned int &ntpTimestamp) ; /** @@ -206,7 +206,7 @@ public: * @param TZ timezone for date/time provided. Default (NULL) assumes the system * timezone configuration. Empty string will be interpreted as UTC timezone. */ - void store(const struct tm &date, const char *TZ = NULL) throw(anna::RuntimeException); + void store(const struct tm &date, const char *TZ = NULL) noexcept(false); /** @@ -219,8 +219,8 @@ public: * @param strptimeFormat Date/time string format for strptime primitive. * See format syntax at http://man7.org/linux/man-pages/man3/strptime.3.html */ - void store(const std::string &stringDate, const char *TZ = NULL, const char *strptimeFormat = "%Y%m%d%H%M%S") throw(anna::RuntimeException); - //void store(const std::string &stringDate, const char *tz = NULL, const char *strptimeFormat = "%Y-%m-%d-%H-%M-%S") throw(anna::RuntimeException); + void store(const std::string &stringDate, const char *TZ = NULL, const char *strptimeFormat = "%Y%m%d%H%M%S") noexcept(false); + //void store(const std::string &stringDate, const char *tz = NULL, const char *strptimeFormat = "%Y-%m-%d-%H-%M-%S") noexcept(false); /** @@ -291,13 +291,13 @@ public: * @return NULL if TZ is unset, or string for TZ environment variable * (empty is allowed and use to be understood as UTC. */ - const char *getTz(void) const throw() { return (a_tz.unsetTZ() ? NULL:a_tz.getValue().c_str()); } + const char *getTz(void) const { return (a_tz.unsetTZ() ? NULL:a_tz.getValue().c_str()); } /** * Gets the context timezone as string */ - std::string getTzAsString() const throw() { return a_tz.asString(); } + std::string getTzAsString() const { return a_tz.asString(); } /** @@ -305,14 +305,14 @@ public: * * @return 'tm' struct on the current timezone */ - const struct tm & getTm(void) const throw() { return a_tm; } + const struct tm & getTm(void) const { return a_tm; } /** * Gets the week day abbreviation: Sun, Mon, Tue, Wed, Thu, Fri, Sat * * @return Day of the week */ - const char *getDay(void) const throw(); + const char *getDay(void) const ; /** @@ -322,7 +322,7 @@ public: * * @see getTz */ - std::string yyyymmddHHmmss(void) const throw(); + std::string yyyymmddHHmmss(void) const ; /** @@ -330,7 +330,7 @@ public: * * @return Seconds since 01-Jan-1970 GMT */ - const time_t & getUnixTimestamp(void) const throw() { return a_timestamp; } + const time_t & getUnixTimestamp(void) const { return a_timestamp; } /** @@ -338,7 +338,7 @@ public: * * @return Seconds since 01-Jan-1900 GMT */ - unsigned int getNtpTimestamp(void) const throw() { + unsigned int getNtpTimestamp(void) const { unsigned int ntp_timestamp = a_timestamp + TIMESTAMP_OFFSET_NTP1900_OVER_UNIX1970; return ntp_timestamp; } @@ -349,7 +349,7 @@ public: * * @return String with class content */ - std::string asString(void) const throw(); + std::string asString(void) const ; /** @@ -357,7 +357,7 @@ public: * * @return XML with class content */ - anna::xml::Node* asXML(anna::xml::Node* parent) const throw(); + anna::xml::Node* asXML(anna::xml::Node* parent) const ; }; diff --git a/include/anna/time/functions.hpp b/include/anna/time/functions.hpp index a50f759..49b314a 100644 --- a/include/anna/time/functions.hpp +++ b/include/anna/time/functions.hpp @@ -26,7 +26,7 @@ public: /** Initializes global data used on time module. It must be firstly invoked on this module */ - static void initialize() throw(); + static void initialize() ; /** Initializes reference timestamp used for statistics purposes and neccessary on limited 32-bits architectures @@ -34,12 +34,12 @@ public: @param secondsTimestamp Reference timestamp in seconds. By default current is set. */ - static void setControlPoint(unsigned long long int secondsTimestamp = 0) throw(); + static void setControlPoint(unsigned long long int secondsTimestamp = 0) ; /** Gets the seconds reference established by mean #setControlPoint */ - static unsigned long long int getSecondsReference() throw(); + static unsigned long long int getSecondsReference() ; @@ -48,43 +48,43 @@ public: /** Gets initialization state */ - static bool initialized(void) throw(); + static bool initialized(void) ; /** Gets the host user-supplied timezone configuration */ - static const Timezone & getSystemTimezone(void) throw(); + static const Timezone & getSystemTimezone(void) ; /** Get unix timestamp in seconds */ - static unsigned long long int unixSeconds() throw(); + static unsigned long long int unixSeconds() ; /** Get unix timestamp in milliseconds */ - static unsigned long long int unixMilliseconds() throw(); + static unsigned long long int unixMilliseconds() ; /** Get the lapsed milliseconds from the last control point (#setControlPoint) or time module initialization. Used for statistics purposes (performance analysis), specially on 32-bits limited architectures in order to avoid overflow on timestamp structures. */ - static unsigned long long int lapsedMilliseconds() throw(); + static unsigned long long int lapsedMilliseconds() ; /** Get unix timestamp in microseconds */ - static unsigned long long int unixMicroseconds() throw(); + static unsigned long long int unixMicroseconds() ; /** Get string time representation in format 'HH:mm:ss \' Useful for trace accurated time for events. */ - static std::string currentTimeAsString(void) throw(); + static std::string currentTimeAsString(void) ; }; } diff --git a/include/anna/time/internal/Timezone.hpp b/include/anna/time/internal/Timezone.hpp index 532ccc4..fbd463e 100644 --- a/include/anna/time/internal/Timezone.hpp +++ b/include/anna/time/internal/Timezone.hpp @@ -83,20 +83,20 @@ public: } // be careful: empty if unset - const std::string & getValue(void) const throw() { + const std::string & getValue(void) const { return (a_value); } - bool isInitialized(void) const throw() { + bool isInitialized(void) const { return (a_initialized); } //Unset is when getenv("TZ") returns NULL. Then, /etc/localtime used to be a copy or symlink to // any of the /usr/share/zoneinfo available timezones. - bool unsetTZ(void) const throw() { return (a_unsetTZ); } + bool unsetTZ(void) const { return (a_unsetTZ); } - bool apply() const throw() { + bool apply() const { // http://stackoverflow.com/questions/5873029/questions-about-putenv-and-setenv if(unsetTZ()) { unsetenv("TZ"); @@ -120,7 +120,7 @@ public: return true; } - std::string asString() const throw() { + std::string asString() const { std::string result = getValue(); if (unsetTZ()) return "[TZ unset]"; if (result == "") return "[TZ empty]"; diff --git a/include/anna/time/internal/sccs.hpp b/include/anna/time/internal/sccs.hpp index afabdb9..369d780 100644 --- a/include/anna/time/internal/sccs.hpp +++ b/include/anna/time/internal/sccs.hpp @@ -15,7 +15,7 @@ namespace time { class sccs { public: - static void activate() throw(); + static void activate() ; }; } diff --git a/include/anna/timex/Clock.hpp b/include/anna/timex/Clock.hpp index fbff5dd..5b9df65 100644 --- a/include/anna/timex/Clock.hpp +++ b/include/anna/timex/Clock.hpp @@ -35,7 +35,7 @@ public: \return Una cadena con la informacion referenta a este reloj. */ std::string asString() const - throw() { + { std::string msg("Clock { "); msg += TimeEvent::asString(); msg += " | Name: "; @@ -50,12 +50,12 @@ public: \return \em true si el reloj desea continuar recibiendo los pulsos periodicamente o \em false en otro caso. */ - virtual bool tick() throw(RuntimeException) = 0; + virtual bool tick() noexcept(false) = 0; private: std::string a_name; - void expire(Engine* timeController) throw(RuntimeException); + void expire(Engine* timeController) noexcept(false); }; } diff --git a/include/anna/timex/Context.hpp b/include/anna/timex/Context.hpp index ab66859..8d72b4c 100644 --- a/include/anna/timex/Context.hpp +++ b/include/anna/timex/Context.hpp @@ -60,7 +60,7 @@ public: * \return La nueva transación que ya habrá sido activada. */ Transaction* open(const Tid& tid, const int classType = 0) - throw(RuntimeException) { + noexcept(false) { Transaction* result = NULL; { Guard guard(a_mutex, "timex::Context::open"); @@ -110,7 +110,7 @@ public: * \return La transación correspondiente al identificador recibido. Puede ser NULL. */ Transaction* find(const Tid& tid, const Exception::Mode::_v emode = Exception::Mode::Throw) - throw(RuntimeException) { + noexcept(false) { Guard guard(a_mutex, "timex::Context::find"); transaction_iterator ii = a_transactions.find(tid); Transaction* result = (ii != a_transactions.end()) ? transaction(ii) : NULL; @@ -138,7 +138,7 @@ public: * \return El identificador de aplicación indicado en el método #open. */ const Tid& getIdentifier(const Transaction* transaction) const - throw(RuntimeException) { + noexcept(false) { if(transaction == NULL) throw RuntimeException("timex::Context::getIdentifier | Can not work with NULL transaction", ANNA_FILE_LOCATION); @@ -159,7 +159,7 @@ public: * \param transaction Transación a terminar. Si fuera NULL este método no tiene ningún efecto. */ void close(Transaction* transaction) - throw() { + { if(transaction == NULL) return; @@ -182,7 +182,7 @@ public: * \return Un documento XML con la información relevante de esta clase. */ virtual xml::Node* asXML(xml::Node* parent) const - throw() { + { xml::Node* result = parent->createChild("timex.Context"); result->createAttribute("Size", a_transactions.size()); result->createAttribute("AvgSize", (a_counter == 0) ? 0 : a_accSize / a_counter); @@ -200,7 +200,7 @@ public: * Puede ser NULL. */ static const Context* getInstance(const Transaction* transaction) - throw(RuntimeException) { + noexcept(false) { if(transaction == NULL) throw RuntimeException("timex::Context::getInstance | Can not work with NULL transaction", ANNA_FILE_LOCATION); @@ -231,14 +231,14 @@ protected: * tenga que gestionar varios tipos de transaciones u operaciones. * \return Una nueva transación que puede ser usada por este contexto. */ - virtual Transaction* createTransaction(const int classType) throw() = 0; + virtual Transaction* createTransaction(const int classType) = 0; /** * Método virtual puro que liberá el espacio asociado a la transación recibida como parámetro. * Lo más adecuado sería implementar este método mediate el uso del patrón #anna::Recycler. * \param transaction Transación a liberar. */ - virtual void releaseTransaction(Transaction* transaction) throw() = 0; + virtual void releaseTransaction(Transaction* transaction) = 0; /** * Método virtual puro que debe devolver una \em std::string correspondiente al valor del identificador @@ -246,14 +246,14 @@ protected: * \param tid Identificador único que la transación. * \return una \em std::string correspondiente al valor del identificador recibido como parámetro. */ - virtual std::string identifierAsString(const Tid& tid) const throw() = 0; + virtual std::string identifierAsString(const Tid& tid) const = 0; /** * Método virtual puro que debe devolver la clave de aplicación asociada a una transación * \param tid Puntero que apunta a la clave de aplicación usada para acceder a una transacción. * \return La clave de aplicación correspondiente al puntero recibido como parámetro. */ - virtual const Tid& contextAsIdentifier(const void* tid) const throw() = 0; + virtual const Tid& contextAsIdentifier(const void* tid) const = 0; private: typedef typename std::map transaction_container; @@ -270,7 +270,7 @@ private: /* Método re-implementado de timex::TimeEventObserver */ void release(timex::TimeEvent* event) - throw() { + { Transaction* tt = static_cast (event); Guard guard(a_mutex, "timex::Context::release"); // Calcula la duración media de las transaciones de este contexto. @@ -298,7 +298,7 @@ private: a_accSize += a_transactions.size(); } - static Transaction* transaction(transaction_iterator ii) throw() { return ii->second; } + static Transaction* transaction(transaction_iterator ii) { return ii->second; } }; } diff --git a/include/anna/timex/Engine.hpp b/include/anna/timex/Engine.hpp index 4283d15..ff8555c 100644 --- a/include/anna/timex/Engine.hpp +++ b/include/anna/timex/Engine.hpp @@ -45,7 +45,7 @@ class TickProducer; #include void cualquierFuncion (Timer* timer) - throw (RuntimeException) + noexcept(false) { Engine* timeController = anna::component (FILE_LOCATION); timerController->activate (timer); @@ -86,13 +86,13 @@ public: Devuelve la resolucion del controlador de tiempo indicada en el contructor. \return la resolucion del controlador de tiempo indicada en el contructor. */ - const Millisecond & getResolution() const throw() { return a_resolution; } + const Millisecond & getResolution() const { return a_resolution; } /** Devuelve el periodo máximo de temporización indicado en el constructor. \return el periodo máximo de temporización indicado en el constructor. */ - const Millisecond & getMaxTimeout() const throw() { return a_maxTimeout; } + const Millisecond & getMaxTimeout() const { return a_maxTimeout; } /** Deja en suspenso la creacion de pulsos de reloj. Los temporizadores que estuvieran activos @@ -100,12 +100,12 @@ public: Para activar el sistema de control de tiempo debe invocarse al metodo play. \warning Si el gestor de tiempo esta en modo pausa no se pueden activar eventos temporales. */ - void pause() throw(RuntimeException); + void pause() noexcept(false); /** Reactiva la creacion de pulsos de reloj despues de la invocacion al metodo pause */ - void play() throw(RuntimeException); + void play() noexcept(false); /** Activa el evento de tiempo recibido como parametro. Si transcurre el tiempo indicado por @@ -114,7 +114,7 @@ public: @param timeEvent Evento de tiempo que vamos a activar. */ - void activate(TimeEvent* timeEvent) throw(RuntimeException); + void activate(TimeEvent* timeEvent) noexcept(false); /** Activa el evento de tiempo recibido como parametro. Si transcurre el tiempo indicado por @@ -124,7 +124,7 @@ public: @param timeEvent Evento de tiempo que vamos a activar. \warning Si el gestor de tiempo esta en modo pausa no se pueden activar eventos temporales. */ - void activate(TimeEvent& timeEvent) throw(RuntimeException) { activate(&timeEvent); } + void activate(TimeEvent& timeEvent) noexcept(false) { activate(&timeEvent); } /** Cancela la ejecucion del evento de tiempo recibido como parametro. Si el evento no esta @@ -133,7 +133,7 @@ public: @param timeEvent Evento de tiempo que vamos a desactivar. \warning Si el gestor de tiempo esta en modo pausa no se pueden activar eventos temporales. */ - void cancel(TimeEvent* timeEvent) throw(RuntimeException); + void cancel(TimeEvent* timeEvent) noexcept(false); /** Cancela la ejecucion del evento de tiempo recibido como parametro. Si el evento no esta @@ -141,7 +141,7 @@ public: @param timeEvent Evento de tiempo que vamos a desactivar. */ - void cancel(TimeEvent& timeEvent) throw(RuntimeException) { cancel(&timeEvent); } + void cancel(TimeEvent& timeEvent) noexcept(false) { cancel(&timeEvent); } /** Obtiene el evento de tiempo asociado al identificador recibido. @@ -151,13 +151,13 @@ public: \return La referencia al evento de tiempo asociado al identificador recibido o NULL en caso de que exista ningn evento que coincida con el identificador. */ - TimeEvent* getTimeEvent(const TimeEvent::Id eventTimeId) throw(); + TimeEvent* getTimeEvent(const TimeEvent::Id eventTimeId) ; /** metodo que podemos reescribir para manejar el evento que nos informa de que el controlador de tiempo va a empezar a comprobar eventos de tiempo caducados. Por defecto no hace nada. */ - virtual void eventBeginQuantum() throw(RuntimeException) {;} + virtual void eventBeginQuantum() noexcept(false) {;} /** metodo que podemos reescribir para manejar el evento que nos informa de que el controlador de @@ -165,20 +165,20 @@ public: @param quantumSize Nmero de eventos procesados en este quantum de tiempo. */ - virtual void eventEndQuantum(const int quantumSize) throw(RuntimeException) {;} + virtual void eventEndQuantum(const int quantumSize) noexcept(false) {;} /** Devuelve una cadena con la informacion mas relevante de esta instancia. \return Una cadena con la informacion mas relevante de esta instancia. */ - virtual std::string asString() const throw(); + virtual std::string asString() const ; /** Devuelve un documento XML con la informacion mas relevante de esta instancia. \param parent Nodo XML del que colgar la informacion referente a esta instancia. \return Un documento XML con la informacion mas relevante de esta instancia. */ - virtual xml::Node* asXML(xml::Node* parent) const throw(); + virtual xml::Node* asXML(xml::Node* parent) const ; /** Devuelve la cadena por la que podemos buscar el componente. @@ -206,20 +206,20 @@ private: Quantum a_delayedQuantum; pthread_t a_threadProducer; - void do_initialize() throw(RuntimeException); - void do_stop() throw(); - void kill() throw(); + void do_initialize() noexcept(false); + void do_stop() ; + void kill() ; - void tick() throw(RuntimeException); - int getQuantum(const int timeout) const throw() { return (a_currentQuantum + (timeout / a_resolution)) % a_maxQuantum; } - void calibrate() throw(); + void tick() noexcept(false); + int getQuantum(const int timeout) const { return (a_currentQuantum + (timeout / a_resolution)) % a_maxQuantum; } + void calibrate() ; // Reimplementado de app::Component - void do_cloneParent() throw(); - void do_cloneChild() throw(RuntimeException); + void do_cloneParent() ; + void do_cloneChild() noexcept(false); - static void notifyRelease(TimeEvent* timeEvent) throw(); - static TimeEvent* timeEvent(quantum_iterator& ii) throw() { return *ii; } + static void notifyRelease(TimeEvent* timeEvent) ; + static TimeEvent* timeEvent(quantum_iterator& ii) { return *ii; } friend class TickProducer; friend class TickConsumer; diff --git a/include/anna/timex/Meter.hpp b/include/anna/timex/Meter.hpp index 8ba643d..5854d9f 100644 --- a/include/anna/timex/Meter.hpp +++ b/include/anna/timex/Meter.hpp @@ -59,7 +59,7 @@ public: * \warning Elimina el punto de referencia temporal que puediera haberse establecido con #setTopReference. * \return El número de milisegundos transcurridos desde la última vez que inicializamos la cuenta de temporizacion. */ - Millisecond setControlPoint() throw() { + Millisecond setControlPoint() { Millisecond now = functions::millisecond(); Millisecond result = (now > a_timestamp) ? (now - a_timestamp) : (Millisecond)0; a_timestamp = now; @@ -80,12 +80,12 @@ public: * esa tarea ha sido finalidad. * */ - void setTopReference(const Millisecond & topReference) throw() { a_topReference = topReference; } + void setTopReference(const Millisecond & topReference) { a_topReference = topReference; } /** * Elimina el punto de referencia temporal. */ - void clearTopReference() throw() { a_topReference = 0; } + void clearTopReference() { a_topReference = 0; } /** * Devuelve el número de milisegundos transcurridos desde la última vez que inicializamos la cuenta de temporización. @@ -95,7 +95,7 @@ public: * \return El número de milisegundos transcurridos desde la última vez que inicializamos la cuenta de temporizacion. * \warning Si detecta algun fallo devolvera 0. */ - Millisecond getDelay() const throw() { + Millisecond getDelay() const { Millisecond now = (a_topReference == 0) ? functions::millisecond() : a_topReference; return (now > a_timestamp) ? (now - a_timestamp) : (Millisecond)0; } @@ -106,13 +106,13 @@ public: * \warning Elimina el punto de referencia temporal que puediera haberse establecido con #setTopReference. * \see anna::functions::millisecond. */ - Meter& operator= (const Millisecond & timestamp) throw() { a_timestamp = timestamp; a_topReference = 0; return *this; } + Meter& operator= (const Millisecond & timestamp) { a_timestamp = timestamp; a_topReference = 0; return *this; } /** * Operador copia. * \param other Instancia de la que copiar. */ - Meter& operator= (const Meter& other) throw() { a_timestamp = other.a_timestamp; a_topReference = other.a_topReference; return *this; } + Meter& operator= (const Meter& other) { a_timestamp = other.a_timestamp; a_topReference = other.a_topReference; return *this; } private: Millisecond a_topReference; diff --git a/include/anna/timex/MicroMeter.hpp b/include/anna/timex/MicroMeter.hpp index 95f03be..dcbed19 100644 --- a/include/anna/timex/MicroMeter.hpp +++ b/include/anna/timex/MicroMeter.hpp @@ -59,7 +59,7 @@ public: * \warning Elimina el punto de referencia temporal que puediera haberse establecido con #setTopReference. * \return El número de milisegundos transcurridos desde la última vez que inicializamos la cuenta de temporizacion. */ - Microsecond setControlPoint() throw() { + Microsecond setControlPoint() { Microsecond now = functions::microsecond(); Microsecond result = (now > a_timestamp) ? (now - a_timestamp) : (Microsecond)0; a_timestamp = now; @@ -79,12 +79,12 @@ public: * la marca de tiempo) y el núcleo y demás partes pueden tener conocimiento de que * esa tarea ha sido finalidad. */ - void setTopReference(const Microsecond & topReference) throw() { a_topReference = topReference; } + void setTopReference(const Microsecond & topReference) { a_topReference = topReference; } /** * Elimina el punto de referencia temporal. */ - void clearTopReference() throw() { a_topReference = (Microsecond)0; } + void clearTopReference() { a_topReference = (Microsecond)0; } /** * Devuelve el número de milisegundos transcurridos desde la última vez que inicializamos la cuenta de temporización. @@ -94,7 +94,7 @@ public: * \return El número de milisegundos transcurridos desde la última vez que inicializamos la cuenta de temporizacion. * \warning Si detecta algun fallo devolvera 0. */ - Microsecond getDelay() const throw() { + Microsecond getDelay() const { Microsecond now = (a_topReference == 0) ? functions::microsecond() : a_topReference; return (now > a_timestamp) ? (now - a_timestamp) : (Microsecond)0; } @@ -105,13 +105,13 @@ public: * \warning Elimina el punto de referencia temporal que puediera haberse establecido con #setTopReference. * \see anna::functions::microsecond. */ - MicroMeter& operator= (const Microsecond & timestamp) throw() { a_timestamp = timestamp; a_topReference = (Microsecond)0; return *this; } + MicroMeter& operator= (const Microsecond & timestamp) { a_timestamp = timestamp; a_topReference = (Microsecond)0; return *this; } /** * Operador copia. * \param other Instancia de la que copiar. */ - MicroMeter& operator= (const MicroMeter& other) throw() { a_timestamp = other.a_timestamp; a_topReference = other.a_topReference; return *this; } + MicroMeter& operator= (const MicroMeter& other) { a_timestamp = other.a_timestamp; a_topReference = other.a_topReference; return *this; } private: Microsecond a_topReference; diff --git a/include/anna/timex/TimeEvent.hpp b/include/anna/timex/TimeEvent.hpp index b2fcf79..d399420 100644 --- a/include/anna/timex/TimeEvent.hpp +++ b/include/anna/timex/TimeEvent.hpp @@ -44,13 +44,13 @@ public: Devuelve el identificador de este evento. \return El identificador de este evento. */ - Id getId() const throw() { return a_id; } + Id getId() const { return a_id; } /** Devuelve la duracion maxima a este evento indicada en milisegundos. @return La duracion maxima de este evento indicada en milisegundos. */ - const Millisecond & getTimeout() const throw() { return a_timeout; } + const Millisecond & getTimeout() const { return a_timeout; } /** Devuelve la instancia del objeto encargado de gestionar el espacio asociado a @@ -58,7 +58,7 @@ public: \return La instancia del objeto encargado de gestionar el espacio asociado a esta instancia. */ - const TimeEventObserver* getObserver() const throw() { return a_observer; } + const TimeEventObserver* getObserver() const { return a_observer; } /** Establece el identificador de este evento de tiempo. @@ -66,13 +66,13 @@ public: \warning Exclusivamente uso interno. */ - void setId(const Id id) throw() { a_id = id; } + void setId(const Id id) { a_id = id; } /** Establece la duracion de este evento indicada en milisegundos. \param timeout Establece la duracion de este evento. */ - void setTimeout(const Millisecond & timeout) throw() { a_timeout = timeout; } + void setTimeout(const Millisecond & timeout) { a_timeout = timeout; } /** Establece la instancia de objeto encargado de gestionar el espacio asociado a esta @@ -82,19 +82,19 @@ public: \param observer Instancia del objeto encargada de gestional el espacio asignado a esta instancia. */ - void setObserver(TimeEventObserver* observer) throw() { a_observer = observer; } + void setObserver(TimeEventObserver* observer) { a_observer = observer; } /** Devuelve el estado de activacin de este evento de tiempo. @return \em false si el evento esta activado o \em false en otro caso. */ - bool isActive() const throw() { return (a_controller != NULL); } + bool isActive() const { return (a_controller != NULL); } /** Devuelve una cadena con la informacion sobre este evento. \return Una cadena con la informacion sobre este evento. */ - virtual std::string asString() const throw(); + virtual std::string asString() const ; protected: /** @@ -127,7 +127,7 @@ protected: @param timeController Controlador de tiempo asociado al evento que esta expirando. */ - virtual void expire(Engine* timeController) throw(RuntimeException) = 0; + virtual void expire(Engine* timeController) noexcept(false) = 0; /** metodo que debemos re-escribir para particularizar el comportamiento de nuestra clase cuando @@ -137,7 +137,7 @@ protected: Las acciones realizadas nunca deber�n generar nuevos eventos. Por defecto no hace nada. */ - virtual void stop() throw(RuntimeException) {;} + virtual void stop() noexcept(false) {;} private: Id a_id; diff --git a/include/anna/timex/TimeEventObserver.hpp b/include/anna/timex/TimeEventObserver.hpp index ec26c12..c539bf0 100644 --- a/include/anna/timex/TimeEventObserver.hpp +++ b/include/anna/timex/TimeEventObserver.hpp @@ -43,7 +43,7 @@ public: \return Una cadena con la informacion referenta a este temporizador. */ std::string asString() const - throw() { + { std::string msg("timex::TimeEventObserver { Name: "); msg += a_name; return msg += " }"; @@ -58,7 +58,7 @@ protected: \param timeEvent Evento temporal a liberar. */ - virtual void release(timex::TimeEvent* timeEvent) throw() = 0; + virtual void release(timex::TimeEvent* timeEvent) = 0; private: std::string a_name; diff --git a/include/anna/timex/Timer.hpp b/include/anna/timex/Timer.hpp index 4bd1e39..3ab7954 100644 --- a/include/anna/timex/Timer.hpp +++ b/include/anna/timex/Timer.hpp @@ -40,7 +40,7 @@ public: \return Una cadena con la informacion referenta a este temporizador. */ std::string asString() const - throw() { + { std::string msg("Timer { "); msg += TimeEvent::asString(); msg += " | Name: "; diff --git a/include/anna/timex/Transaction.hpp b/include/anna/timex/Transaction.hpp index 9b4444b..2e15ed8 100644 --- a/include/anna/timex/Transaction.hpp +++ b/include/anna/timex/Transaction.hpp @@ -63,26 +63,26 @@ public: Devuelve el contexto asociado a esta transaccion. \return El contexto asociado a esta transaccion. */ - void* getContext() throw() { return a_context; } + void* getContext() { return a_context; } /** Devuelve el contexto asociado a esta transaccion. \return El contexto asociado a esta transaccion. */ - const void* getContext() const throw() { return a_context; } + const void* getContext() const { return a_context; } /** Establece el contexto asociado a esta transaccion. \param context Contexto asociado a esta transaccion. */ - void setContext(void* context) throw() { a_context = context; } + void setContext(void* context) { a_context = context; } /** Devuelve una cadena con la informacion referente a este temporizador. \return Una cadena con la informacion referenta a este temporizador. */ virtual std::string asString() const - throw() { + { std::string msg("Transaction { "); msg += TimeEvent::asString(); msg += " | Contexto: "; diff --git a/include/anna/timex/internal/TickConsumer.hpp b/include/anna/timex/internal/TickConsumer.hpp index f74fbd9..5e4920a 100644 --- a/include/anna/timex/internal/TickConsumer.hpp +++ b/include/anna/timex/internal/TickConsumer.hpp @@ -30,18 +30,18 @@ public: a_pipe [0] = a_pipe [1] = -1; } - int getfdWrite() const throw() { return a_pipe [1]; } + int getfdWrite() const { return a_pipe [1]; } - std::string asString() const throw(); + std::string asString() const ; private: Engine& a_timeController; int a_pipe [2]; - void initialize() throw(RuntimeException); - void apply() throw(RuntimeException); - void finalize() throw(); - void clone() throw(RuntimeException); + void initialize() noexcept(false); + void apply() noexcept(false); + void finalize() ; + void clone() noexcept(false); }; } diff --git a/include/anna/timex/internal/TickProducer.hpp b/include/anna/timex/internal/TickProducer.hpp index 687ccff..16d6f18 100644 --- a/include/anna/timex/internal/TickProducer.hpp +++ b/include/anna/timex/internal/TickProducer.hpp @@ -23,10 +23,10 @@ class Engine; */ class TickProducer { public: - void requestStop() throw() { a_requestedStop = true; } + void requestStop() { a_requestedStop = true; } // Para poder clonarlo - void setfd(const int fd) throw() { a_fdWrite = fd; } + void setfd(const int fd) { a_fdWrite = fd; } private: Engine& a_timeController; @@ -37,14 +37,14 @@ private: TickProducer(Engine* timeController, const int fdWrite); - bool isInPause() const throw() { return a_isInPause; } - void setIsInPause(const bool isInPause) throw() { a_isInPause = isInPause; } + bool isInPause() const { return a_isInPause; } + void setIsInPause(const bool isInPause) { a_isInPause = isInPause; } - void tick() throw(); - void resetExpectedTime() throw() { a_expectedTime = 0; } - Millisecond calculeSlice(const Millisecond & msnow) throw(); + void tick() ; + void resetExpectedTime() { a_expectedTime = 0; } + Millisecond calculeSlice(const Millisecond & msnow) ; - static void* exec(void* arg) throw(); + static void* exec(void* arg) ; friend class Engine; }; diff --git a/include/anna/timex/internal/sccs.hpp b/include/anna/timex/internal/sccs.hpp index aa7e3d1..66758ff 100644 --- a/include/anna/timex/internal/sccs.hpp +++ b/include/anna/timex/internal/sccs.hpp @@ -15,7 +15,7 @@ namespace timex { class sccs { public: - static void activate() throw(); + static void activate() ; }; } diff --git a/include/anna/xml/Attribute.hpp b/include/anna/xml/Attribute.hpp index cd76d11..0d49885 100644 --- a/include/anna/xml/Attribute.hpp +++ b/include/anna/xml/Attribute.hpp @@ -38,25 +38,25 @@ public: Devuelve el nombre de este atributo. \return Nombre de este atributo. */ - const char* getName() const throw() { return a_name.c_str(); } + const char* getName() const { return a_name.c_str(); } /** * Devuelve el namespace asociado a este atributo. Puede ser NULL. * \return el namespace asociado a este atributo. Puede ser NULL. */ - const Namespace* getNamespace() const throw() { return a_namespace; } + const Namespace* getNamespace() const { return a_namespace; } /** * Devuelve el nombre del nodo. * \return El nombre del nodo. */ - const std::string& getNameAsString() const throw() { return a_name; } + const std::string& getNameAsString() const { return a_name; } /** Devuelve una cadena con toda la informacion relevante de esta instancia. \return Una cadena con toda la informacion relevante de esta instancia. */ - std::string asString() const throw(); + std::string asString() const ; private: std::string a_name; @@ -67,8 +67,8 @@ private: virtual ~Attribute() {;} - void setName(const char* name) throw() { a_name = name; } - void setNamespace(const Namespace* _namespace) throw() { a_namespace = _namespace; } + void setName(const char* name) { a_name = name; } + void setNamespace(const Namespace* _namespace) { a_namespace = _namespace; } friend class Node; friend class Allocator; diff --git a/include/anna/xml/Binary.hpp b/include/anna/xml/Binary.hpp index b9bdf80..3b62f26 100644 --- a/include/anna/xml/Binary.hpp +++ b/include/anna/xml/Binary.hpp @@ -36,7 +36,7 @@ protected: string_pool a_strings; - static int sizeOf(const Addressing::_v v) throw() { return v >> 3; } + static int sizeOf(const Addressing::_v v) { return v >> 3; } }; } diff --git a/include/anna/xml/Compiler.hpp b/include/anna/xml/Compiler.hpp index 43e93ce..3a4f903 100644 --- a/include/anna/xml/Compiler.hpp +++ b/include/anna/xml/Compiler.hpp @@ -51,7 +51,7 @@ public: \param flag Combinacion de valores que configura la forma de crear el documento. \return Una cadena con el documento XML correspondiente al nodo recibido. */ - const char* apply(const Node* node, const int flag = Mode::Visual) throw(RuntimeException); + const char* apply(const Node* node, const int flag = Mode::Visual) noexcept(false); /** Obtiene el documento XML correspondiente al nodo recibido. @@ -60,7 +60,7 @@ public: \param flag Combinacion de valores que configura la forma de crear el documento. \return Una cadena con el documento XML correspondiente al nodo recibido. */ - const char* apply(const Document& document, const Node* node, const int flag = Mode::Visual) throw(RuntimeException); + const char* apply(const Document& document, const Node* node, const int flag = Mode::Visual) noexcept(false); private: class Result { @@ -71,46 +71,46 @@ private: } ~Result() { delete [] a_buffer; } - void clear() throw() { a_buffer [a_size = 0] = 0; } + void clear() { a_buffer [a_size = 0] = 0; } void operator += (const char c) - throw(RuntimeException) { + noexcept(false) { extend(sizeof(c) * 2); a_buffer [a_size ++] = c; a_buffer [a_size] = 0; } void operator += (const char* str) - throw(RuntimeException) { + noexcept(false) { const int len = anna_strlen(str); extend(len + 1); anna_strcpy(a_buffer + a_size, str); a_size += len; } - void operator += (const std::string& str) throw(RuntimeException) {(*this) += str.c_str(); } + void operator += (const std::string& str) noexcept(false) {(*this) += str.c_str(); } - const char* c_str() const throw() { return a_buffer; } + const char* c_str() const { return a_buffer; } private: char* a_buffer; int a_size; int a_maxSize; - void extend(const int size) throw(RuntimeException); + void extend(const int size) noexcept(false); }; Result a_result; Compiler(const Compiler&); - static void apply(const Node*, Result&, const int level, const int flags) throw(RuntimeException); - static void apply(const Node*, Result&, const int flags) throw(RuntimeException); + static void apply(const Node*, Result&, const int level, const int flags) noexcept(false); + static void apply(const Node*, Result&, const int flags) noexcept(false); static void open(const Node*, Result&, const int level, const bool quickClose, const bool newline, const int flags) - throw(RuntimeException); - static void writeFullName(const Node*, Result&, const int flags) throw(RuntimeException); - static void writeFullName(const Attribute*, Result&, const int flags) throw(RuntimeException); - static void close(const Node*, Result&, const int level, const int flags) throw(RuntimeException); + noexcept(false); + static void writeFullName(const Node*, Result&, const int flags) noexcept(false); + static void writeFullName(const Attribute*, Result&, const int flags) noexcept(false); + static void close(const Node*, Result&, const int level, const int flags) noexcept(false); }; } diff --git a/include/anna/xml/Compressor.hpp b/include/anna/xml/Compressor.hpp index da61c84..69dc00b 100644 --- a/include/anna/xml/Compressor.hpp +++ b/include/anna/xml/Compressor.hpp @@ -39,7 +39,7 @@ public: * \param node Nodo que contiene el árbol de nodos XML que queremos comprimir. * \return Un bloque de datos binario que contiene la información representada por el nodo. * */ - const DataBlock& apply(const Document& xmlDoc) throw(RuntimeException); + const DataBlock& apply(const Document& xmlDoc) noexcept(false); private: Compressor(const Compressor&); diff --git a/include/anna/xml/DTD.hpp b/include/anna/xml/DTD.hpp index 6c8948c..361b53d 100644 --- a/include/anna/xml/DTD.hpp +++ b/include/anna/xml/DTD.hpp @@ -65,7 +65,7 @@ public: \param content Contenido de la DTD, depedendiendo del tipo de DTD hara referencia a un nombre de archivo, una URI o a una cadena. */ - void initialize(const char* content) throw(RuntimeException); + void initialize(const char* content) noexcept(false); protected: /** @@ -77,8 +77,8 @@ private: Mutex a_mutex; _xmlDtd* a_handle; - void validate(_xmlValidCtxt* context, _xmlDoc* document) const throw(RuntimeException); - virtual _xmlDtd* parse(const char* content) const throw(RuntimeException) = 0; + void validate(_xmlValidCtxt* context, _xmlDoc* document) const noexcept(false); + virtual _xmlDtd* parse(const char* content) const noexcept(false) = 0; friend class Parser; }; diff --git a/include/anna/xml/DTDFile.hpp b/include/anna/xml/DTDFile.hpp index da1e5fd..15b45e6 100644 --- a/include/anna/xml/DTDFile.hpp +++ b/include/anna/xml/DTDFile.hpp @@ -28,7 +28,7 @@ public: DTDFile(const char *file = NULL) { if (file) initialize(file); } private: - _xmlDtd* parse(const char* fileName) const throw(RuntimeException); + _xmlDtd* parse(const char* fileName) const noexcept(false); }; } diff --git a/include/anna/xml/DTDMemory.hpp b/include/anna/xml/DTDMemory.hpp index 0a33ac5..8f391de 100644 --- a/include/anna/xml/DTDMemory.hpp +++ b/include/anna/xml/DTDMemory.hpp @@ -33,7 +33,7 @@ public: private: std::string a_filename; - _xmlDtd* parse(const char* content) const throw(RuntimeException); + _xmlDtd* parse(const char* content) const noexcept(false); }; } diff --git a/include/anna/xml/Data.hpp b/include/anna/xml/Data.hpp index f1c46c1..e4b7738 100644 --- a/include/anna/xml/Data.hpp +++ b/include/anna/xml/Data.hpp @@ -41,43 +41,43 @@ public: Devuelve el valor asociado a este dato XML. \return El valor asociado a este dato XML. */ - const std::string& getValue() const throw() { return a_value; } + const std::string& getValue() const { return a_value; } /** Devuelve el valor asociado a este dato XML. \return El valor asociado a este dato XML. */ - const char* getCStringValue() const throw() { return a_value.c_str(); } + const char* getCStringValue() const { return a_value.c_str(); } /** Devuelve el valor numerico asociado a este dato XML. \return El valor numerico asociado a este dato XML. */ - int getIntegerValue() const throw() { return atoi(a_value.c_str()); } + int getIntegerValue() const { return atoi(a_value.c_str()); } /** * Establece el valor de éste dato XML. * \param value Valor que tomará éste dato XML. */ - void setValue(const char* value) throw() { a_value = (value != NULL) ? value : ""; filter(a_value); } + void setValue(const char* value) { a_value = (value != NULL) ? value : ""; filter(a_value); } /** * Establece el valor de éste dato XML. * \param value Valor que tomará éste dato XML. */ - void setValue(const std::string& value) throw() { a_value = value; } + void setValue(const std::string& value) { a_value = value; } /** * Establece el valor de éste dato XML. * \param value Valor que tomará éste dato XML. */ - void setValue(const int value) throw(); + void setValue(const int value) ; /** Devuelve una cadena con toda la informacion relevante de esta instancia. \return Una cadena con toda la informacion relevante de esta instancia. */ - virtual std::string asString() const throw(); + virtual std::string asString() const ; protected: /** @@ -89,7 +89,7 @@ private: std::string a_value; Node* a_owner; - void setNode(Node* node) throw() { a_owner = node; } + void setNode(Node* node) { a_owner = node; } /** Filtra la cadena recibida como parametro para asegurar que no contiene ninguna @@ -97,7 +97,7 @@ private: este valor. \return La instancia de la cadena una vez modificada. */ - static const std::string& filter(const std::string& str) throw() { return str; } + static const std::string& filter(const std::string& str) { return str; } friend class Node; }; diff --git a/include/anna/xml/Decompressor.hpp b/include/anna/xml/Decompressor.hpp index a4753ab..66ea4e9 100644 --- a/include/anna/xml/Decompressor.hpp +++ b/include/anna/xml/Decompressor.hpp @@ -44,7 +44,7 @@ public: * \param dataBlock Bloque de datos obtenido como resultado de invocar a Compressor::apply. * \return El documento XML comprimido en el bloque de datos. */ - const Document& apply(const DataBlock& dataBlock) throw(RuntimeException); + const Document& apply(const DataBlock& dataBlock) noexcept(false); private: Document* a_document; diff --git a/include/anna/xml/Document.hpp b/include/anna/xml/Document.hpp index dafa744..8a32b0a 100644 --- a/include/anna/xml/Document.hpp +++ b/include/anna/xml/Document.hpp @@ -58,56 +58,56 @@ public: \param content Contenido de la Documento, depedendiendo del tipo de Documento hara referencia a un nombre de archivo, una URI o a una cadena. */ - void initialize(const char* content) throw(RuntimeException); + void initialize(const char* content) noexcept(false); /** Inicializa el contenido del documento XML. \param content Contenido del Documento XML. */ - void initialize(const DataBlock& content) throw(RuntimeException); + void initialize(const DataBlock& content) noexcept(false); /** * Obtiene el conjunto de caracteres usado en el documento XML. Puede ser NULL. * \return El conjunto de caracteres usado en el documento XML. */ - const char* getEncoding() const throw(); + const char* getEncoding() const ; /** * Obtiene la versión indicada en el documento XML.Puede ser NULL. * \return La versión indicada en el documento XML. */ - const char* getVersion() const throw(); + const char* getVersion() const ; /** Devuelve el contenido asociado al documento XML. \return El contenido asociado al documento XML. */ - virtual const DataBlock& getContent() const throw(RuntimeException) { return *this; } + virtual const DataBlock& getContent() const noexcept(false) { return *this; } /** Devuelve el contenido asociado al documento XML expresado como una cadena C. \return El contenido asociado al documento XML expresado como una cadena C. */ - const char* getContentAsCString() const throw(RuntimeException); + const char* getContentAsCString() const noexcept(false); /** * Establece el conjunto de caracteres usado en el documento XML. * \param encoding Literal que indica el conjunto de caracteres. Puede ser NULL. */ - void setEncoding(const char* encoding) throw(); + void setEncoding(const char* encoding) ; /** * Establece la versión usada en el documento XML. * \param encoding Literal que indica la versión. Puede ser NULL. */ - void setVersion(const char* version) throw(); + void setVersion(const char* version) ; /** * Analiza el contenido del documento XML y devuelve el nodo raíz. * \return El nodo raiz del arbol XML correspondiente al resultado del analisis. * \warning Este documento debe estar correctamente inicializado. */ - const xml::Node* parse() throw(RuntimeException); + const xml::Node* parse() noexcept(false); /** * Analiza el documento XML recibido como parametro, y verifica que cumpla las reglas @@ -116,7 +116,7 @@ public: * \return El nodo raiz del arbol XML correspondiente al resultado del analisis. * \warning Este documento debe estar correctamente inicializado. */ - const xml::Node* parse(const DTD& dtd) throw(RuntimeException); + const xml::Node* parse(const DTD& dtd) noexcept(false); protected: /** @@ -127,13 +127,13 @@ protected: /** * Libera la memoria asociada a los componentes de este documento. */ - void clear() throw(); + void clear() ; /* * Establece el contenido de este documento XML. * \param content Buffer que contiene una C-String con la que inciar este documento XML. */ - void setContent(const char* content) throw() { + void setContent(const char* content) { DataBlock::clear(); DataBlock::append(content, anna_strlen(content) + 1); a_contentIsCString = true; @@ -145,7 +145,7 @@ protected: * \param size Longitud del buffer. * \warning Sólo uso interno */ - void setContent(const char* content, const int size) throw() { + void setContent(const char* content, const int size) { DataBlock::clear(); DataBlock::append(content, size); a_contentIsCString = false; @@ -155,7 +155,7 @@ protected: * Establece el contenido de este documento XML. * \param content Bloque de datos del que copiar el valor para iniciar este documento XML. */ - void setContent(const DataBlock& content) throw() { + void setContent(const DataBlock& content) { DataBlock::operator= (content); a_contentIsCString = false; } @@ -170,8 +170,8 @@ private: Document(const Document&); - virtual _xmlDoc* do_initialize(const char* content) throw(RuntimeException) = 0; - virtual _xmlDoc* do_initialize(const DataBlock& content) throw(RuntimeException) = 0; + virtual _xmlDoc* do_initialize(const char* content) noexcept(false) = 0; + virtual _xmlDoc* do_initialize(const DataBlock& content) noexcept(false) = 0; friend class Parser; friend class XPath; diff --git a/include/anna/xml/DocumentFile.hpp b/include/anna/xml/DocumentFile.hpp index 3a1c71f..5655352 100644 --- a/include/anna/xml/DocumentFile.hpp +++ b/include/anna/xml/DocumentFile.hpp @@ -32,20 +32,20 @@ public: * * @return XML document root node */ - const Node * getRootNode() const throw() { return a_rootNode; } + const Node * getRootNode() const { return a_rootNode; } /** Devuelve el contenido asociado al documento XML. \return El contenido asociado al documento XML. */ - const anna::DataBlock& getContent() const throw(RuntimeException); + const anna::DataBlock& getContent() const noexcept(false); /** * Parse xml document and return root node * \return Root node * \warning Need previous initialization */ - const Node* parse() throw(RuntimeException) { return (a_rootNode = Document::parse()); } + const Node* parse() noexcept(false) { return (a_rootNode = Document::parse()); } /** * Parse xml document with dtd and return root node @@ -53,14 +53,14 @@ public: * \return Root node * \warning Need previous initialization */ - const Node* parse(const DTD& dtd) throw(RuntimeException) { return (a_rootNode = Document::parse(dtd)); } + const Node* parse(const DTD& dtd) noexcept(false) { return (a_rootNode = Document::parse(dtd)); } /** * XML representation from loaded document * \return XML string * \warning Need previous initialization and parsing */ - std::string asXmlString() const throw() { Compiler c; return (c.apply(a_rootNode)); } + std::string asXmlString() const { Compiler c; return (c.apply(a_rootNode)); } protected: @@ -71,8 +71,8 @@ protected: private: const anna::xml::Node * a_rootNode; - virtual _xmlDoc* do_initialize(const char* filename) throw(RuntimeException); - virtual _xmlDoc* do_initialize(const anna::DataBlock&) throw(RuntimeException); + virtual _xmlDoc* do_initialize(const char* filename) noexcept(false); + virtual _xmlDoc* do_initialize(const anna::DataBlock&) noexcept(false); }; } diff --git a/include/anna/xml/DocumentMemory.hpp b/include/anna/xml/DocumentMemory.hpp index 06123a1..ba4fae7 100644 --- a/include/anna/xml/DocumentMemory.hpp +++ b/include/anna/xml/DocumentMemory.hpp @@ -32,14 +32,14 @@ public: * * @return XML document root node */ - const Node * getRootNode() const throw() { return a_rootNode; } + const Node * getRootNode() const { return a_rootNode; } /** * Parse xml document and return root node * \return Root node * \warning Need previous initialization */ - const Node* parse() throw(RuntimeException) { return (a_rootNode = Document::parse()); } + const Node* parse() noexcept(false) { return (a_rootNode = Document::parse()); } /** * Parse xml document with dtd and return root node @@ -47,19 +47,19 @@ public: * \return Root node * \warning Need previous initialization */ - const Node* parse(const DTD& dtd) throw(RuntimeException) { return (a_rootNode = Document::parse(dtd)); } + const Node* parse(const DTD& dtd) noexcept(false) { return (a_rootNode = Document::parse(dtd)); } /** * XML representation from loaded document * \return XML string * \warning Need previous initialization and parsing */ - std::string asXmlString() const throw() { Compiler c; return (c.apply(a_rootNode)); } + std::string asXmlString() const { Compiler c; return (c.apply(a_rootNode)); } private: const anna::xml::Node * a_rootNode; - virtual _xmlDoc* do_initialize(const char* content) throw(RuntimeException); - virtual _xmlDoc* do_initialize(const anna::DataBlock&) throw(RuntimeException); + virtual _xmlDoc* do_initialize(const char* content) noexcept(false); + virtual _xmlDoc* do_initialize(const anna::DataBlock&) noexcept(false); }; } diff --git a/include/anna/xml/Namespace.hpp b/include/anna/xml/Namespace.hpp index 1d1cf6a..af92d35 100644 --- a/include/anna/xml/Namespace.hpp +++ b/include/anna/xml/Namespace.hpp @@ -33,19 +33,19 @@ public: * Devuelve el nombre de este namespace. * \return el nombre de este namespace. */ - const std::string& getName() const throw() { return a_name; } + const std::string& getName() const { return a_name; } /** * Devuelve la referencia asociada a este namespace. * \return la referencia asociada a este namespace. */ - const std::string& getReference() const throw() { return a_reference; } + const std::string& getReference() const { return a_reference; } /** Devuelve una cadena con toda la información relevante de esta instancia. \return Una cadena con toda la información relevante de esta instancia. */ - std::string asString() const throw(); + std::string asString() const ; private: /** @@ -56,9 +56,9 @@ private: std::string a_name; std::string a_reference; - void setName(const char* name) throw() { a_name = name; } - void setName(const std::string& name) throw() { a_name = name; } - void setReference(const char* reference) throw() { a_reference = reference; } + void setName(const char* name) { a_name = name; } + void setName(const std::string& name) { a_name = name; } + void setReference(const char* reference) { a_reference = reference; } friend class Allocator; friend class Node; diff --git a/include/anna/xml/Node.hpp b/include/anna/xml/Node.hpp index 7050a81..3af8f26 100644 --- a/include/anna/xml/Node.hpp +++ b/include/anna/xml/Node.hpp @@ -55,7 +55,7 @@ class Decompressor; */ class Node { struct NamespaceByName { - static const std::string& value(const Namespace* ns) throw() { return ns->getName(); } + static const std::string& value(const Namespace* ns) { return ns->getName(); } }; public: @@ -86,25 +86,25 @@ public: Devuelve el nombre del nodo. \return El nombre del nodo. */ - const char* getName() const throw() { return a_name.c_str(); } + const char* getName() const { return a_name.c_str(); } /** * Devuelve el nombre del nodo. * \return El nombre del nodo. */ - const std::string& getNameAsString() const throw() { return a_name; } + const std::string& getNameAsString() const { return a_name; } /** Devuelve la referencia al nodo predecesor de este nodo. Pueder ser NULL. \return La referencia al nodo predecesor de este nodo. Pueder ser NULL. */ - const Node* getParent() const throw() { return a_parent; } + const Node* getParent() const { return a_parent; } /** Devuelve la referencia al nodo predecesor de este nodo. Pueder ser NULL. \return La referencia al nodo predecesor de este nodo. Pueder ser NULL. */ - Node* getParent() throw() { return const_cast (a_parent); } + Node* getParent() { return const_cast (a_parent); } /** Devuelve la referencia al atributo que coincide con el nombre dado, si no existe lanzara @@ -114,19 +114,19 @@ public: coincida con el nombre buscado. \return La referencia al atributo que coincide con el nombre dado. */ - const Attribute* getAttribute(const char* name, const bool exceptionWhenNotFound = true) const throw(anna::RuntimeException); + const Attribute* getAttribute(const char* name, const bool exceptionWhenNotFound = true) const noexcept(false); /** Devuelve la referencia al texto asociado a este nodo. Pueder ser NULL. \return La referencia al texto asociado a este nodo. Pueder ser NULL. */ - const Text* getText() const throw() { return a_text; } + const Text* getText() const { return a_text; } /** * Devuelve el namespace asociado a este nodo. Puede ser NULL. * \return el namespace asociado a este nodo. Puede ser NULL. */ - const Namespace* getNamespace() const throw() { return a_namespace; } + const Namespace* getNamespace() const { return a_namespace; } /** Devuelve un iterador al comienzo de la lista de nodo hijos. @@ -151,7 +151,7 @@ public: \return Un iterador al comienzo de la lista de nodo hijos. */ - child_iterator child_begin() throw() { return a_children.begin(); } + child_iterator child_begin() { return a_children.begin(); } /** Devuelve un iterador al comienzo de la lista de nodos hijos no modificables. @@ -176,19 +176,19 @@ public: \return Un iterador al comienzo de la lista de nodo hijos no modificables. */ - const_child_iterator child_begin() const throw() { return a_children.begin(); } + const_child_iterator child_begin() const { return a_children.begin(); } /** Devuelve un iterador al comienzo de la lista de atributos no modificables. \return Un iterador al comienzo de la lista de atributos no modificables. */ - const_attribute_iterator attribute_begin() const throw() { return a_attributes.begin(); } + const_attribute_iterator attribute_begin() const { return a_attributes.begin(); } /** Devuelve un iterador al comienzo de la lista de namespaces no modificables. \return Un iterador al comienzo de la lista de namespaces no modificables. */ - const_namespace_iterator namespace_begin() const throw() { return a_root->a_namespaces->begin(); } + const_namespace_iterator namespace_begin() const { return a_root->a_namespaces->begin(); } /** @@ -196,38 +196,38 @@ public: \return Un iterador al final de la lista de nodo hijos. \see #child_begin */ - child_iterator child_end() throw() { return a_children.end(); } + child_iterator child_end() { return a_children.end(); } /** Devuelve un iterador al final de la lista de nodo hijos no modificables. \return Un iterador al final de la lista de nodo hijos no modificables. \see #begin */ - const_child_iterator child_end() const throw() { return a_children.end(); } + const_child_iterator child_end() const { return a_children.end(); } /** * Devuelve el número de hijos definidos. * \return el número de hijos definidos. */ - int child_size() const throw() { return a_children.size(); } + int child_size() const { return a_children.size(); } /** Devuelve un iterador al final de la lista de atributos no modificables. \return Un iterador al final de la lista de atributos no modificables. */ - const_attribute_iterator attribute_end() const throw() { return a_attributes.end(); } + const_attribute_iterator attribute_end() const { return a_attributes.end(); } /** Devuelve un iterador al comienzo de la lista de namespaces no modificables. \return Un iterador al comienzo de la lista de namespaces no modificables. */ - const_namespace_iterator namespace_end() const throw() { return a_root->a_namespaces->end(); } + const_namespace_iterator namespace_end() const { return a_root->a_namespaces->end(); } /** * Devuelve el número de namespace definidos. * \return el número de namespace definidos. */ - int namespace_size() const throw() { return a_root->a_namespaces->size(); } + int namespace_size() const { return a_root->a_namespaces->size(); } /** Busca un nodo sucesor directo de este cuyo nombre coincida con el nombre recibido @@ -241,7 +241,7 @@ public: y ninguno de los hijos cumple con la busqueda sera NULL. */ const Node* find(const char* childName, const bool exceptionWhenNotFound = true) const - throw(RuntimeException); + noexcept(false); /** Crea un atributo que depende de este nodo. @@ -250,7 +250,7 @@ public: \param _namespace Referencia al namespace al que pertenece el atributo. Puede ser NULL. \return La instancia del nuevo atributo. */ - xml::Attribute* createAttribute(const char* name, const char* value, const Namespace* _namespace = NULL) throw(); + xml::Attribute* createAttribute(const char* name, const char* value, const Namespace* _namespace = NULL) ; /** Crea un atributo que depende de este nodo. @@ -259,7 +259,7 @@ public: \param _namespace Referencia al namespace al que pertenece el atributo. Puede ser NULL. \return La instancia del nuevo atributo. */ - xml::Attribute* createAttribute(const char* name, const std::string& value, const Namespace* _namespace = NULL) throw() { + xml::Attribute* createAttribute(const char* name, const std::string& value, const Namespace* _namespace = NULL) { return createAttribute(name, value.c_str(), _namespace); } @@ -270,7 +270,7 @@ public: \param _namespace Referencia al namespace al que pertenece el atributo. Puede ser NULL. \return La instancia del nuevo atributo. */ - xml::Attribute* createAttribute(const char* name, const int value, const Namespace* _namespace = NULL) throw() { + xml::Attribute* createAttribute(const char* name, const int value, const Namespace* _namespace = NULL) { return createAttribute(name, anna::functions::asString(value), _namespace); } @@ -282,7 +282,7 @@ public: \param _namespace Referencia al namespace al que pertenece el atributo. Puede ser NULL. \return La instancia del nuevo atributo. */ - xml::Attribute* createAttribute(const char* name, const S64* value, const Namespace* _namespace = NULL) throw() { + xml::Attribute* createAttribute(const char* name, const S64* value, const Namespace* _namespace = NULL) { return createAttribute(name, anna::functions::asString(*value), _namespace); } @@ -294,7 +294,7 @@ public: \param _namespace Referencia al namespace al que pertenece el atributo. Puede ser NULL. \return La instancia del nuevo atributo. */ - xml::Attribute* createAttribute(const char* name, const U64* value, const Namespace* _namespace = NULL) throw() { + xml::Attribute* createAttribute(const char* name, const U64* value, const Namespace* _namespace = NULL) { return createAttribute(name, anna::functions::asString(*value), _namespace); } @@ -303,20 +303,20 @@ public: \param text contain Valor del texto asociado a este nodo. \return La instancia del nuevo texto. */ - xml::Text* createText(const char* text) throw(RuntimeException); + xml::Text* createText(const char* text) noexcept(false); /** Crea el texto asociado a este nodo. \param text contain Valor del texto asociado a este nodo. \return La instancia del nuevo texto. */ - xml::Text* createText(const std::string& text) throw(RuntimeException) { return createText(text.c_str()); } + xml::Text* createText(const std::string& text) noexcept(false) { return createText(text.c_str()); } /** Crea un nuevo nodo que depende de este. \param name Nombre del nodo hijo. */ - Node* createChild(const char* name) throw(); + Node* createChild(const char* name) ; /** * Crea un nuevo namespace (si procede) que podemos usar para asignar a los distintos nodos. Si el nodo ya existe y la referencia no coincide @@ -326,7 +326,7 @@ public: * \param reference URI de la que obtener las definiciones. * \return La instancia de un namespace con los parámetros indicados. */ - const Namespace* createNamespace(const char* name, const char* reference) throw(RuntimeException) { + const Namespace* createNamespace(const char* name, const char* reference) noexcept(false) { std::string _name(name); return createNamespace(_name, reference); } @@ -339,19 +339,19 @@ public: * \param reference URI de la que obtener las definiciones. * \return La instancia de un namespace con los parámetros indicados. */ - const Namespace* createNamespace(const std::string& name, const char* reference) throw(RuntimeException); + const Namespace* createNamespace(const std::string& name, const char* reference) noexcept(false); /** * Establece el namespace asociado a este nodo. * \param _namespace Instancia del namespace que vamos a asociar al nodo. */ - void setNamespace(const Namespace* _namespace) throw() { a_namespace = _namespace; } + void setNamespace(const Namespace* _namespace) { a_namespace = _namespace; } /** * Devuelve la instancia del namespace que coincide con el nombre recibido como parámetro. Puede ser NULL. * \return la instancia del namespace que coincide con el nombre recibido como parámetro. Puede ser NULL. */ - Namespace* namespace_find(const char* name, const bool exceptionWhenNotFound = true) throw(RuntimeException) { + Namespace* namespace_find(const char* name, const bool exceptionWhenNotFound = true) noexcept(false) { const std::string _name(name); return namespace_find(_name, exceptionWhenNotFound); } @@ -360,13 +360,13 @@ public: * Devuelve la instancia del namespace que coincide con el nombre recibido como parámetro. Puede ser NULL. * \return la instancia del namespace que coincide con el nombre recibido como parámetro. Puede ser NULL. */ - Namespace* namespace_find(const std::string& name, const bool exceptionWhenNotFound = true) throw(RuntimeException); + Namespace* namespace_find(const std::string& name, const bool exceptionWhenNotFound = true) noexcept(false); /** * Devuelve la instancia del namespace que coincide con el nombre recibido como parámetro. Puede ser NULL. * \return la instancia del namespace que coincide con el nombre recibido como parámetro. Pueder ser NULL. */ - const Namespace* namespace_find(const char* name, const bool exceptionWhenNotFound = true) const throw(RuntimeException) { + const Namespace* namespace_find(const char* name, const bool exceptionWhenNotFound = true) const noexcept(false) { return const_cast (this)->namespace_find(name, exceptionWhenNotFound); } @@ -374,20 +374,20 @@ public: * Devuelve la instancia del namespace que coincide con el nombre recibido como parámetro. Puede ser NULL. * \return la instancia del namespace que coincide con el nombre recibido como parámetro. Pueder ser NULL. */ - const Namespace* namespace_find(const std::string& name, const bool exceptionWhenNotFound = true) const throw(RuntimeException) { + const Namespace* namespace_find(const std::string& name, const bool exceptionWhenNotFound = true) const noexcept(false) { return const_cast (this)->namespace_find(name, exceptionWhenNotFound); } /** * Libera todos los componentes (atributos, namespaces y nodos hijos) asociados a este nodo. */ - void clear() throw(); + void clear() ; /** Devuelve una cadena con toda la información relevante de esta instancia. \return Una cadena con toda la información relevante de esta instancia. */ - std::string asString() const throw(); + std::string asString() const ; /** Devuelve la refencia al nodo sobre el que se encuentra el iterador pasado como @@ -396,28 +396,28 @@ public: \return La refencia al nodo sobre el que se encuentra el iterador pasado como parámetro. */ - static Node* node(child_iterator& ii) throw() { return *ii; } + static Node* node(child_iterator& ii) { return *ii; } /** Devuelve la refencia al nodo sobre el que se encuentra el iterador pasado como parámetro. \param ii Iterador que estamos recorriendo. \return La refencia al nodo sobre el que se encuentra el iterador pasado como parámetro. */ - static const Node* node(const_child_iterator& ii) throw() { return *ii; } + static const Node* node(const_child_iterator& ii) { return *ii; } /** Devuelve la refencia al atributo sobre el que se encuentra el iterador pasado como parámetro. \param ii Iterador que estamos recorriendo. \return La refencia al atributo sobre el que se encuentra el iterador pasado como parámetro. */ - static const Attribute* attribute(const_attribute_iterator& ii) throw() { return *ii; } + static const Attribute* attribute(const_attribute_iterator& ii) { return *ii; } /** Devuelve la refencia al namespace sobre el que se encuentra el iterador pasado como parámetro. \param ii Iterador que estamos recorriendo. \return La refencia al namespace sobre el que se encuentra el iterador pasado como parámetro. */ - static const Namespace* xnamespace(const_namespace_iterator& ii) throw() { return namespace_container::data(ii);; } + static const Namespace* xnamespace(const_namespace_iterator& ii) { return namespace_container::data(ii);; } protected: /** @@ -425,7 +425,7 @@ protected: \param ii Iterador que estamos recorriendo. \return La refencia al atributo sobre el que se encuentra el iterador pasado como parámetro. */ - static Attribute* attribute(attribute_iterator& ii) throw() { return *ii; } + static Attribute* attribute(attribute_iterator& ii) { return *ii; } private: std::string a_name; @@ -453,14 +453,14 @@ private: /* Para evitar que se pueda crear desde el exterior */ Node(); - void setRoot(Node* root) throw() { a_root = root; } - void setName(const char* name) throw() { a_name = name; } + void setRoot(Node* root) { a_root = root; } + void setName(const char* name) { a_name = name; } - static const Attribute* find(const char* attrName, const_attribute_iterator, const_attribute_iterator) throw(); + static const Attribute* find(const char* attrName, const_attribute_iterator, const_attribute_iterator) ; // Allow sort in compiler - attribute_iterator attribute_begin() throw() { return a_attributes.begin(); } - attribute_iterator attribute_end() throw() { return a_attributes.end(); } + attribute_iterator attribute_begin() { return a_attributes.begin(); } + attribute_iterator attribute_end() { return a_attributes.end(); } friend class Parser; friend class Allocator; diff --git a/include/anna/xml/Parser.hpp b/include/anna/xml/Parser.hpp index 6617726..e73b2ba 100644 --- a/include/anna/xml/Parser.hpp +++ b/include/anna/xml/Parser.hpp @@ -81,7 +81,7 @@ public: de los metodo #apply. \li El nodo devuelto no puede ser usado despues del invocar a destructor de este Parser. */ - const Node* getRoot() const throw() { return a_root; } + const Node* getRoot() const { return a_root; } /** Analiza el documento XML recibido como parametro. @@ -92,7 +92,7 @@ public: \li El nodo devuelto no puede ser usado despues del invocar a destructor de este Parser. \see Document::initialize */ - const Node* apply(const Document& document) throw(RuntimeException); + const Node* apply(const Document& document) noexcept(false); /** Analiza el archivo XML recibido como parametro, y verifica que cumpla las reglas @@ -108,7 +108,7 @@ public: \see DTD::initialize \see Document::initialize */ - const Node* apply(const Document& document, const DTD& dtd) throw(RuntimeException); + const Node* apply(const Document& document, const DTD& dtd) noexcept(false); protected: /* @@ -120,12 +120,12 @@ protected: Inicializa el contenido del nodo asociado al ultimo Parser::apply. \warning Se invoca automaticamente desde el numero de ANNA.xml */ - virtual void reset() throw(); + virtual void reset() ; /** * Comprueba si se requieren operaciones de traducción del conjunto de caracteres. */ - void setupEncoding(_xmlDoc* document) throw(); + void setupEncoding(_xmlDoc* document) ; /** * Si fuera necesario traduce el texto contenido por el parámetro recibido al conjunto @@ -133,17 +133,17 @@ protected: * \param source Texto expresado en el conjunto de caracteres particular. * \return Una cadena expresada en UTF-8. */ - const char* decode(const unsigned char* source) throw(); + const char* decode(const unsigned char* source) ; /** * \warning Exclusivamente uso interno. */ - void attributes(Node* node, _xmlAttr* attribute) throw(RuntimeException); + void attributes(Node* node, _xmlAttr* attribute) noexcept(false); /** * \warning Exclusivamente uso interno. */ - void children(Node* node, _xmlNode* xmlNode) throw(RuntimeException); + void children(Node* node, _xmlNode* xmlNode) noexcept(false); private: _xmlValidCtxt* a_context; @@ -154,10 +154,10 @@ private: Parser(const Parser&); - void apply(_xmlDoc* document) throw(RuntimeException); + void apply(_xmlDoc* document) noexcept(false); - static void errorHandler(void *ctx, const char *msg, ...) throw(); - static void warningHandler(void *ctx, const char *msg, ...) throw(); + static void errorHandler(void *ctx, const char *msg, ...) ; + static void warningHandler(void *ctx, const char *msg, ...) ; }; } diff --git a/include/anna/xml/Text.hpp b/include/anna/xml/Text.hpp index d448813..b61712a 100644 --- a/include/anna/xml/Text.hpp +++ b/include/anna/xml/Text.hpp @@ -37,7 +37,7 @@ public: Devuelve una cadena con toda la informacion relevante de esta instancia. \return Una cadena con toda la informacion relevante de esta instancia. */ - std::string asString() const throw() { + std::string asString() const { std::string result("xml::Text {"); result += Data::asString(); return result += " }"; diff --git a/include/anna/xml/XPath.hpp b/include/anna/xml/XPath.hpp index 7281cff..9bdaec8 100644 --- a/include/anna/xml/XPath.hpp +++ b/include/anna/xml/XPath.hpp @@ -61,7 +61,7 @@ public: \warning La instancia del documento debe estar correctamente inicializada. \see Document::initialize */ - void apply(const Document& document, const char* expression, const int mode = Mode::Simple) throw(RuntimeException); + void apply(const Document& document, const char* expression, const int mode = Mode::Simple) noexcept(false); /** * Aplica la expresión XPath sobre el documento recibido como parámetro y devuelve @@ -76,7 +76,7 @@ public: * * \return \em true si algún nodo del documento que cumpla la expressión o \em false en otro caso. */ - bool match(const Document& document, const char* expression, const int mode = Mode::Simple) throw(RuntimeException); + bool match(const Document& document, const char* expression, const int mode = Mode::Simple) noexcept(false); /** Aplica la expresión XPath sobre el documento recibido como parámetro y devuelve el primer @@ -91,37 +91,37 @@ public: * \warning Si no hay ningún nodo que cumpla la expresión devolverá una excepción. */ const Node* find(const Document& document, const char* expression, const int mode = Mode::Full, const Exception::Mode::_v emode = Exception::Mode::Throw) - throw(RuntimeException); + noexcept(false); /** * Devuelve \em true si existen nodos que cumplieron la condición de #apply o \em false en otro caso. * \return \em true si existen nodos que cumplieron la condición de #apply o \em false en otro caso. */ - bool isEmpty() const throw() { return a_root->a_children.size() == 0; } + bool isEmpty() const { return a_root->a_children.size() == 0; } /** * Devuelve el número de nodos que han sido seleccionados al invocar al método #apply. * \return El número de nodos que han sido seleccionados al invocar al método #apply. */ - int size() const throw() { return a_root->a_children.size(); } + int size() const { return a_root->a_children.size(); } /** * Devuelve el primer nodo del documento que cumple la expresión indicada al invocar al método #apply. * \return El primer nodo del documento que cumple la expresión indicada al invocar al método #apply. */ - Node::const_child_iterator node_begin() const throw() { return a_root->child_begin(); } + Node::const_child_iterator node_begin() const { return a_root->child_begin(); } /** * Devuelve el final de la lista de nodos que cumplen la expresión indicada al invocar al método #apply. * \return El final de la lista de nodos que cumplen la expresión indicada al invocar al método #apply. */ - Node::const_child_iterator node_end() const throw() { return a_root->child_end(); } + Node::const_child_iterator node_end() const { return a_root->child_end(); } /** * Devuelve la instancia del nodo apuntado por el iterador recibido como parámetro. * \return la instancia del nodo apuntado por el iterador recibido como parámetro. */ - static const Node* node(Node::const_child_iterator& ii) throw() { return xml::Node::node(ii); } + static const Node* node(Node::const_child_iterator& ii) { return xml::Node::node(ii); } private: // Modo pasado al callback del apply @@ -145,12 +145,12 @@ private: XPath(const XPath&); - void text(Node* node, _xmlNode* xmlNode) throw(RuntimeException); + void text(Node* node, _xmlNode* xmlNode) noexcept(false); - void skeleton(const Document&, const char* expression, ConfigSkeleton&) throw(RuntimeException); + void skeleton(const Document&, const char* expression, ConfigSkeleton&) noexcept(false); - void initializeNamespaces(_xmlXPathContext*, const Document&) throw(RuntimeException); - void forwardNamespaces(_xmlXPathContext*, _xmlNode*) throw(RuntimeException); + void initializeNamespaces(_xmlXPathContext*, const Document&) noexcept(false); + void forwardNamespaces(_xmlXPathContext*, _xmlNode*) noexcept(false); void callbackApply(const _xmlNodeSet*); void callbackMatch(const _xmlNodeSet*); }; diff --git a/include/anna/xml/functions.hpp b/include/anna/xml/functions.hpp index 833dc10..4c7d4b9 100644 --- a/include/anna/xml/functions.hpp +++ b/include/anna/xml/functions.hpp @@ -18,7 +18,7 @@ struct functions { Inicializa el modulo de analisis de documentos XML deber invocado una única vez antes de usar cualquier clase de este paquete. */ - static void initialize() throw(); + static void initialize() ; }; } diff --git a/include/anna/xml/internal/sccs.hpp b/include/anna/xml/internal/sccs.hpp index a22bebd..d6928c8 100644 --- a/include/anna/xml/internal/sccs.hpp +++ b/include/anna/xml/internal/sccs.hpp @@ -15,7 +15,7 @@ namespace xml { class sccs { public: - static void activate() throw(); + static void activate() ; }; } diff --git a/source/app/Application.cpp b/source/app/Application.cpp index d4a9570..6cca6e6 100644 --- a/source/app/Application.cpp +++ b/source/app/Application.cpp @@ -80,7 +80,7 @@ app::Application::Application(const char* shortName, const char* title, const ch } app::Component* app::Application::find(const char* className) -throw() { +{ Component* component; for(iterator ii = begin(), maxii = end(); ii != maxii; ii ++) { component = Application::component(ii); @@ -96,7 +96,7 @@ throw() { * (1) Si se ejecuta el metodo clone evita que los hijos que termina se queden como zombies. */ void app::Application::start() -throw(RuntimeException) { +noexcept(false) { TraceMethod tm("app::Application", "start", ANNA_FILE_LOCATION); ModuleManager& moduleManager = ModuleManager::instantiate(); @@ -149,7 +149,7 @@ throw(RuntimeException) { } void app::Application::startComponents() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tm("app::Application", "startComponents", ANNA_FILE_LOCATION)); Component* component; @@ -165,7 +165,7 @@ throw(RuntimeException) { } void app::Application::stopComponents() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tm("app::Application", "stopComponents", ANNA_FILE_LOCATION)); Component* component; @@ -185,7 +185,7 @@ throw(RuntimeException) { * (1.1) Limpia la lista de hijos que pudiera tener el padre. */ app::Application& app::Application::clone() -throw(RuntimeException) { +noexcept(false) { if(anna::functions::supportMultithread() == true) { string msg("app::Application::clone | pid: "); msg += functions::asString((int) a_pid); @@ -265,7 +265,7 @@ throw(RuntimeException) { // ese momento los objetos est� completamente creados. //--------------------------------------------------------------------------------------- void app::Application::attach(app::Component* component) -throw(RuntimeException) { +noexcept(false) { if(component == NULL) throw RuntimeException("Cannot attach a NULL component", ANNA_FILE_LOCATION); @@ -299,7 +299,7 @@ throw(RuntimeException) { } void app::Application::detach(app::Component* component) -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tm("app::Application", "detach(component)", ANNA_FILE_LOCATION)); if(component == NULL) @@ -319,7 +319,7 @@ throw(RuntimeException) { } void app::Application::writeContext(const std::string& file) -throw(RuntimeException) { +noexcept(false) { ofstream out; out.open(file.c_str()); @@ -341,7 +341,7 @@ throw(RuntimeException) { } xml::Node* app::Application::asXML(xml::Node* app) const -throw() { +{ xml::Node* node(NULL); app->createAttribute("Name", getShortName()); app->createAttribute("Version", getVersion()); @@ -371,29 +371,29 @@ throw() { } void app::Application::signalUSR(int signal) -throw(RuntimeException) { +noexcept(false) { if (signal == SIGUSR1) signalUSR1(); else if (signal == SIGUSR2) signalUSR2(); } void app::Application::signalUSR1() -throw(RuntimeException) { +noexcept(false) { writeContext(anna::functions::asString("/var/tmp/anna.context.%05d", getPid())); } void app::Application::signalUSR2() -throw(RuntimeException) { +noexcept(false) { Logger::notice("Captured signal SIGUSR2. Nothing implemented at the moment", ANNA_FILE_LOCATION); } void app::Application::sendSignalToChilds(const int signal) -throw() { +{ for(pid_iterator ii = pid_begin(), maxii = pid_end(); ii != maxii; ii ++) kill(pid(ii), signal); } void app::Application::handlerSignalUSR(int signal) -throw() { +{ sigignore(signal); try { @@ -408,7 +408,7 @@ throw() { } void app::Application::handlerSignalTerminate(int) -throw() { +{ sigignore(SIGTERM); try { @@ -431,7 +431,7 @@ throw() { * elimina de la lista de procesos hijos. */ void app::Application::handlerChildTerminate(int sig) -throw() { +{ if(sig == SIGCHLD) { int status; pid_t pid = wait(&status); diff --git a/source/app/Component.cpp b/source/app/Component.cpp index 0ab2d3b..c8d0fbc 100644 --- a/source/app/Component.cpp +++ b/source/app/Component.cpp @@ -46,7 +46,7 @@ app::Component::~Component() { } void app::Component::addPredecessor(const char* componentName) -throw() { +{ const std::string name(componentName); if((find(begin(), end(), name)) != end()) @@ -63,7 +63,7 @@ throw() { } void app::Component::initialize() -throw(RuntimeException) { +noexcept(false) { if(a_state == State::Running) return; @@ -105,17 +105,17 @@ throw(RuntimeException) { } void app::Component::attach() -throw(RuntimeException) { +noexcept(false) { app::functions::getApp().attach(this); } std::string app::Component::asString() const -throw() { +{ return anna::Component::asString(); } xml::Node* app::Component::asXML(xml::Node* parent) const -throw() { +{ return anna::Component::asXML(parent); } diff --git a/source/app/functions.cpp b/source/app/functions.cpp index e67d8b8..b345559 100644 --- a/source/app/functions.cpp +++ b/source/app/functions.cpp @@ -12,7 +12,7 @@ using namespace anna; app::Application& app::functions::getApp() -throw(RuntimeException) { +noexcept(false) { if(Application::st_application == NULL) throw RuntimeException("No application class has been defined", ANNA_FILE_LOCATION); diff --git a/source/app/internal/sccs.cpp b/source/app/internal/sccs.cpp index 5c5c482..febbbab 100644 --- a/source/app/internal/sccs.cpp +++ b/source/app/internal/sccs.cpp @@ -15,7 +15,7 @@ anna_define_sccs_tag(app, 1) void anna::app::sccs::activate() -throw() { +{ anna::sccs::activate(); xml::sccs::activate(); ModuleManager::instantiate().insert(anna_use_sccs_tag(app), "00"); diff --git a/source/comm/AccessPoint.cpp b/source/comm/AccessPoint.cpp index ef1bc8f..bf01579 100644 --- a/source/comm/AccessPoint.cpp +++ b/source/comm/AccessPoint.cpp @@ -19,7 +19,7 @@ using namespace std; using namespace anna; bool comm::AccessPoint::operator == (const comm::AccessPoint& rhs) const -throw() { +{ if(rhs.isNull() && this->isNull()) return true; @@ -33,7 +33,7 @@ throw() { } comm::AccessPoint& comm::AccessPoint::operator = (const INetAddress & inetAddress) -throw() { +{ if(a_path != NULL) { delete a_path; a_path = NULL; @@ -44,7 +44,7 @@ throw() { } comm::AccessPoint& comm::AccessPoint::operator = (const std::string & path) -throw() { +{ if(a_path == &path) return *this; @@ -59,7 +59,7 @@ throw() { } comm::AccessPoint& comm::AccessPoint::operator = (const AccessPoint & rhs) -throw() { +{ if(this == &rhs) return *this; @@ -78,7 +78,7 @@ throw() { } void comm::AccessPoint::translate(const comm::Socket& socket, sockaddr*& s, int& len) -throw(RuntimeException) { +noexcept(false) { switch(socket.getDomain()) { case Socket::Domain::Inet: @@ -123,7 +123,7 @@ throw(RuntimeException) { } void comm::AccessPoint::asString(std::string& msg) const -throw() { +{ msg += "{ "; if(a_inetAddress.isNull() == false) @@ -138,7 +138,7 @@ throw() { } void comm::AccessPoint::asXML(const char* name, xml::Node* parent) const -throw(RuntimeException) { +noexcept(false) { xml::Node* accessPoint = parent->createChild(name); if(a_inetAddress.isNull() == false) @@ -148,7 +148,7 @@ throw(RuntimeException) { } std::string comm::AccessPoint::serialize() const -throw() { +{ std::string result; if(a_inetAddress.isNull() == false) diff --git a/source/comm/Application.cpp b/source/comm/Application.cpp index 4c31f2f..ba8b188 100644 --- a/source/comm/Application.cpp +++ b/source/comm/Application.cpp @@ -19,12 +19,12 @@ comm::Application::Application(const char *shortName, const char *title, const c } comm::TransportFactory& comm::Application::getDefaultTransportFactory() -throw() { +{ return SureTransport::getFactory(); } void comm::Application::signalTerminate() -throw(RuntimeException) { +noexcept(false) { Communicator* communicator = app::functions::component (ANNA_FILE_LOCATION); communicator->requestStop(); } diff --git a/source/comm/ClientSocket.cpp b/source/comm/ClientSocket.cpp index 3bff830..c910a1e 100644 --- a/source/comm/ClientSocket.cpp +++ b/source/comm/ClientSocket.cpp @@ -47,7 +47,7 @@ const Millisecond comm::ClientSocket::DefaultMaxWriteDelay(500); void comm::ClientSocket::initialize() -throw() { +{ a_status = Status::None; a_transport = NULL; a_expectedSize = -1; @@ -64,7 +64,7 @@ throw() { * porque ya está protegido por éste. */ void comm::ClientSocket::setfd(const int fd) -throw(RuntimeException) { +noexcept(false) { Socket::a_fd = fd; Socket::a_isBound = true; activate(Status::Connected); @@ -100,7 +100,7 @@ throw(RuntimeException) { * invocar al metodo comm::Receiver::initialize. */ void comm::ClientSocket::setReceiver(comm::Receiver* receiver) -throw(RuntimeException) { +noexcept(false) { if (a_receiver && Socket::a_receiverFactory) Socket::a_receiverFactory->release(a_receiver); @@ -112,7 +112,7 @@ throw(RuntimeException) { // Protegido desde el Socket::close void comm::ClientSocket::do_close() -throw() { +{ Socket::do_close(); if (a_transport != NULL) { @@ -137,7 +137,7 @@ throw() { } comm::Server* comm::ClientSocket::getServer() -throw(RuntimeException) { +noexcept(false) { Guard guard(*this, "comm::ClientSocket (getServer)"); const INetAddress& remoteAddress = getRemoteAccessPoint().getINetAddress(); const Device* device = remoteAddress.getDevice(false); @@ -174,7 +174,7 @@ throw(RuntimeException) { // la conexión. //_________________________________________________________________________________ void comm::ClientSocket::connect() -throw(RuntimeException) { +noexcept(false) { Guard guard(*this, "comm::ClientSocket (connect)"); anna_socket_assert(isConnected() == true, "Already connected"); @@ -252,13 +252,13 @@ throw(RuntimeException) { } void comm::ClientSocket::send(comm::Message& message) -throw(RuntimeException) { +noexcept(false) { Guard guard(*this, "comm::ClientSocket (send)"); do_write(getTransport()->code(message)); } void comm::ClientSocket::send(comm::Message* message) -throw(RuntimeException) { +noexcept(false) { if (message == NULL) throw RuntimeException("comm::ClientSocket::send | Cannot send a NULL message", ANNA_FILE_LOCATION); @@ -272,7 +272,7 @@ throw(RuntimeException) { // su buffer, se cerrará. //_______________________________________________________________________ void comm::ClientSocket::requestClose() -throw() { +{ Communicator* communicator = app::functions::component (ANNA_FILE_LOCATION); a_status |= Status::ClosePending; // Sólo tiene efecto real en modo ST @@ -295,7 +295,7 @@ throw() { // Se invoca desde un entorno protegido, por lo que no hace falta SSCC. //--------------------------------------------------------------------------------------- comm::Socket::Notify::_v comm::ClientSocket::receive() -throw(RuntimeException) { +noexcept(false) { Notify::_v result; if (a_reader.getMaxSize() == 0) { @@ -369,7 +369,7 @@ throw(RuntimeException) { } comm::Socket::Notify::_v comm::ClientSocket::wait(const Millisecond &timeout, const bool _receive) -throw(RuntimeException) { +noexcept(false) { Guard guard(*this, "comm::ClientSocket (wait)"); if (Socket::isOpened() == false) { @@ -410,7 +410,7 @@ throw(RuntimeException) { // la longitud esperada => prepara el a_data para recibir el siguiente bloque. //--------------------------------------------------------------------------------------- const DataBlock* comm::ClientSocket::fetch() -throw(RuntimeException) { +noexcept(false) { if (a_status & Status::ClosePending) return NULL; @@ -469,7 +469,7 @@ throw(RuntimeException) { } void comm::ClientSocket::calculeExpectedSize(const DataBlock& data) -throw() { +{ try { if ((a_expectedSize = getTransport()->calculeSize(data)) != -1) { LOGDEBUG( @@ -492,7 +492,7 @@ throw() { } comm::Transport* comm::ClientSocket::reserveTransport() -throw(RuntimeException) { +noexcept(false) { if (a_transport == NULL) { if (Socket::a_transportFactory == NULL) { string msg(asString()); @@ -513,7 +513,7 @@ throw(RuntimeException) { } comm::Transport* comm::ClientSocket::unsafe_reserveTransport() -throw(RuntimeException) { +noexcept(false) { if (a_transport == NULL) { if (Socket::a_transportFactory == NULL) { string msg(asString()); @@ -529,7 +529,7 @@ throw(RuntimeException) { } comm::Receiver* comm::ClientSocket::reserveReceiver() -throw(RuntimeException) { +noexcept(false) { if (a_receiver == NULL && Socket::a_receiverFactory != NULL) { Guard guard(this, "comm::ClientSocket::reserveReceiver"); @@ -544,7 +544,7 @@ throw(RuntimeException) { // Este metodo se sobre-escribira en commsec::ClientSocket para establecer la conexion mediante las // funciones SSH int comm::ClientSocket::do_connect(const sockaddr* s, const int len) -throw(RuntimeException) { +noexcept(false) { int r; anna_signal_shield(r, ::connect(a_fd, s, len)); return r; @@ -563,7 +563,7 @@ throw(RuntimeException) { // problemas de interpretación en el extremo remoto. //---------------------------------------------------------------------------------------------------- void comm::ClientSocket::do_write(const DataBlock& message) -throw(RuntimeException) { +noexcept(false) { int size = message.getSize(); const char* data = message.getData(); int r(0); @@ -635,7 +635,7 @@ throw(RuntimeException) { // Devuelve 0 para indicar que el Socket se ha cerrado en el extremo remoto //---------------------------------------------------------------------------- int comm::ClientSocket::do_read(const char* data, const int maxSize) -throw(RuntimeException) { +noexcept(false) { int result; do { @@ -658,7 +658,7 @@ throw(RuntimeException) { } void comm::ClientSocket::forgot() -throw() { +{ if (a_transport != NULL) a_transport->clear(); @@ -672,7 +672,7 @@ throw() { // (1) Recupera el tamano para verificar que se ha podido establecer la solicitud. //-------------------------------------------------------------------------------------- void comm::ClientSocket::getSocketOptions() -throw(RuntimeException) { +noexcept(false) { if ((a_rcvBufferSize = comm::Communicator::getReceivingChunkSize()) == -1) { socklen_t l = sizeof(int); int fd = Socket::getfd(); @@ -686,7 +686,7 @@ throw(RuntimeException) { } int comm::ClientSocket::getTotalPendingBytes() const -throw() { +{ // El nº de bytes pendientes de procesar será lo que queda en la cola I/O + los bytes que tenemos cargados en memoria // los bytes pendientes se obtiene al leer el chunk return a_pendingBytes.bytesToRead + getBufferSize(); @@ -694,7 +694,7 @@ throw() { string comm::ClientSocket::asString() const -throw() { +{ string msg("comm::ClientSocket { "); msg += Socket::asString(); @@ -713,7 +713,7 @@ throw() { } xml::Node* comm::ClientSocket::asXML(xml::Node* parent) const -throw(RuntimeException) { +noexcept(false) { xml::Node* clientSocket = parent->createChild("comm.ClientSocket"); Socket::asXML(clientSocket); @@ -737,7 +737,7 @@ throw(RuntimeException) { } string comm::ClientSocket::Status::asString(const int status) -throw() { +{ string result; if (status == 0) diff --git a/source/comm/Codec.cpp b/source/comm/Codec.cpp index 4d13c18..08e318b 100644 --- a/source/comm/Codec.cpp +++ b/source/comm/Codec.cpp @@ -16,17 +16,17 @@ using namespace std; using namespace anna; const comm::Variable* comm::Codec::attach(const char* name, Second& value) -throw(RuntimeException) { +noexcept(false) { return CompatCodec::attach(name, size(), value.refValue()); } const comm::Variable* comm::Codec::attach(const char* name, Millisecond& value) -throw(RuntimeException) { +noexcept(false) { return CompatCodec::attach(name, size(), (int&) value.refValue()); } const comm::Variable* comm::Codec::attach(const char* name, Microsecond& value) -throw(RuntimeException) { +noexcept(false) { return CompatCodec::attach(name, size(), (S64&) value.refValue()); } diff --git a/source/comm/Communicator.cpp b/source/comm/Communicator.cpp index 171405c..eb115a1 100644 --- a/source/comm/Communicator.cpp +++ b/source/comm/Communicator.cpp @@ -89,7 +89,7 @@ Communicator::~Communicator() { } void Communicator::setRecoveryTime(const Millisecond &recoveryTime) -throw(RuntimeException) { +noexcept(false) { if(recoveryTime < MinRecoveryTime || recoveryTime > MaxRecoveryTime) { string msg("comm::Communicator::setRecoveryTime | "); msg += functions::asString("RecoveryTime (%d ms) must be between %d ms and %d ms", recoveryTime.getValue(), MinRecoveryTime.getValue(), MaxRecoveryTime.getValue()); @@ -100,7 +100,7 @@ throw(RuntimeException) { } void Communicator::setTryingConnectionTime(const Millisecond &tryingConnectionTime) -throw(RuntimeException) { +noexcept(false) { if(tryingConnectionTime < MinTryingConnectionTime || tryingConnectionTime > MaxTryingConnectionTime) { string msg("comm::Communicator::setTryingConnectionTime | "); msg += functions::asString("TryingConnectionTime (%d ms) must be between %d ms and %d ms", tryingConnectionTime.getValue(), MinTryingConnectionTime.getValue(), MaxTryingConnectionTime.getValue()); @@ -112,7 +112,7 @@ throw(RuntimeException) { //static void Communicator::setReceivingChunkSize(const int receivingChunkSize) -throw(RuntimeException) { +noexcept(false) { if(receivingChunkSize < MinReceivingChunkSize || receivingChunkSize > MaxReceivingChunkSize) { string msg("comm::Communicator::setReceivingChunkSize | "); msg += functions::asString("ReceivingChunkSize (%d bytes) must be between %d bytes and %d bytes", receivingChunkSize, MinReceivingChunkSize, MaxReceivingChunkSize); @@ -124,7 +124,7 @@ throw(RuntimeException) { } void Communicator::setLevelOfDenialService(const int levelOfDenialService) -throw(RuntimeException) { +noexcept(false) { const int min(comm::CongestionController::MaxLevel - 2); const int max(comm::CongestionController::MaxLevel); @@ -138,7 +138,7 @@ throw(RuntimeException) { } void Communicator::attach(ServerSocket* serverSocket) -throw(RuntimeException) { +noexcept(false) { if(serverSocket == NULL) throw RuntimeException("Cannot attach a NULL comm::ServerSocket", ANNA_FILE_LOCATION); @@ -156,7 +156,7 @@ throw(RuntimeException) { } void Communicator::attach(BinderSocket* binderSocket) -throw(RuntimeException) { +noexcept(false) { if(binderSocket == NULL) throw RuntimeException("Cannot attach a NULL comm::BinderSocket", ANNA_FILE_LOCATION); @@ -176,7 +176,7 @@ throw(RuntimeException) { * Se invoca desde comm::handler::ServerSocket::accept [Tx] -> */ void Communicator::attach(LocalConnection* localConnection) -throw(RuntimeException) { +noexcept(false) { if(localConnection == NULL) throw RuntimeException("Cannot attach a NULL comm::LocalConnection", ANNA_FILE_LOCATION); @@ -230,7 +230,7 @@ throw(RuntimeException) { * los métodos Communicator::attach. */ void Communicator::attach(RemoteConnection* remoteConnection) -throw(RuntimeException) { +noexcept(false) { if(remoteConnection == NULL) throw RuntimeException("Cannot attach a NULL comm::RemoteConnection", ANNA_FILE_LOCATION); @@ -245,7 +245,7 @@ throw(RuntimeException) { } void Communicator::attach(ClientSocket* socket) -throw(RuntimeException) { +noexcept(false) { if(socket == NULL) throw RuntimeException("Cannot attach a NULL comm::ClientSocket", ANNA_FILE_LOCATION); @@ -260,7 +260,7 @@ throw(RuntimeException) { } void Communicator::attach(DatagramSocket* socket) -throw(RuntimeException) { +noexcept(false) { if(socket == NULL) throw RuntimeException("Cannot attach a NULL comm::DatagramSocket", ANNA_FILE_LOCATION); @@ -275,7 +275,7 @@ throw(RuntimeException) { } void Communicator::attach(Handler* handler) -throw(RuntimeException) { +noexcept(false) { if(handler == NULL) throw RuntimeException("Cannot attach a NULL comm::Handler", ANNA_FILE_LOCATION); @@ -292,7 +292,7 @@ throw(RuntimeException) { } void Communicator::attach(Service* service) -throw(RuntimeException) { +noexcept(false) { if(service == NULL) throw RuntimeException("Cannot attach a NULL comm::Service", ANNA_FILE_LOCATION); @@ -312,7 +312,7 @@ throw(RuntimeException) { } void Communicator::insert(Handler* handler) -throw(RuntimeException) { +noexcept(false) { handler->initialize(); if(handler->getfd() < 0) { @@ -345,7 +345,7 @@ throw(RuntimeException) { } void Communicator::detach(ServerSocket* serverSocket) -throw() { +{ if(serverSocket == NULL) return; @@ -357,7 +357,7 @@ throw() { } void Communicator::detach(ClientSocket* clientSocket) -throw() { +{ if(clientSocket == NULL) return; @@ -365,7 +365,7 @@ throw() { } void Communicator::detach(BinderSocket* binderSocket) -throw() { +{ if(binderSocket == NULL) return; @@ -377,7 +377,7 @@ throw() { * (1) Si se cierra la conexion con el cliente que al que atencia este proceso clonado => debe terminar la ejecucion. */ void Communicator::detach(Handler* handler) -throw() { +{ if(handler == NULL) return; @@ -412,7 +412,7 @@ throw() { } const Handler* Communicator::getHandler(const ClientSocket& clientSocket) -throw(RuntimeException) { +noexcept(false) { Guard guard(this, "comm::Communicator::getHandler"); Handler* result = find(clientSocket.getfd()); @@ -438,7 +438,7 @@ throw(RuntimeException) { // streams pero la forma de recorrer el bucle nos blinda (un poco) de anomalias. //---------------------------------------------------------------------------------------------- void Communicator::accept() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod traceMethod("comm::Communicator", "accept", ANNA_FILE_LOCATION)); if(isServing() == true) @@ -465,7 +465,7 @@ throw(RuntimeException) { } void Communicator::singlethreadedAccept() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod traceMethod(Logger::Local7, "comm::Communicator", "singlethreadedAccept", ANNA_FILE_LOCATION)); Handler* handler; Microsecond maxTime; @@ -540,7 +540,7 @@ throw(RuntimeException) { } void Communicator::multithreadedAccept() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod traceMethod(Logger::Local7, "comm::Communicator", "multithreadedAccept", ANNA_FILE_LOCATION)); { Guard guard(this, "comm::Communicator::multithreadedAccept"); @@ -575,7 +575,7 @@ throw(RuntimeException) { } void Communicator::requestStop() -throw() { +{ if(a_requestedStop == true) return; @@ -601,7 +601,7 @@ throw() { } bool Communicator::isUsable(const ClientSocket* clientSocket) -throw() { +{ if(clientSocket == NULL) return false; @@ -616,7 +616,7 @@ throw() { } void Communicator::setStatus(const Status& status) -throw() { +{ Guard guard(this, "comm::Communicator::setStatus"); if(a_status != status) @@ -630,7 +630,7 @@ throw() { } void Communicator::eventBreakAddress(const in_addr_t& address) -throw() { +{ Device* device = Network::instantiate().find(address); if(device->getStatus() == Device::Status::Down) @@ -674,7 +674,7 @@ throw() { } void Communicator::eventRecoverAddress(const in_addr_t& address) -throw() { +{ Device* device = Network::instantiate().find(address); if(device->getStatus() == Device::Status::Up) @@ -694,7 +694,7 @@ throw() { } bool Communicator::eventAcceptConnection(const ClientSocket& clientSocket) -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod traceMethod(Logger::Local7, "comm::Communicator", "eventAcceptConnection", ANNA_FILE_LOCATION)); if(a_requestedStop == true) { @@ -731,7 +731,7 @@ throw(RuntimeException) { // (3) Solo si todos los servicios "Criticos" estan disponibles pasara a estar "Activo". //-------------------------------------------------------------------------------------------------------- void Communicator::eventCreateConnection(const Server* server) -throw() { +{ if(server == NULL) return; @@ -778,7 +778,7 @@ throw() { } void Communicator::eventCreateConnection(const Service* service) -throw() { +{ if(service == NULL) return; @@ -793,7 +793,7 @@ throw() { * Se invoca desde handler::RemoteConnection:[Tx] -> Communicator */ void Communicator::eventBreakConnection(const Server* server) -throw() { +{ if(server == NULL) return; @@ -823,7 +823,7 @@ throw() { } void Communicator::eventBreakConnection(const Service* service) -throw() { +{ if(service == NULL) return; @@ -836,7 +836,7 @@ throw() { } void Communicator::eventShutdown() -throw() { +{ LOGWARNING( string msg("comm::Communicator::eventShutdown | "); msg += asString(); @@ -861,7 +861,7 @@ throw() { } std::string Communicator::asString() const -throw() { +{ string result("comm::Communicator { "); result += Component::asString(); result += " | RequestedStop: "; @@ -874,7 +874,7 @@ throw() { } xml::Node* Communicator::asXML(xml::Node* parent) const -throw() { +{ parent = app::Component::asXML(parent); xml::Node* result = parent->createChild("comm.Communicator"); result->createAttribute("RequestedStop", anna::functions::asString(a_requestedStop)); @@ -917,7 +917,7 @@ throw() { * el proceso hijo y sigue atendiendo peticiones de conexion. */ void Communicator::do_cloneParent() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod traceMethod("comm::Communicator", "do_cloneParent", ANNA_FILE_LOCATION)); Handler* handler; Handler::Type::_v type; @@ -955,7 +955,7 @@ throw(RuntimeException) { * con ese handler => el programa terminara la ejecucion. */ void Communicator::do_cloneChild() -throw() { +{ LOGMETHOD(TraceMethod traceMethod("comm::Communicator", "do_cloneChild", ANNA_FILE_LOCATION)); LOGINFORMATION( string msg("comm::Communicator::do_cloneChild | MainHandler: "); @@ -1005,7 +1005,7 @@ throw() { } int Communicator::SortByFileDescriptor::value(const Handler* handler) -throw() { +{ return handler->getfd(); } diff --git a/source/comm/CompatCodec.cpp b/source/comm/CompatCodec.cpp index 7719090..39b4475 100644 --- a/source/comm/CompatCodec.cpp +++ b/source/comm/CompatCodec.cpp @@ -29,7 +29,7 @@ bool comm::CompatCodec::st_initScramble(false); // static template comm::Variable* insert(const char* name, const short int id, M& theVector, T& value) -throw(RuntimeException) { +noexcept(false) { comm::Variable* result = theVector.find(id); if(result != NULL) @@ -46,7 +46,7 @@ throw(RuntimeException) { // static template comm::Variable* insertRef(const char* name, const short int id, M& theVector, T& value) -throw(RuntimeException) { +noexcept(false) { comm::Variable* result = theVector.find(id); if(result != NULL) @@ -80,12 +80,12 @@ comm::CompatCodec::~CompatCodec() { } const comm::Variable* comm::CompatCodec::attach(const char* name, const short int id, std::string& value) -throw(RuntimeException) { +noexcept(false) { return insert(name, id, a_variables, value); } const comm::Variable* comm::CompatCodec::attach(const char* name, const short int id, int& value) -throw(RuntimeException) { +noexcept(false) { const int backup(value); const Variable* result = insert(name, id, a_variables, value); value = backup; @@ -93,7 +93,7 @@ throw(RuntimeException) { } const comm::Variable* comm::CompatCodec::attach(const char* name, const short int id, S64& value) -throw(RuntimeException) { +noexcept(false) { const S64 backup(value); const Variable* result = insert(name, id, a_variables, value); value = backup; @@ -101,7 +101,7 @@ throw(RuntimeException) { } const comm::Variable* comm::CompatCodec::attach(const char* name, const short int id, bool& value) -throw(RuntimeException) { +noexcept(false) { const bool backup(value); const Variable* result = insert(name, id, a_variables, value); value = backup; @@ -109,12 +109,12 @@ throw(RuntimeException) { } const comm::Variable* comm::CompatCodec::attach(const char* name, const short int id, DataBlock& value) -throw(RuntimeException) { +noexcept(false) { return insert(name, id, a_variables, value); } const comm::Variable* comm::CompatCodec::attach(const char* name, const short int id, float& value) -throw(RuntimeException) { +noexcept(false) { const float backup(value); const Variable* result = insert(name, id, a_variables, value); value = backup; @@ -122,7 +122,7 @@ throw(RuntimeException) { } const comm::Variable* comm::CompatCodec::attach(const char* name, const short int id, double& value) -throw(RuntimeException) { +noexcept(false) { const double backup(value); const Variable* result = insert(name, id, a_variables, value); value = backup; @@ -130,7 +130,7 @@ throw(RuntimeException) { } const comm::Variable* comm::CompatCodec::attach(const char* name, const short int id, Second& value) -throw(RuntimeException) { +noexcept(false) { const Second backup(value); const Variable* result = insertRef(name, id, a_variables, value); value = backup; @@ -138,7 +138,7 @@ throw(RuntimeException) { } const comm::Variable* comm::CompatCodec::attach(const char* name, const short int id, Millisecond& value) -throw(RuntimeException) { +noexcept(false) { const Millisecond backup(value); const Variable* result = insertRef(name, id, a_variables, value); value = backup; @@ -146,7 +146,7 @@ throw(RuntimeException) { } const comm::Variable* comm::CompatCodec::attach(const char* name, const short int id, Microsecond& value) -throw(RuntimeException) { +noexcept(false) { const Microsecond backup(value); const Variable* result = insertRef(name, id, a_variables, value); value = backup; @@ -154,7 +154,7 @@ throw(RuntimeException) { } const comm::Variable* comm::CompatCodec::attach(const char* name, const short int id, comm::CompatCodec& value) -throw(RuntimeException) { +noexcept(false) { if(&value == this) { String msg("comm::CompatCodec::attach | Variable: "); msg << name << " | Can not link with itself"; @@ -165,7 +165,7 @@ throw(RuntimeException) { } void comm::CompatCodec::setNull(const short int id, const bool isNull) -throw(RuntimeException) { +noexcept(false) { Variable* variable = a_variables.find(id); if(variable == NULL) @@ -182,7 +182,7 @@ throw(RuntimeException) { } void comm::CompatCodec::setNull(const comm::Variable* variable, const bool isNull) -throw() { +{ if(variable->isNull()) { if(isNull == false) a_nullCounter --; } @@ -194,7 +194,7 @@ throw() { } bool comm::CompatCodec::isNull(const short int id) const -throw(RuntimeException) { +noexcept(false) { const Variable* variable = a_variables.find(id); if(variable == NULL) @@ -204,7 +204,7 @@ throw(RuntimeException) { } const comm::Variable& comm::CompatCodec::find(const short int id) const -throw(RuntimeException) { +noexcept(false) { const Variable* variable = a_variables.find(id); if(variable == NULL) @@ -240,7 +240,7 @@ throw(RuntimeException) { // la recogida de datos. //----------------------------------------------------------------------- const DataBlock& comm::CompatCodec::code() -throw(RuntimeException) { +noexcept(false) { unsigned char c(0); iterator ii; iterator maxii(a_variables.end()); @@ -334,7 +334,7 @@ throw(RuntimeException) { //------------------------------------------------------------------------------------------- void comm::CompatCodec::decode(const DataBlock& dataBlock) -throw(RuntimeException) { +noexcept(false) { const char* data = dataBlock.getData(); const int size = dataBlock.getSize(); @@ -364,7 +364,7 @@ throw(RuntimeException) { // Decodifica los buffers que pueden contener variables nulas. //------------------------------------------------------------------------------------------- void comm::CompatCodec::normalDecode(const char* data, const int size, const int maxdata) -throw(RuntimeException) { +noexcept(false) { // Mientras no se demuestre lo contrario todas las variables son nulas a_nullCounter = a_variables.size(); @@ -454,7 +454,7 @@ throw(RuntimeException) { // (1) El codigo de la variable //------------------------------------------------------------------------------------------- bool comm::CompatCodec::optimizedDecode(const char* data, const int size) -throw(RuntimeException) { +noexcept(false) { int nbytes; Variable* variable; const char* top = data + size; @@ -510,7 +510,7 @@ throw(RuntimeException) { } comm::CompatCodec::Type comm::CompatCodec::getType(const DataBlock& dataBlock) -throw(RuntimeException) { +noexcept(false) { const int size(dataBlock.getSize()); if(size <= 1) @@ -531,7 +531,7 @@ comm::CompatCodec::VariableContainer::VariableContainer() { } void comm::CompatCodec::VariableContainer::add(comm::Variable* variable) -throw() { +{ if(a_size == a_maxSize) { int maxSize = (a_maxSize << 1) - (a_maxSize >> 1); Variable** variables = new Variable* [maxSize]; @@ -546,7 +546,7 @@ throw() { } comm::Variable* comm::CompatCodec::VariableContainer::find(const int id) -throw() { +{ for(int ii = 0; ii < a_size; ii ++) { if(a_variables [ii]->getId() == id) return a_variables [ii]; @@ -556,7 +556,7 @@ throw() { } const comm::Variable* comm::CompatCodec::VariableContainer::find(const int id) const -throw() { +{ for(int ii = 0; ii < a_size; ii ++) { if(a_variables [ii]->getId() == id) return a_variables [ii]; @@ -566,7 +566,7 @@ throw() { } void comm::CompatCodec::VariableContainer::clear() -throw() { +{ delete [] a_variables; a_maxSize = a_size = 0; } diff --git a/source/comm/CongestionController.cpp b/source/comm/CongestionController.cpp index 2733381..7fc6209 100644 --- a/source/comm/CongestionController.cpp +++ b/source/comm/CongestionController.cpp @@ -53,7 +53,7 @@ comm::CongestionController::CongestionController() : } void comm::CongestionController::setLimit(const int limit) -throw() { +{ Guard guard(a_mutex, "comm::CongestionController (setLimit)"); if(limit < 0 || limit > 100) { @@ -87,7 +87,7 @@ throw() { } void comm::CongestionController::setMaxPendingBytes(const int maxPendingBytes) -throw(RuntimeException) { +noexcept(false) { if(maxPendingBytes == UnusedPendingBytes) { a_maxPendingBytes = UnusedPendingBytes; return; @@ -112,7 +112,7 @@ throw(RuntimeException) { * por su manejador asociado. */ comm::CongestionController::Advice::_v comm::CongestionController::getAdvice(const ClientSocket& clientSocket) -throw() { +{ Guard guard(a_mutex, "comm::CongestionController::getAdvice"); if(a_limit == 0) { @@ -205,13 +205,13 @@ throw() { } void comm::CongestionController::incrementIncomingSocket() -throw(RuntimeException) { +noexcept(false) { Guard guard(a_mutex, "comm::CongestionController::incrementIncomingSocket"); a_incomingSocketCounter ++; } void comm::CongestionController::decrementIncomingSocket() -throw(RuntimeException) { +noexcept(false) { if(a_incomingSocketCounter == 0) return; @@ -237,7 +237,7 @@ throw(RuntimeException) { } int comm::CongestionController::calculeWorkload(const ClientSocket& clientSocket) const -throw() { +{ int maxSize; if(a_maxPendingBytes == UnusedPendingBytes) @@ -256,7 +256,7 @@ throw() { } xml::Node* comm::CongestionController::asXML(xml::Node* parent) const -throw() { +{ static const char* modetxt [] = { "Auto", "Local", "Global" }; xml::Node* result = parent->createChild("comm.CongestionController"); result->createAttribute("Limit", a_limit); @@ -295,7 +295,7 @@ throw() { } comm::CongestionController::Workload comm::CongestionController::getAccumulatedWorkload() const -throw() { +{ Workload result; const Millisecond now = functions::millisecond(); @@ -326,7 +326,7 @@ throw() { comm::CongestionController::Workload comm::CongestionController::getCurrentWorkload(const comm::ClientSocket& clientSocket) const -throw() { +{ Workload result; result.second = calculeWorkload(clientSocket); diff --git a/source/comm/DatagramSocket.cpp b/source/comm/DatagramSocket.cpp index a0debf8..342b82a 100644 --- a/source/comm/DatagramSocket.cpp +++ b/source/comm/DatagramSocket.cpp @@ -30,7 +30,7 @@ comm::DatagramSocket::DatagramSocket(const comm::DatagramSocket::Mode mode, cons } void comm::DatagramSocket::connect() -throw(RuntimeException) { +noexcept(false) { Guard guard(*this, "comm::DatagramSocket::connect"); anna_socket_assert(isConnected() == true, "Already connected"); @@ -53,7 +53,7 @@ throw(RuntimeException) { } void comm::DatagramSocket::do_write(const DataBlock& message) -throw(RuntimeException) { +noexcept(false) { sockaddr* s(NULL); int len(0); a_remoteAccessPoint.translate(*this, s, len); @@ -76,7 +76,7 @@ throw(RuntimeException) { } int comm::DatagramSocket::do_read(const char* data, const int maxSize) -throw(RuntimeException) { +noexcept(false) { int result; anna_signal_shield(result, recvfrom(Socket::a_fd, (void*) data, maxSize, 0, (sockaddr*) NULL, NULL)); diff --git a/source/comm/Delivery.cpp b/source/comm/Delivery.cpp index 37a03cc..51b005c 100644 --- a/source/comm/Delivery.cpp +++ b/source/comm/Delivery.cpp @@ -24,7 +24,7 @@ using namespace anna; const Millisecond comm::Delivery::DefaultRecoveryTime(60000); void comm::Delivery::initialize() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tm("comm::Delivery", "initialize", ANNA_FILE_LOCATION)); // No es necesario protegerlo porque cuando se ejecuta todavía estarmos en la parte // en la que no se han lanzado los thread's @@ -58,7 +58,7 @@ throw(RuntimeException) { // los recursos con fallos internos. //--------------------------------------------------------------------------------------------- comm::Resource* comm::Delivery::apply() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tm(Logger::Local7, "comm::Delivery", "apply", ANNA_FILE_LOCATION)); Guard guard(*this, "comm::Delivery::apply"); @@ -102,7 +102,7 @@ throw(RuntimeException) { } bool comm::Delivery::fault(const Resource* resource) -throw() { +{ LOGMETHOD(TraceMethod tm(Logger::Local7, "comm::Delivery", "fault", ANNA_FILE_LOCATION)); if(resource == NULL) @@ -138,7 +138,7 @@ throw() { } bool comm::Delivery::recover(const Resource* resource) -throw() { +{ if(resource == NULL) return a_isAvailable; @@ -148,7 +148,7 @@ throw() { } bool comm::Delivery::unsafe_recover(const Resource* resource) -throw() { +{ LOGMETHOD(TraceMethod tm(Logger::Local7, "comm::Delivery", "unsafe_recover", ANNA_FILE_LOCATION)); if(find(comm::Delivery::begin(), end(), resource) == end()) // (1) @@ -166,7 +166,7 @@ throw() { } bool comm::Delivery::contains(const Resource* resource) const -throw() { +{ if(resource == NULL) return false; @@ -176,13 +176,13 @@ throw() { // Devolverá true si no tiene disponible ninguno de los recursos asociados. bool comm::Delivery::do_fault(const Resource* resource) -throw() { +{ return (isAvailable() == true) ? false : true; } // Devolverá true si tiene disponible alguno de los recursos que tiene asociados. bool comm::Delivery::do_recover(const Resource* resource) -throw() { +{ return isAvailable(); } @@ -193,7 +193,7 @@ throw() { // //------------------------------------------------------------------------------------------- bool comm::Delivery::isAvailable() const -throw() { +{ bool result(false); for(const_iterator ii = begin(), maxii = end(); ii != maxii; ii ++) { @@ -209,7 +209,7 @@ throw() { } void comm::Delivery::add(Resource* resource) -throw(RuntimeException) { +noexcept(false) { if(resource == NULL) { string msg(asString()); msg += " | Cannot attach a NULL resource"; @@ -232,7 +232,7 @@ throw(RuntimeException) { } bool comm::Delivery::do_contains(const comm::Resource* resource) const -throw() { +{ for(const_iterator ii = begin(), maxii = end(); ii != maxii; ii ++) if(*Delivery::resource(ii) == *resource) return true; @@ -241,7 +241,7 @@ throw() { } string comm::Delivery::asString() const -throw() { +{ string result("comm::Delivery { Name: "); result += a_name; result += functions::asText(" | Available: ", a_isAvailable); @@ -255,7 +255,7 @@ throw() { } xml::Node* comm::Delivery::asXML(xml::Node* parent) const -throw() { +{ xml::Node* node = parent->createChild("comm.Delivery"); node->createAttribute("Name", a_name); node->createAttribute("Available", functions::asString(a_isAvailable)); @@ -284,7 +284,7 @@ throw() { */ /*static*/ bool comm::Delivery::internalErrorDetected(const Resource* resource) -throw() { +{ return resource->isEnabled() == false && resource->isAvailable() == true; } diff --git a/source/comm/Device.cpp b/source/comm/Device.cpp index 039755b..0bc5766 100644 --- a/source/comm/Device.cpp +++ b/source/comm/Device.cpp @@ -18,14 +18,14 @@ using namespace std; using namespace anna; string comm::Device::asString() const -throw() { +{ string result("comm::Device { IP: "); result += asString(a_address); return result += anna::functions::asString(" | Status: %s }", (a_status == Status::Up) ? "Up" : "Down"); } xml::Node* comm::Device::asXML(xml::Node* parent) const -throw(RuntimeException) { +noexcept(false) { xml::Node* result = parent->createChild("comm.Device"); result->createAttribute("IP", asString(a_address)); result->createAttribute("Status", (a_status == Status::Up) ? "Up" : "Down"); @@ -33,13 +33,13 @@ throw(RuntimeException) { } void comm::Device::asAttribute(xml::Node* node) const -throw(RuntimeException) { +noexcept(false) { node->createAttribute("IP", asString(a_address)); node->createAttribute("Status", (a_status == Status::Up) ? "Up" : "Down"); } std::string comm::Device::asString(const in_addr_t& address) -throw() { +{ struct in_addr in; in.s_addr = address; return string(inet_ntoa(in)); diff --git a/source/comm/Handler.cpp b/source/comm/Handler.cpp index d46d4bc..a63fee8 100644 --- a/source/comm/Handler.cpp +++ b/source/comm/Handler.cpp @@ -28,7 +28,7 @@ using namespace anna; // En modo ST invocamos directamente al Handler::apply. //------------------------------------------------------------------------------------------------ void comm::Handler::do_action() -throw(RuntimeException) { +noexcept(false) { pollfd pollfd; pollfd.fd = getfd(); pollfd.events = POLLIN | POLLRDNORM; @@ -107,7 +107,7 @@ throw(RuntimeException) { } std::string comm::Handler::asString() const -throw() { +{ string msg("comm::Handler { "); msg += Runnable::asString(); @@ -126,14 +126,14 @@ throw() { } xml::Node* comm::Handler::asXML(xml::Node* parent) const -throw(RuntimeException) { +noexcept(false) { xml::Node* result = parent->createChild("comm.Handler"); asAttribute(result); return result; } void comm::Handler::asAttribute(xml::Node* node) const -throw(RuntimeException) { +noexcept(false) { node->createAttribute("Id", getId()); node->createAttribute("RequestStop", anna::functions::asString(hasRequestedStop())); diff --git a/source/comm/Host.cpp b/source/comm/Host.cpp index 43ff561..818483b 100644 --- a/source/comm/Host.cpp +++ b/source/comm/Host.cpp @@ -29,24 +29,24 @@ comm::Host::~Host() { } int comm::Host::SortBy::value(const Server* server) -throw() { +{ return server->getRemotePort(); } const comm::Server* comm::Host::find_server(const int remotePort) const -throw() { +{ return a_servers.find(remotePort); } comm::Server* comm::Host::find_server(const int remotePort) -throw() { +{ return a_servers.find(remotePort); } comm::Server* comm::Host::createServer(const string& name, const int remotePort, const bool autoRecovery, comm::TransportFactory* transportFactory, const bool ignoreIncomingMessages, const bool doConnect) -throw(RuntimeException) { +noexcept(false) { return add(createServer(ServerAllocator(name, *this, remotePort, autoRecovery, transportFactory, ignoreIncomingMessages)), remotePort, doConnect); } @@ -58,21 +58,21 @@ throw(RuntimeException) { // ServerSocket remoto. //------------------------------------------------------------------------------- comm::Server* comm::Host::createServer(const ServerAllocator& serverAllocator) -throw(RuntimeException) { +noexcept(false) { Server* result = serverAllocator.apply(); result->setIgnoreIncomingMessages(serverAllocator.getIgnoreIncomingMessages()); return result; } void comm::Host::assign(const Device* device) -throw(RuntimeException) { +noexcept(false) { if(contains(device) == false) a_devices.push_back(device); } string comm::Host::asString() const -throw() { +{ string result; result = "comm::Host { Name: "; result += getName(); @@ -92,7 +92,7 @@ throw() { xml::Node* comm::Host::asXML(xml::Node* parent) const -throw(RuntimeException) { +noexcept(false) { xml::Node* host = parent->createChild("comm.Host"); xml::Node* node; host->createAttribute("Name", getName()); @@ -111,7 +111,7 @@ throw(RuntimeException) { comm::Server* comm::Host::add(comm::Server* result, const int remotePort, const bool doConnect) -throw() { +{ result->a_sequence = a_servers.size(); a_servers.add(result); diff --git a/source/comm/INetAddress.cpp b/source/comm/INetAddress.cpp index f9dbd2d..2a6bd18 100644 --- a/source/comm/INetAddress.cpp +++ b/source/comm/INetAddress.cpp @@ -18,7 +18,7 @@ using namespace std; using namespace anna; const comm::Device* comm::INetAddress::getDevice(const bool exceptionWhenNull) const -throw(RuntimeException) { +noexcept(false) { if(a_device == NULL && exceptionWhenNull == true) { string msg(asString()); msg += " | No device attached"; @@ -29,21 +29,21 @@ throw(RuntimeException) { } string comm::INetAddress::asString() const -throw() { +{ string result("comm::INetAddress { "); result += functions::asString(a_device); return result += anna::functions::asString(" | Port: %d }", a_port); } string comm::INetAddress::serialize() const -throw() { +{ in_addr_t inaddr = (a_device) ? a_device->getAddress() : 0; string result(Device::asString(inaddr)); return result += anna::functions::asString(".%d", a_port); } xml::Node* comm::INetAddress::asXML(xml::Node* parent) const -throw(RuntimeException) { +noexcept(false) { xml::Node* result = parent->createChild("comm.INetAddress"); if(a_device != NULL) diff --git a/source/comm/IndexedDelivery.cpp b/source/comm/IndexedDelivery.cpp index abc115f..98ad2d2 100644 --- a/source/comm/IndexedDelivery.cpp +++ b/source/comm/IndexedDelivery.cpp @@ -28,7 +28,7 @@ using namespace std; using namespace anna; void comm::IndexedDelivery::prepare(const int key) -throw(RuntimeException) { +noexcept(false) { const int size = comm::Delivery::size(); if(size == 0) { @@ -51,7 +51,7 @@ throw(RuntimeException) { } comm::Resource* comm::IndexedDelivery::do_apply() -throw(RuntimeException) { +noexcept(false) { comm::Resource* result = NULL; if(a_iikey == comm::Delivery::end()) @@ -97,7 +97,7 @@ throw(RuntimeException) { } string comm::IndexedDelivery::asString() const -throw() { +{ string result = className(); result += " { "; result += comm::Delivery::asString(); @@ -107,7 +107,7 @@ throw() { } xml::Node* comm::IndexedDelivery::asXML(xml::Node* parent) const -throw() { +{ xml::Node* node = parent->createChild("comm.IndexedDelivery"); node->createAttribute("Mode", (a_mode == Mode::Strict) ? "Strict" : "Flexible"); comm::Service::asXML(node); diff --git a/source/comm/LargeBinaryCodec.cpp b/source/comm/LargeBinaryCodec.cpp index 4d92416..529782e 100644 --- a/source/comm/LargeBinaryCodec.cpp +++ b/source/comm/LargeBinaryCodec.cpp @@ -15,7 +15,7 @@ using namespace std; using namespace anna; void comm::LargeBinaryCodec::decode(const DataBlock& dataBlock) -throw(RuntimeException) { +noexcept(false) { DataBlock* block; comm::Codec::decode(dataBlock); const char* data = a_dataBlock.getData(); @@ -39,7 +39,7 @@ throw(RuntimeException) { } void comm::LargeBinaryCodec::reset() -throw() { +{ for(iterator ii = a_blocks.begin(), maxii = a_blocks.end(); ii != maxii; ii ++) delete data(ii); @@ -47,7 +47,7 @@ throw() { } comm::LargeBinaryCodec& comm::LargeBinaryCodec::operator += (const DataBlock & dataBlock) -throw(RuntimeException) { +noexcept(false) { char size [sizeof(int)]; a_dataBlock.append(functions::codeInteger(size, dataBlock.getSize()), sizeof(int)); a_dataBlock += dataBlock; diff --git a/source/comm/Message.cpp b/source/comm/Message.cpp index 4740416..a0b5f7b 100644 --- a/source/comm/Message.cpp +++ b/source/comm/Message.cpp @@ -52,7 +52,7 @@ comm::Message::~Message() { */ /*virtual*/ comm::Message * comm::Message::setBody(const xml::Node* node) -throw(RuntimeException) { +noexcept(false) { if(a_xmlCompiler == NULL) a_xmlCompiler = new xml::Compiler; diff --git a/source/comm/Network.cpp b/source/comm/Network.cpp index 709cc77..0a08f5b 100644 --- a/source/comm/Network.cpp +++ b/source/comm/Network.cpp @@ -23,7 +23,7 @@ using namespace std; using namespace anna; comm::Device* comm::Network::find(const in_addr_t& address) -throw() { +{ Device* result = NULL; if(a_cacheDevice != NULL && *a_cacheDevice == address) @@ -41,7 +41,7 @@ throw() { } comm::Host* comm::Network::find_host(const char* name) -throw() { +{ Host* result = NULL; if(a_cacheHost != NULL && anna_strcmp(a_cacheHost->getName().c_str(), name) == 0) @@ -59,7 +59,7 @@ throw() { } comm::Host* comm::Network::resolve(const char* hostname) -throw(RuntimeException) { +noexcept(false) { comm::Host* result = find_host(hostname); struct hostent *host; @@ -95,7 +95,7 @@ throw(RuntimeException) { comm::Server* comm::Network::createServer(const char* ip, const int remotePort, const bool autoRecovery, comm::TransportFactory* transportFactory, const Port::_v mode, const DoConnect::_v doConnect) -throw(RuntimeException) { +noexcept(false) { comm::Server* result(NULL); comm::Host* host = find_host(ip); Guard guard(host, "comm::Host from comm::Network::createServer"); @@ -116,14 +116,14 @@ throw(RuntimeException) { } comm::Server* comm::Network::createServer(const char* ip, const int remotePort, const bool autoRecovery, comm::ReceiverFactory& rrff, comm::TransportFactory* transportFactory, const Port::_v mode, const DoConnect::_v doConnect) -throw(RuntimeException) { +noexcept(false) { Server* result = createServer(ip, remotePort, autoRecovery, transportFactory, mode, doConnect); result->setReceiverFactory(rrff); return result; } //comm::Server* comm::Network::findServer (const char* ip, const int remotePort) -// throw (RuntimeException) +// noexcept(false) //{ // comm::Host* _host (NULL); // @@ -139,7 +139,7 @@ throw(RuntimeException) { comm::Server* comm::Network::resolveServer(const char* hostname, const int remotePort, const bool autoRecovery, comm::TransportFactory* transportFactory, const Port::_v mode, const DoConnect::_v doConnect) -throw(RuntimeException) { +noexcept(false) { comm::Server* result(NULL); comm::Host* host = resolve(hostname); Guard guard(host, "comm::Host from comm::Network::resolveServer"); @@ -158,26 +158,26 @@ throw(RuntimeException) { } comm::Server* comm::Network::resolveServer(const char* hostname, const int remotePort, const bool autoRecovery, comm::ReceiverFactory& rrff, comm::TransportFactory* transportFactory, const Port::_v mode, const DoConnect::_v doConnect) -throw(RuntimeException) { +noexcept(false) { Server* result = resolveServer(hostname, remotePort, autoRecovery, transportFactory, mode, doConnect); result->setReceiverFactory(rrff); return result; } comm::INetAddress comm::Network::getINetAddress(const char* ip, const int port) -throw(RuntimeException) { +noexcept(false) { const Device* device = find(Device::asAddress(ip)); return INetAddress(device, port); } comm::INetAddress comm::Network::getINetAddress(const std::string& ip, const int port) -throw(RuntimeException) { +noexcept(false) { const Device* device = find(Device::asAddress(ip)); return INetAddress(device, port); } xml::Node* comm::Network::asXML(xml::Node* parent) const -throw() { +{ xml::Node* result = parent->createChild("comm.Network"); xml::Node* node = result->createChild("comm.Devices"); diff --git a/source/comm/ReceiverFactory.cpp b/source/comm/ReceiverFactory.cpp index b98a894..a4dc5f6 100644 --- a/source/comm/ReceiverFactory.cpp +++ b/source/comm/ReceiverFactory.cpp @@ -28,7 +28,7 @@ comm::ReceiverFactory::ReceiverFactory(const char* name) : // En entornos ST solo habra una unica instancia compartida por todos los comm::ClientSocket //--------------------------------------------------------------------------------------------- comm::Receiver* comm::ReceiverFactory::create() -throw(RuntimeException) { +noexcept(false) { comm::Receiver* result(NULL); WHEN_SINGLETHREAD( @@ -46,7 +46,7 @@ throw(RuntimeException) { } void comm::ReceiverFactory::release(comm::Receiver* receiver) -throw() { +{ WHEN_MULTITHREAD( try { @@ -59,7 +59,7 @@ throw() { } xml::Node* comm::ReceiverFactory::asXML(xml::Node* parent) const -throw() { +{ xml::Node* result = parent->createChild("Receiver"); result->createAttribute("Name", a_name); return result; diff --git a/source/comm/Resource.cpp b/source/comm/Resource.cpp index 70b1770..3f8ece6 100644 --- a/source/comm/Resource.cpp +++ b/source/comm/Resource.cpp @@ -17,7 +17,7 @@ using namespace std; using namespace anna; xml::Node* comm::Resource::asXML(xml::Node* parent) const -throw(RuntimeException) { +noexcept(false) { xml::Node* result = parent->createChild("comm.Resource"); result->createAttribute("Name", getName()); result->createAttribute("Enabled", functions::asString(isEnabled())); @@ -26,7 +26,7 @@ throw(RuntimeException) { } void comm::Resource::asAttribute(xml::Node* node) const -throw(RuntimeException) { +noexcept(false) { node->createAttribute("Name", getName()); node->createAttribute("Enabled", functions::asString(isEnabled())); node->createAttribute("Available", functions::asString(isAvailable())); diff --git a/source/comm/RoundRobinDelivery.cpp b/source/comm/RoundRobinDelivery.cpp index 9c48bbf..553dadc 100644 --- a/source/comm/RoundRobinDelivery.cpp +++ b/source/comm/RoundRobinDelivery.cpp @@ -28,13 +28,13 @@ using namespace std; using namespace anna; void comm::RoundRobinDelivery::do_initialize() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tm("comm::RoundRobinDelivery", "do_initialize", ANNA_FILE_LOCATION)); a_iiserver = comm::Delivery::begin(); } comm::Resource* comm::RoundRobinDelivery::do_apply() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tm(Logger::Local7, "comm::RoundRobinDelivery", "do_apply", ANNA_FILE_LOCATION)); comm::Resource* result = NULL; @@ -58,7 +58,7 @@ throw(RuntimeException) { } comm::RoundRobinDelivery::iterator comm::RoundRobinDelivery::advance() -throw() { +{ a_iiserver ++; if(a_iiserver == comm::Delivery::end()) @@ -68,7 +68,7 @@ throw() { } string comm::RoundRobinDelivery::asString() const -throw() { +{ string result = className(); result += " { "; result += comm::Service::asString(); @@ -76,7 +76,7 @@ throw() { } xml::Node* comm::RoundRobinDelivery::asXML(xml::Node* parent) const -throw() { +{ xml::Node* node = parent->createChild("comm.RoundRobinDelivery"); comm::Service::asXML(node); return node; diff --git a/source/comm/Server.cpp b/source/comm/Server.cpp index 1869910..9be5fcc 100644 --- a/source/comm/Server.cpp +++ b/source/comm/Server.cpp @@ -66,7 +66,7 @@ comm::Server::~Server() { * orden que el usado en el Server::connect. */ void comm::Server::reset() -throw(RuntimeException) { +noexcept(false) { // La SSCC se establece en el método que invoca a éste // Guard guard (*this, "comm::Server::reset"); if(a_clientSocket == NULL) @@ -78,7 +78,7 @@ throw(RuntimeException) { } void comm::Server::setReceiverFactory(comm::ReceiverFactory& receiverFactory) -throw() { +{ a_receiverFactory = &receiverFactory; if(a_clientSocket != NULL) @@ -128,7 +128,7 @@ throw() { */ void comm::Server::connect() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tm(Logger::Local7, "comm::Server", "connect", ANNA_FILE_LOCATION)); Communicator* communicator = functions::component (ANNA_FILE_LOCATION); /* @@ -195,7 +195,7 @@ throw(RuntimeException) { // se intenta usar => se intenta volver a conectar antes de dar el fallo. //--------------------------------------------------------------------------------------- comm::ClientSocket* comm::Server::send(Message& message) -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tm(Logger::Local7, "comm::Server", "send", ANNA_FILE_LOCATION)); Guard guard(*this, "comm::Server::send"); const bool available = isAvailable(); @@ -215,32 +215,32 @@ throw(RuntimeException) { } comm::ClientSocket* comm::Server::send(Message* message) -throw(RuntimeException) { +noexcept(false) { if(message == NULL) throw RuntimeException("anna::comm::Server::send | Cannot send a NULL message", ANNA_FILE_LOCATION); return send(*message); } -void comm::Server::setAutoRecovery(bool autoRecovery) throw() { +void comm::Server::setAutoRecovery(bool autoRecovery) { bool* ar = const_cast (&a_autoRecovery); *ar = autoRecovery; } bool comm::Server::isAvailable() const -throw(RuntimeException) { +noexcept(false) { // Guard guard (*this, "comm::Server::isAvailable"); return (a_clientSocket == NULL) ? false : (a_clientSocket->isConnected() && (a_clientSocket->isClosedPending() == false)); } // Este metodo sea re-escrito en commsec::Server::allocateClientSocket para devolver un commsec::RemoteConnection comm::ClientSocket* comm::Server::allocateClientSocket(const comm::INetAddress& in, comm::TransportFactory* transportFactory) const -throw() { +{ return new ClientSocket(in, transportFactory); } string comm::Server::asString() const -throw() { +{ string result("comm::Server { "); result += Resource::asString(); result += " | Sequence: "; @@ -260,7 +260,7 @@ throw() { } xml::Node* comm::Server::asXML(xml::Node* parent) const -throw(RuntimeException) { +noexcept(false) { xml::Node* result = parent->createChild("comm.Server"); result->createAttribute("Host", a_host.getName()); result->createAttribute("Sequence", a_sequence); diff --git a/source/comm/ServerAllocator.cpp b/source/comm/ServerAllocator.cpp index 611a7dd..4045417 100644 --- a/source/comm/ServerAllocator.cpp +++ b/source/comm/ServerAllocator.cpp @@ -13,7 +13,7 @@ using namespace std; using namespace anna; comm::Server* comm::ServerAllocator::apply() const -throw() { +{ return new Server(a_name, a_host, a_remotePort, a_autoRecovery, a_transportFactory); } diff --git a/source/comm/ServerSocket.cpp b/source/comm/ServerSocket.cpp index c4f6abf..1f397a1 100644 --- a/source/comm/ServerSocket.cpp +++ b/source/comm/ServerSocket.cpp @@ -29,7 +29,7 @@ comm::ServerSocket::~ServerSocket() { } void comm::ServerSocket::prepare() -throw(RuntimeException) { +noexcept(false) { if (::listen(Socket::a_fd, a_backlog) == -1) { const int xerrno(errno); std::string msg(asString()); @@ -39,7 +39,7 @@ throw(RuntimeException) { } int comm::ServerSocket::do_bind(const struct sockaddr* s, const int len) -throw(RuntimeException) { +noexcept(false) { if (a_sharedBind == false) return Socket::do_bind(s, len); @@ -54,7 +54,7 @@ throw(RuntimeException) { * al ServerSocket::release porque ha cerrado la conexión. */ comm::LocalConnection* comm::ServerSocket::accept() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod traceMethod(Logger::Local7, "comm::ServerSocket", "accept", ANNA_FILE_LOCATION)); LocalConnection* result(NULL); sockaddr_in sourceAddress; @@ -113,7 +113,7 @@ throw(RuntimeException) { } comm::ClientSocket* comm::ServerSocket::allocateClientSocket() const -throw() { +{ return new ClientSocket(getTransportFactory(), Socket::Domain::Inet, Socket::Type::Stream); } @@ -125,7 +125,7 @@ throw() { * Se invoca desde comm::handler::ServerSocket::apply::[Tx] -> */ void comm::ServerSocket::release(LocalConnection* localConnection) -throw(RuntimeException) { +noexcept(false) { if (localConnection == NULL) return; @@ -136,7 +136,7 @@ throw(RuntimeException) { } std::string comm::ServerSocket::asString() const -throw() { +{ std::string msg("comm::ServerSocket { "); msg += comm::Socket::asString(); msg += " | Bind: "; @@ -151,7 +151,7 @@ throw() { } xml::Node* comm::ServerSocket::asXML(xml::Node* parent) const -throw(RuntimeException) { +noexcept(false) { xml::Node* result = parent->createChild("comm.ServerSocket"); comm::Socket::asXML(result); result->createAttribute("Bind", (a_sharedBind) ? "Shared" : "Exclusive"); diff --git a/source/comm/Service.cpp b/source/comm/Service.cpp index ce86dbe..80c64a8 100644 --- a/source/comm/Service.cpp +++ b/source/comm/Service.cpp @@ -18,7 +18,7 @@ using namespace std; using namespace anna; void comm::Service::attach(comm::Server* server) -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tm(Logger::Local7, "comm::Service", "attach", ANNA_FILE_LOCATION)); comm::Delivery::add(server); server->attach(this); @@ -28,7 +28,7 @@ throw(RuntimeException) { // (1) Cuando no queda ningun recurso disponible se devuelve una excepcion //---------------------------------------------------------------------------------- comm::Server* comm::Service::send(comm::Message& message) -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tm(Logger::Local7, "comm::Service", "send", ANNA_FILE_LOCATION)); comm::Server* tryServer = NULL; comm::Server* init = NULL; @@ -63,7 +63,7 @@ throw(RuntimeException) { } comm::Server* comm::Service::send(comm::Message* message) -throw(RuntimeException) { +noexcept(false) { if(message == NULL) throw RuntimeException("comm::Service::send | Cannot send a NULL message", ANNA_FILE_LOCATION); @@ -71,7 +71,7 @@ throw(RuntimeException) { } int comm::Service::broadcast(comm::Message& message) -throw() { +{ using namespace anna::comm; int result = 0; @@ -94,7 +94,7 @@ throw() { } int comm::Service::broadcast(comm::Message* message) -throw() { +{ if(message == NULL) { Logger::write(Logger::Error, "comm::Service::broadcast | Cannot broadcast a NULL message", ANNA_FILE_LOCATION); return 0; @@ -104,7 +104,7 @@ throw() { } string comm::Service::asString() const -throw() { +{ string result("comm::Service { "); result += Delivery::asString(); result += " | Critical: "; @@ -113,7 +113,7 @@ throw() { } xml::Node* comm::Service::asXML(xml::Node* parent) const -throw() { +{ xml::Node* service = parent->createChild("comm.Service"); Delivery::asXML(service); service->createAttribute("Critical", functions::asString(a_isCritical)); @@ -122,13 +122,13 @@ throw() { /*static*/ comm::Server* comm::Service::server(comm::Delivery::iterator& ii) -throw() { +{ return static_cast (Delivery::resource(ii)); } /*static*/ const comm::Server* comm::Service::server(comm::Delivery::const_iterator& ii) -throw() { +{ return static_cast (Delivery::resource(ii)); } diff --git a/source/comm/Socket.cpp b/source/comm/Socket.cpp index 9f770f3..365f427 100644 --- a/source/comm/Socket.cpp +++ b/source/comm/Socket.cpp @@ -97,7 +97,7 @@ Socket::~Socket() { } bool Socket::support(const char* transportClassName) const -throw() { +{ if(a_transportFactory == NULL) return false; @@ -109,7 +109,7 @@ throw() { // ya tienen activa su propia zona de exclusin. //--------------------------------------------------------------------------- void Socket::open() -throw(RuntimeException) { +noexcept(false) { if(a_fd != -1) return; @@ -144,7 +144,7 @@ throw(RuntimeException) { } void Socket::close() -throw() { +{ if(a_fd == -1) return; @@ -164,7 +164,7 @@ throw() { } bool Socket::setBlockingMode(const bool blockingMode) -throw(RuntimeException) { +noexcept(false) { int opts; int result; anna_socket_assert(a_fd == -1, "Socket is not opened"); @@ -187,7 +187,7 @@ throw(RuntimeException) { } bool Socket::setReuseMode(const bool reuseMode) -throw(RuntimeException) { +noexcept(false) { anna_socket_assert(a_fd == -1, "Socket is not opened"); if(a_reuseMode == reuseMode) @@ -204,7 +204,7 @@ throw(RuntimeException) { } void Socket::bind() -throw(RuntimeException) { +noexcept(false) { Guard guard(*this, "comm::Socket::bind"); if(a_fd == -1) @@ -231,12 +231,12 @@ throw(RuntimeException) { } int Socket::do_bind(const struct sockaddr *addr, const int len) -throw(RuntimeException) { +noexcept(false) { return ::bind(a_fd, addr, len); } std::string Socket::asString() const -throw() { +{ std::string msg("comm::Socket { Domain: "); switch(a_domain) { @@ -275,7 +275,7 @@ throw() { } xml::Node* Socket::asXML(xml::Node* parent) const -throw(RuntimeException) { +noexcept(false) { const char* aux; xml::Node* result = parent->createChild("comm.Socket"); @@ -313,7 +313,7 @@ throw(RuntimeException) { } const char* Socket::asText(const Socket::Notify::_v v) -throw() { +{ static const char* text [] = { "None", "ReceiveData", "Close", "Corrupt" }; return text [v]; } diff --git a/source/comm/Status.cpp b/source/comm/Status.cpp index ad3b2b0..d7a7a28 100644 --- a/source/comm/Status.cpp +++ b/source/comm/Status.cpp @@ -9,7 +9,7 @@ #include std::string anna::comm::Status::asString() const -throw() { +{ static const char* status [] = { "Available", "Unavailable", "Overload" }; std::string result("comm::Status { "); result += status [a_value]; diff --git a/source/comm/functions.cpp b/source/comm/functions.cpp index 56c541e..86ecd3f 100644 --- a/source/comm/functions.cpp +++ b/source/comm/functions.cpp @@ -25,7 +25,7 @@ using namespace std; using namespace anna; comm::Application& comm::functions::getApp() -throw(RuntimeException) { +noexcept(false) { if(comm::Application::st_application == NULL) throw RuntimeException("No Application class has been defined", ANNA_FILE_LOCATION); @@ -36,7 +36,7 @@ throw(RuntimeException) { } string comm::functions::getHostName() -throw(RuntimeException) { +noexcept(false) { char hostName [MAXHOSTNAMELEN]; if(gethostname(hostName, MAXHOSTNAMELEN) != 0) @@ -49,7 +49,7 @@ throw(RuntimeException) { std::string comm::functions::resolveIP(const char* hostname) -throw(RuntimeException) { +noexcept(false) { std::string result; struct hostent *host; diff --git a/source/comm/handler/BinderSocket.cpp b/source/comm/handler/BinderSocket.cpp index 34ddfe9..b1da86e 100644 --- a/source/comm/handler/BinderSocket.cpp +++ b/source/comm/handler/BinderSocket.cpp @@ -25,7 +25,7 @@ using namespace anna; // La apertura de cierre de este Socket se hace desde el comm::Socket. //----------------------------------------------------------------------- void comm::handler::BinderSocket::initialize() -throw(RuntimeException) { +noexcept(false) { if(a_binderSocket == NULL) { string msg(asString()); msg += " | comm::BinderSocket was not established"; @@ -41,13 +41,13 @@ throw(RuntimeException) { // compartido que va a crear. //--------------------------------------------------------------------------------------- void comm::handler::BinderSocket::apply() -throw(RuntimeException) { +noexcept(false) { Guard guard(a_binderSocket); a_binderSocket->responseBind(); } void comm::handler::BinderSocket::finalize() -throw() { +{ if(a_binderSocket == NULL) return; @@ -57,7 +57,7 @@ throw() { } string comm::handler::BinderSocket::asString() const -throw() { +{ string result("comm::handler::BinderSocket { "); result += comm::Handler::asString(); result += " | "; @@ -66,7 +66,7 @@ throw() { } xml::Node* comm::handler::BinderSocket::asXML(xml::Node* parent) const -throw() { +{ xml::Node* result = parent->createChild("comm.handler.BinderSocket"); comm::Handler::asAttribute(result); diff --git a/source/comm/handler/ClientSocket.cpp b/source/comm/handler/ClientSocket.cpp index 34b2b34..d2f7aae 100644 --- a/source/comm/handler/ClientSocket.cpp +++ b/source/comm/handler/ClientSocket.cpp @@ -24,7 +24,7 @@ using namespace std; using namespace anna; void comm::handler::ClientSocket::initialize() -throw(RuntimeException) { +noexcept(false) { if(a_clientSocket == NULL) { string msg(asString()); msg += " | comm::ClientSocket was not established"; @@ -43,7 +43,7 @@ throw(RuntimeException) { * [Tx] -> Communicator */ void comm::handler::ClientSocket::finalize() -throw() { +{ if(a_clientSocket == NULL) return; @@ -58,7 +58,7 @@ throw() { } void comm::handler::ClientSocket::clone() -throw(RuntimeException) { +noexcept(false) { if(a_clientSocket->isConnected() == true) a_clientSocket->close(); @@ -76,7 +76,7 @@ throw(RuntimeException) { } string comm::handler::ClientSocket::asString() const -throw() { +{ string result("comm::handler::ClientSocket { "); result += comm::Handler::asString(); result += " | "; @@ -85,7 +85,7 @@ throw() { } xml::Node* comm::handler::ClientSocket::asXML(xml::Node* parent) const -throw() { +{ xml::Node* result = parent->createChild("comm.handler.ClientSocket"); comm::Handler::asAttribute(result); diff --git a/source/comm/handler/DatagramSocket.cpp b/source/comm/handler/DatagramSocket.cpp index 884024e..abc4d5f 100644 --- a/source/comm/handler/DatagramSocket.cpp +++ b/source/comm/handler/DatagramSocket.cpp @@ -25,7 +25,7 @@ using namespace std; using namespace anna; void comm::handler::DatagramSocket::initialize() -throw(RuntimeException) { +noexcept(false) { if(a_datagramSocket == NULL) { string msg(asString()); msg += " | comm::DatagramSocket was not established"; @@ -39,12 +39,12 @@ throw(RuntimeException) { } comm::ClientSocket* comm::handler::DatagramSocket::getClientSocket() -throw() { +{ return a_datagramSocket; } void comm::handler::DatagramSocket::apply() -throw(RuntimeException) { +noexcept(false) { Guard guard(a_datagramSocket, "anna::comm::DatagramSocket from anna::comm::handler::DatagramSocket::apply"); comm::DatagramSocket::Notify::_v notify = a_datagramSocket->receive(); @@ -88,7 +88,7 @@ throw(RuntimeException) { * [Tx] -> Communicator */ void comm::handler::DatagramSocket::finalize() -throw() { +{ if(a_datagramSocket == NULL) return; @@ -97,7 +97,7 @@ throw() { } string comm::handler::DatagramSocket::asString() const -throw() { +{ string result("comm::handler::DatagramSocket { "); result += comm::Handler::asString(); result += " | "; @@ -106,7 +106,7 @@ throw() { } xml::Node* comm::handler::DatagramSocket::asXML(xml::Node* parent) const -throw() { +{ xml::Node* result = parent->createChild("comm.handler.DatagramSocket"); comm::Handler::asAttribute(result); diff --git a/source/comm/handler/LocalConnection.cpp b/source/comm/handler/LocalConnection.cpp index d9f49a4..e1c855f 100644 --- a/source/comm/handler/LocalConnection.cpp +++ b/source/comm/handler/LocalConnection.cpp @@ -28,7 +28,7 @@ using namespace std; using namespace anna; void comm::handler::LocalConnection::initialize() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod traceMethod("comm::handler::LocationConnection", "initialize", ANNA_FILE_LOCATION)); if(a_localConnection == NULL) { @@ -48,7 +48,7 @@ throw(RuntimeException) { } comm::ClientSocket* comm::handler::LocalConnection::getClientSocket() -throw() { +{ return (a_localConnection != NULL) ? a_localConnection->getClientSocket() : NULL; } @@ -69,7 +69,7 @@ throw() { */ void comm::handler::LocalConnection::finalize() -throw() { +{ LOGMETHOD(TraceMethod traceMethod("comm::handler::LocationConnection", "finalize", ANNA_FILE_LOCATION)); if(a_localConnection == NULL) @@ -125,7 +125,7 @@ throw() { } string comm::handler::LocalConnection::asString() const -throw() { +{ string result("comm::handler::LocalConnection { "); result += comm::Handler::asString(); result += " | "; @@ -134,7 +134,7 @@ throw() { } xml::Node* comm::handler::LocalConnection::asXML(xml::Node* parent) const -throw() { +{ xml::Node* result = parent->createChild("comm.handler.LocalConnection"); comm::Handler::asAttribute(result); diff --git a/source/comm/handler/Manager.cpp b/source/comm/handler/Manager.cpp index 2988587..99ded88 100644 --- a/source/comm/handler/Manager.cpp +++ b/source/comm/handler/Manager.cpp @@ -21,7 +21,7 @@ template <> comm::Communicator* handler::Manager::DatagramSocketAllocator::st_co template <> comm::Communicator* handler::Manager::ClientSocketAllocator::st_communicator = NULL; void handler::Manager::initialize(Communicator* communicator) -throw() { +{ BinderSocketAllocator::st_communicator = communicator; ServerSocketAllocator::st_communicator = communicator; LocalConnectionAllocator::st_communicator = communicator; @@ -31,49 +31,49 @@ throw() { } Handler* handler::Manager::createHandler(comm::BinderSocket* binderSocket) -throw(RuntimeException) { +noexcept(false) { handler::BinderSocket* result = a_binderSockets.create(); result->setup(binderSocket); return result; } Handler* handler::Manager::createHandler(comm::ServerSocket* serverSocket) -throw(RuntimeException) { +noexcept(false) { handler::ServerSocket* result = a_serverSockets.create(); result->setup(serverSocket); return result; } Handler* handler::Manager::createHandler(comm::LocalConnection* localConnection) -throw(RuntimeException) { +noexcept(false) { handler::LocalConnection* result = a_localConnections.create(); result->setup(localConnection); return result; } Handler* handler::Manager::createHandler(comm::RemoteConnection* remoteConnection) -throw(RuntimeException) { +noexcept(false) { handler::RemoteConnection* result = a_remoteConnections.create(); result->setup(remoteConnection); return result; } Handler* handler::Manager::createHandler(comm::DatagramSocket* datagramSocket) -throw(RuntimeException) { +noexcept(false) { handler::DatagramSocket* result = a_datagramSockets.create(); result->setup(datagramSocket); return result; } Handler* handler::Manager::createHandler(comm::ClientSocket* clientSocket) -throw(RuntimeException) { +noexcept(false) { handler::ClientSocket* result = a_clientSockets.create(); result->setup(clientSocket); return result; } void handler::Manager::releaseHandler(Handler* handler) -throw() { +{ if(handler == NULL) return; diff --git a/source/comm/handler/MetaClientSocket.cpp b/source/comm/handler/MetaClientSocket.cpp index 2dd354d..dff6a57 100644 --- a/source/comm/handler/MetaClientSocket.cpp +++ b/source/comm/handler/MetaClientSocket.cpp @@ -24,7 +24,7 @@ using namespace anna; * Este método se ejecuta desde un único thread (Tx). Cada socket tiene asociado un thread que lo trata. */ void comm::handler::MetaClientSocket::apply() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tm(Logger::Local7, "comm::handler::MetaClientSocket", "apply", ANNA_FILE_LOCATION)); comm::ClientSocket* clientSocket = getClientSocket(); @@ -125,7 +125,7 @@ throw(RuntimeException) { //virtual bool comm::handler::MetaClientSocket::testClose() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tm(Logger::Local7, "comm::handler::MetaClientSocket", "testClose", ANNA_FILE_LOCATION)); comm::ClientSocket* clientSocket = getClientSocket(); @@ -159,7 +159,7 @@ throw(RuntimeException) { * Por lo que se puede invocar desde cualquier otro thread no reconocido. */ void comm::handler::MetaClientSocket::breakAddress(const in_addr_t& address) -throw() { +{ comm::ClientSocket* clientSocket = getClientSocket(); if(clientSocket == NULL) { diff --git a/source/comm/handler/RemoteConnection.cpp b/source/comm/handler/RemoteConnection.cpp index bb9b604..46107e6 100644 --- a/source/comm/handler/RemoteConnection.cpp +++ b/source/comm/handler/RemoteConnection.cpp @@ -56,7 +56,7 @@ using namespace anna; */ void comm::handler::RemoteConnection::initialize() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod traceMethod("comm::handler::RemoteConnection", "initialize", ANNA_FILE_LOCATION)); if(a_remoteConnection == NULL) { @@ -94,7 +94,7 @@ throw(RuntimeException) { } comm::ClientSocket* comm::handler::RemoteConnection::getClientSocket() -throw() { +{ return (a_remoteConnection != NULL) ? a_remoteConnection->getClientSocket() : NULL; } @@ -130,7 +130,7 @@ throw() { * */ void comm::handler::RemoteConnection::finalize() -throw() { +{ if(a_remoteConnection == NULL) return; @@ -167,7 +167,7 @@ throw() { * Se invoca en ST */ void comm::handler::RemoteConnection::clone() -throw(RuntimeException) { +noexcept(false) { comm::ClientSocket& clientSocket = *a_remoteConnection->getClientSocket(); try { @@ -183,7 +183,7 @@ throw(RuntimeException) { } string comm::handler::RemoteConnection::asString() const -throw() { +{ string result("comm::handler::RemoteConnection { "); result += comm::Handler::asString(); result += " | "; @@ -192,7 +192,7 @@ throw() { } xml::Node* comm::handler::RemoteConnection::asXML(xml::Node* parent) const -throw() { +{ xml::Node* result = parent->createChild("comm.handler.RemoteConnection"); comm::Handler::asAttribute(result); diff --git a/source/comm/handler/ServerSocket.cpp b/source/comm/handler/ServerSocket.cpp index 6ffa786..6fa829d 100644 --- a/source/comm/handler/ServerSocket.cpp +++ b/source/comm/handler/ServerSocket.cpp @@ -26,7 +26,7 @@ using namespace std; using namespace anna; void comm::handler::ServerSocket::initialize() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod traceMethod("comm::handler::ServerSocket", "initialize", ANNA_FILE_LOCATION)); if(a_serverSocket == NULL) { @@ -69,7 +69,7 @@ throw(RuntimeException) { // para eso bloqueamos el comm::Communicator. */ void comm::handler::ServerSocket::apply() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod traceMethod("handler::ServerSocket", "apply", ANNA_FILE_LOCATION)); Guard guard(a_communicator, "Communicator from handler::ServerSocket"); comm::LocalConnection* localConnection = a_serverSocket->accept(); @@ -108,7 +108,7 @@ throw(RuntimeException) { // que tengan establecidos contra este ServerSocket. //-------------------------------------------------------------------------- void comm::handler::ServerSocket::breakAddress(const in_addr_t& address) -throw() { +{ LOGMETHOD(TraceMethod traceMethod("comm::handler::ServerSocket", "breakAddress", ANNA_FILE_LOCATION)); const comm::AccessPoint& accessPoint = a_serverSocket->getLocalAccessPoint(); const comm::Device* device = accessPoint.getINetAddress().getDevice(false); @@ -151,7 +151,7 @@ throw() { * MainHandler cuando se use el Communicator::Clone. */ void comm::handler::ServerSocket::finalize() -throw() { +{ LOGMETHOD(TraceMethod traceMethod("comm::handler::ServerSocket", "finalize", ANNA_FILE_LOCATION)); if(a_serverSocket == NULL) @@ -165,7 +165,7 @@ throw() { } string comm::handler::ServerSocket::asString() const -throw() { +{ string result("comm::handler::ServerSocket { "); result += comm::Handler::asString(); result += " | "; @@ -174,7 +174,7 @@ throw() { } xml::Node* comm::handler::ServerSocket::asXML(xml::Node* parent) const -throw() { +{ xml::Node* result = parent->createChild("comm.handler.ServerSocket"); comm::Handler::asAttribute(result); diff --git a/source/comm/internal/BinderSocket.cpp b/source/comm/internal/BinderSocket.cpp index 6768fab..6a54422 100644 --- a/source/comm/internal/BinderSocket.cpp +++ b/source/comm/internal/BinderSocket.cpp @@ -61,7 +61,7 @@ comm::BinderSocket::BinderSocket(comm::ServerSocket* serverSocket) : // Visto en: http://mail-index.netbsd.org/current-users/1998/01/16/0010.html //------------------------------------------------------------------------------------------------- void comm::BinderSocket::requestBind(const struct sockaddr* s, const int len) -throw(RuntimeException) { +noexcept(false) { if(::bind(a_serverSocket.a_fd, s, len) != -1) { // (1) unlink(getRemoteAccessPoint().getPath().c_str()); this->bind(); @@ -92,7 +92,7 @@ throw(RuntimeException) { // (4) Cierra la nueva conexion ya que no vamos a volver a usarla para nada. //------------------------------------------------------------------------------------------------- void comm::BinderSocket::responseBind() -throw(RuntimeException) { +noexcept(false) { struct iovec iov; struct msghdr mh; int fds [2]; @@ -146,7 +146,7 @@ throw(RuntimeException) { } void comm::BinderSocket::waitBind(const Millisecond &maxDelay) -throw(RuntimeException) { +noexcept(false) { struct msghdr mh; struct iovec iov; const int garbage(0); diff --git a/source/comm/internal/ConnectionRecover.cpp b/source/comm/internal/ConnectionRecover.cpp index 9f25781..a56931a 100644 --- a/source/comm/internal/ConnectionRecover.cpp +++ b/source/comm/internal/ConnectionRecover.cpp @@ -25,7 +25,7 @@ using namespace anna; * Se invoca desde el handler::RemoteConnection::finalize y debe estar protegido por la SSCC del Communicator */ void comm::ConnectionRecover::annotateFault(comm::Server* server) -throw() { +{ if(server->autoRecovery() == false) return; @@ -49,7 +49,7 @@ throw() { * Se invoca desde el Communicator y en MT debe estar protegido por la SSCC del Communicator */ void comm::ConnectionRecover::tryRecover() -throw() { +{ LOGMETHOD(TraceMethod traceMethod(Logger::Local7, "comm::ConnectionRecover", "tryRecover", ANNA_FILE_LOCATION)); Millisecond now(functions::millisecond()); @@ -98,14 +98,14 @@ throw() { /* bool comm::ConnectionRecover::contains (comm::Server* server) const - throw () + { Guard guard (a_mutex, "comm::ConnectionRecover::contains"); return std::find (a_breaks.begin (), a_breaks.end (), server) != a_breaks.end (); } void comm::ConnectionRecover::erase (comm::Server* server) - throw () + { Guard guard (a_mutex, "comm::ConnectionRecover::erase"); @@ -123,7 +123,7 @@ void comm::ConnectionRecover::erase (comm::Server* server) */ xml::Node* comm::ConnectionRecover::asXML(xml::Node* parent) const -throw(RuntimeException) { +noexcept(false) { xml::Node* connectionRecover = parent->createChild("comm.ConnectionRecover"); connectionRecover->createAttribute("Active", functions::asString(a_isRunning)); diff --git a/source/comm/internal/LocalConnection.cpp b/source/comm/internal/LocalConnection.cpp index cf08a8a..4cf8202 100644 --- a/source/comm/internal/LocalConnection.cpp +++ b/source/comm/internal/LocalConnection.cpp @@ -19,7 +19,7 @@ using namespace std; using namespace anna; string comm::LocalConnection::asString() const -throw() { +{ string result("comm::LocalConnection { "); result += anna::functions::asString(a_clientSocket); return result += " }"; @@ -27,7 +27,7 @@ throw() { // No saca la informacion del ServerSocket por que se invoca desde su asXML. xml::Node* comm::LocalConnection::asXML(xml::Node* parent) const -throw(RuntimeException) { +noexcept(false) { xml::Node* result = parent->createChild("comm.LocalConnection"); if(a_clientSocket != NULL) diff --git a/source/comm/internal/Poll.cpp b/source/comm/internal/Poll.cpp index 38b0b78..a9aa019 100644 --- a/source/comm/internal/Poll.cpp +++ b/source/comm/internal/Poll.cpp @@ -16,7 +16,7 @@ using namespace anna; void comm::Poll::setTimeout(const Millisecond &timeout) -throw() { +{ if((a_timeout.tv_sec = timeout / 1000) == 0) a_timeout.tv_usec = timeout * 1000; else @@ -32,7 +32,7 @@ throw() { // Para las dos implementacion el NULL => espera hasta que llegue un mensaje. //-------------------------------------------------------------------------------------------- void comm::Poll::waitMessage() -throw(RuntimeException) { +noexcept(false) { if(a_ptrTimeout == NULL) a_pollr = select(a_maxfd, (fd_set*) anna_memcpy(&a_fdset, &a_fdmask, sizeof(fd_set)), NULL); else { @@ -54,7 +54,7 @@ throw(RuntimeException) { // (1) Una vez que ha tratado detectado la activada desactiva el indicador //----------------------------------------------------------------------------------------- int comm::Poll::fetch() -throw() { +{ int result = -1; while(a_pollr > 0) { @@ -77,7 +77,7 @@ throw() { } void comm::Poll::insert(const int fd) -throw() { +{ FD_SET(fd, &a_fdmask); if(a_maxfd < fd) a_maxfd = fd; @@ -91,7 +91,7 @@ throw() { // de pendientes de tratar. //--------------------------------------------------------------------------------------- void comm::Poll::erase(const int fd) -throw() { +{ FD_CLR(fd, &a_fdmask); if(FD_ISSET(fd, &a_fdset) && a_pollr > 0) { // (1) diff --git a/source/comm/internal/RemoteConnection.cpp b/source/comm/internal/RemoteConnection.cpp index 795969c..308e7e0 100644 --- a/source/comm/internal/RemoteConnection.cpp +++ b/source/comm/internal/RemoteConnection.cpp @@ -17,14 +17,14 @@ using namespace std; using namespace anna; string comm::RemoteConnection::asString() const -throw() { +{ string result("comm::RemoteConnection { "); result += anna::functions::asString(a_clientSocket); return result += " }"; } xml::Node* comm::RemoteConnection::asXML(xml::Node* parent) const -throw(RuntimeException) { +noexcept(false) { xml::Node* result = parent->createChild("comm.RemoteConnection"); if(a_clientSocket != NULL) diff --git a/source/comm/internal/sccs.cpp b/source/comm/internal/sccs.cpp index 9fc9c23..7d39b37 100644 --- a/source/comm/internal/sccs.cpp +++ b/source/comm/internal/sccs.cpp @@ -16,7 +16,7 @@ anna_define_sccs_tag(comm, 28); void anna::comm::sccs::activate() -throw() { +{ anna::sccs::activate(); app::sccs::activate(); xml::sccs::activate(); diff --git a/source/comm/transport/DirectTransport.cpp b/source/comm/transport/DirectTransport.cpp index a4e4fdf..53ea326 100644 --- a/source/comm/transport/DirectTransport.cpp +++ b/source/comm/transport/DirectTransport.cpp @@ -30,12 +30,12 @@ comm::DirectTransport::~DirectTransport() { // (1) Transfiere la referencia de message al cuerpo del mensaje. Ojo!! tampoco hace copia. //------------------------------------------------------------------------------------------- const comm::Message* comm::DirectTransport::decode(const DataBlock& data) -throw(RuntimeException) { +noexcept(false) { return getInputMessage()->setBody(data); } const DataBlock& comm::DirectTransport::code(comm::Message& message) -throw(RuntimeException) { +noexcept(false) { return a_forCode = message.code(); } diff --git a/source/comm/transport/LiteTransport.cpp b/source/comm/transport/LiteTransport.cpp index 9df4092..0f39c0b 100644 --- a/source/comm/transport/LiteTransport.cpp +++ b/source/comm/transport/LiteTransport.cpp @@ -26,13 +26,13 @@ comm::LiteTransport::~LiteTransport() { } int comm::LiteTransport::calculeSize(const DataBlock& dataBlock) -throw(RuntimeException) { +noexcept(false) { const char* buffer = dataBlock.getData(); return (dataBlock.getSize() >= headerSize) ? functions::decodeShort(buffer) + headerSize : -1; } const comm::Message* comm::LiteTransport::decode(const DataBlock& message) -throw(RuntimeException) { +noexcept(false) { const int totalSize = message.getSize(); if(totalSize < headerSize) @@ -48,7 +48,7 @@ throw(RuntimeException) { } const DataBlock& comm::LiteTransport::code(comm::Message& message) -throw(RuntimeException) { +noexcept(false) { char aux [sizeof(int)]; const DataBlock& data = message.code(); a_forCode.clear(); diff --git a/source/comm/transport/SureTransport.cpp b/source/comm/transport/SureTransport.cpp index 2317325..1111740 100644 --- a/source/comm/transport/SureTransport.cpp +++ b/source/comm/transport/SureTransport.cpp @@ -30,7 +30,7 @@ comm::SureTransport::~SureTransport() { } int comm::SureTransport::calculeSize(const DataBlock& dataBlock) -throw(RuntimeException) { +noexcept(false) { const char* buffer = dataBlock.getData(); int result = -1; @@ -49,7 +49,7 @@ throw(RuntimeException) { // (1) Transfiere la referencia de message al cuerpo del mensaje. Ojo!! tampoco hace copia. //------------------------------------------------------------------------------------------- const comm::Message* comm::SureTransport::decode(const DataBlock& message) -throw(RuntimeException) { +noexcept(false) { const int totalSize = message.getSize(); if(totalSize < headerSize) @@ -73,7 +73,7 @@ throw(RuntimeException) { // Etiquta de comienzo 0xaaaa + short () + datos //--------------------------------------------------------------------------- const DataBlock& comm::SureTransport::code(comm::Message& message) -throw(RuntimeException) { +noexcept(false) { char aux [sizeof(int)]; const DataBlock& data = message.code(); a_forCode = a_precodec; diff --git a/source/comm/transport/Transport.cpp b/source/comm/transport/Transport.cpp index 84c823c..4ecf41a 100644 --- a/source/comm/transport/Transport.cpp +++ b/source/comm/transport/Transport.cpp @@ -17,7 +17,7 @@ using namespace anna; const int comm::Transport::MinOverQuotaSize; comm::Message* comm::Transport::nullInputMessage() -throw(RuntimeException) { +noexcept(false) { throw RuntimeException( "anna::comm::Transport::getInputMessage | No incoming message available", ANNA_FILE_LOCATION diff --git a/source/comm/transport/TransportFactory.cpp b/source/comm/transport/TransportFactory.cpp index cccf5c9..55a4440 100644 --- a/source/comm/transport/TransportFactory.cpp +++ b/source/comm/transport/TransportFactory.cpp @@ -15,7 +15,7 @@ using namespace std; using namespace anna; string comm::TransportFactory::asString() const -throw() { +{ std::string msg("comm::TransportFactory { Name: "); msg += a_name; msg += functions::asText(" | OverQuotaSize: ", a_overQuotaSize); @@ -23,7 +23,7 @@ throw() { } xml::Node* comm::TransportFactory::asXML(xml::Node* parent) const -throw() { +{ xml::Node* result = parent->createChild("comm.TransportFactory"); result->createAttribute("Name", a_name); result->createAttribute("OverQuotaSize", a_overQuotaSize); diff --git a/source/config/Release.cpp b/source/config/Release.cpp index 780d029..8bbbc87 100644 --- a/source/config/Release.cpp +++ b/source/config/Release.cpp @@ -15,7 +15,7 @@ using namespace std; using namespace anna; -string config::Release::getVersion() throw() { +string config::Release::getVersion() { static const int version = ANNA_VERSION; string result; int mainVersion = (version & 0xff0000) >> 16; @@ -28,7 +28,7 @@ string config::Release::getVersion() throw() { } // (1) It only will use the main OS version -string config::Release::getArchitecture() throw() { +string config::Release::getArchitecture() { string result; #ifdef _MT result = "/MT"; diff --git a/source/core/AutoPointer.cpp b/source/core/AutoPointer.cpp index d0b46d1..ed981a8 100644 --- a/source/core/AutoPointer.cpp +++ b/source/core/AutoPointer.cpp @@ -13,7 +13,7 @@ using namespace anna; //virtual String AutoPointer::asString() const -throw() { +{ String result("AutoPointer { WhenFinished: "); result += (a_whenFinished == WhenFinished::Ignore) ? "Ignore" : "Delete"; return result += " }"; diff --git a/source/core/DataBlock.cpp b/source/core/DataBlock.cpp index 38700a2..4d69d59 100644 --- a/source/core/DataBlock.cpp +++ b/source/core/DataBlock.cpp @@ -20,7 +20,7 @@ using namespace anna; if ((a_size + (a)) >= a_maxSize) extend ((a)); DataBlock::DataBlock(const char* buffer, const int size, const bool deepCopy) -throw(RuntimeException) : +noexcept(false) : a_buffer(NULL), a_size(0), a_deepCopy(deepCopy), @@ -29,7 +29,7 @@ throw(RuntimeException) : } DataBlock::DataBlock(const DataBlock& other) -throw(RuntimeException) : +noexcept(false) : a_buffer(NULL), a_size(0), a_deepCopy(other.a_deepCopy), @@ -43,7 +43,7 @@ DataBlock::~DataBlock() { } void DataBlock::initialize(const char* buffer, const int size) -throw(RuntimeException) { +noexcept(false) { if(a_deepCopy == false) { a_buffer = const_cast (buffer); a_size = size; @@ -59,7 +59,7 @@ throw(RuntimeException) { } void DataBlock::setSize(const int size) -throw(RuntimeException) { +noexcept(false) { // if (size > a_maxSize) { // string msg ("DataBlock::setSize | MaxSize: "); // msg += functions::asString (a_maxSize); @@ -79,7 +79,7 @@ throw(RuntimeException) { } void DataBlock::allocate(const int nbytes) -throw(RuntimeException) { +noexcept(false) { if(nbytes > a_size) { if(a_maxSize == 0) { if(a_deepCopy == false) @@ -95,7 +95,7 @@ throw(RuntimeException) { } void DataBlock::assign(const char* buffer, const int size) -throw(RuntimeException) { +noexcept(false) { if(a_deepCopy == false) { a_buffer = const_cast (buffer); a_size = size; @@ -107,7 +107,7 @@ throw(RuntimeException) { } DataBlock& DataBlock::operator = (const DataBlock & right) -throw(RuntimeException) { +noexcept(false) { if(this != &right) { if(a_deepCopy) { a_size = 0; @@ -122,7 +122,7 @@ throw(RuntimeException) { } const char DataBlock::operator [](const int pos) const -throw(RuntimeException) { +noexcept(false) { if(pos >= a_size) { std::string msg("Position: "); msg += functions::asString(pos); @@ -136,7 +136,7 @@ throw(RuntimeException) { } char& DataBlock::operator [](const int pos) -throw(RuntimeException) { +noexcept(false) { if(pos >= a_size) { std::string msg("Position: "); msg += functions::asString(pos); @@ -151,7 +151,7 @@ throw(RuntimeException) { } void DataBlock::append(const char* data, const int len) -throw(RuntimeException) { +noexcept(false) { if(a_buffer == data && data != NULL && len > 0) throw RuntimeException("Can not append myself", ANNA_FILE_LOCATION); @@ -170,7 +170,7 @@ throw(RuntimeException) { } void DataBlock::remove(const int pos, const int nbytes) -throw(RuntimeException) { +noexcept(false) { if(a_deepCopy == false) throw RuntimeException("Deep copy not activated", ANNA_FILE_LOCATION); @@ -189,7 +189,7 @@ throw(RuntimeException) { } void DataBlock::remove(const int nbytes) -throw(RuntimeException) { +noexcept(false) { if(a_deepCopy == false) throw RuntimeException("Deep copy not activated", ANNA_FILE_LOCATION); @@ -208,7 +208,7 @@ throw(RuntimeException) { } void DataBlock::extend(const int nbytes) -throw(RuntimeException) { +noexcept(false) { if(a_deepCopy == false) throw RuntimeException("Deep copy not activated", ANNA_FILE_LOCATION); @@ -230,7 +230,7 @@ throw(RuntimeException) { } std::string DataBlock::asString(const int characterByLine) const -throw() { +{ char aux [16]; std::string numbers; std::string characters; diff --git a/source/core/Exception.cpp b/source/core/Exception.cpp index 3bb7ad0..d057e2c 100644 --- a/source/core/Exception.cpp +++ b/source/core/Exception.cpp @@ -41,7 +41,7 @@ Exception::Exception(const Exception& other) { // Operador copia //----------------------------------------------------------------------- Exception& Exception::operator = (const Exception & other) -throw() { +{ if(this != &other) { m_name = other.m_name; m_text = other.m_text; @@ -54,7 +54,7 @@ throw() { } std::string Exception::asString() const -throw() { +{ std::string result; char n [32]; sprintf(n, " (%d) ] ", m_fromLine); @@ -68,6 +68,6 @@ throw() { } void Exception::trace() const -throw() { +{ Logger::write(Logger::Error, m_name.c_str(), m_text.c_str(), m_fromFile.c_str(), m_fromLine); // JEDS 24/09/2003 } diff --git a/source/core/functions.cpp b/source/core/functions.cpp index 8752a2e..379c5a6 100644 --- a/source/core/functions.cpp +++ b/source/core/functions.cpp @@ -45,7 +45,7 @@ static const std::string base64_chars = "0123456789+/"; -string functions::getVersion() throw() { +string functions::getVersion() { static const int version = ANNA_VERSION; string result; int mainVersion = (version & 0xff00) >> 8; @@ -59,7 +59,7 @@ string functions::getVersion() throw() { /* (1) Solo coge los dos primeros digitos del numero de release */ -string functions::getArchitecture() throw() { +string functions::getArchitecture() { string result; WHEN_MULTITHREAD(result = "/MT"); WHEN_SINGLETHREAD(result = "/ST"); @@ -90,14 +90,14 @@ string functions::getArchitecture() throw() { } string functions::asString(const int number) -throw() { +{ char aux [16]; sprintf(aux, "%d", number); return string(aux); } string functions::asString(const S64 number) -throw() { +{ char aux [24]; //sprintf(aux, "%lld", number); #ifdef __anna64__ @@ -109,14 +109,14 @@ throw() { } string functions::asString(const unsigned int number) -throw() { +{ char aux [16]; sprintf(aux, "%u", number); return string(aux); } string functions::asString(const U64 number) -throw() { +{ char aux [16]; //sprintf(aux, "%llu", number); #ifdef __anna64__ @@ -128,27 +128,27 @@ throw() { } string functions::asString(const float number, const char* format) -throw() { +{ char aux [64]; sprintf(aux, format, number); return string(aux); } string functions::asString(const double number, const char* format) -throw() { +{ char aux [64]; sprintf(aux, format, number); return string(aux); } string functions::asDateTime(const Second &second) -throw() { +{ char aux [DateTimeSizeString]; return std::string(asDateTime(second, aux)); } const char* functions::asDateTime(const Second &second, char* result) -throw() { +{ struct tm* tt = localtime((time_t*) & second); sprintf( result, "%02u/%02u/%4u %02u:%02u:%02u", @@ -159,19 +159,19 @@ throw() { } std::string functions::asString(const DataBlock& dataBlock, const int characterByLine) -throw() { +{ return dataBlock.asString(characterByLine); } string functions::asHexString(const int number) -throw() { +{ char aux [16]; sprintf(aux, "0x%x", number); return string(aux); } string functions::asHexString(const S64 number) -throw() { +{ char aux [32]; //sprintf(aux, "0x%llx", number); #ifdef __anna64__ @@ -185,7 +185,7 @@ throw() { // from a version by Allen Holub (see Andrew Binstock, "Hashing Revisited" // Dr. Dobb's Journal, April 1996) S64 functions::hash(const char* p) -throw() { +{ static const int long_bits = sizeof(S64) << 3; static const int one_eighth = long_bits >> 3; static const int three_fourths = long_bits * 3 / 4; @@ -205,7 +205,7 @@ throw() { //static std::string functions::asHexString(const DataBlock& dataBlock) -throw() { +{ const char* buffer = dataBlock.getData(); const int size = dataBlock.getSize(); string result; @@ -230,7 +230,7 @@ throw() { */ //static DataBlock& functions::fromHexString(const std::string& hexString, DataBlock& target) -throw(RuntimeException) { +noexcept(false) { if((hexString.length() % 2) != 0) throw RuntimeException("functions::fromHexString | Invalid string length", ANNA_FILE_LOCATION); @@ -257,7 +257,7 @@ throw(RuntimeException) { } string functions::asString(const char* format, ...) -throw() { +{ va_list ap; char aux [1024]; va_start(ap, format); @@ -267,7 +267,7 @@ throw() { } void functions::sleep(const Millisecond &millisecond) -throw() { +{ timespec req; timespec rem; req.tv_sec = millisecond.getValue() / 1000; // segundos @@ -290,7 +290,7 @@ throw() { } bool functions::asBool(const char* str) -throw(RuntimeException) { +noexcept(false) { if(str == NULL) return false; @@ -307,7 +307,7 @@ throw(RuntimeException) { } S64 functions::asInteger64(const char* str) -throw() { +{ S64 number = 0; //sscanf(str, "%lld", &number); #ifdef __anna64__ @@ -319,13 +319,13 @@ throw() { } pthread_t functions::getCurrentThread() -throw() { +{ WHEN_MULTITHREAD(return pthread_self()); WHEN_SINGLETHREAD(return 0); } bool functions::isLike(const char* pattern, const std::string& _value) -throw(RuntimeException) { +noexcept(false) { const char* value = _value.c_str(); regex_t preg; int ret; @@ -355,7 +355,7 @@ throw(RuntimeException) { /*static*/ S64 functions::merge(const char* whatis, const int n1, const int n2, const int bitShift) -throw(RuntimeException) { +noexcept(false) { if(bitShift > intBitSize) { string msg(functions::asString("%s | N1: 0x%x | N2: 0x%x | bitShift: %d | bitShift must be less than %d", whatis, n1, n2, bitShift, intBitSize)); throw RuntimeException(msg, ANNA_FILE_LOCATION); @@ -391,7 +391,7 @@ throw(RuntimeException) { * Basado en el algoritmo de http://www-graphics.stanford.edu/~seander/bithacks.html#IntegerLogLookup */ int functions::log2(const unsigned int v) -throw() { +{ static const signed char LogTable256[] = { -1, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, @@ -422,7 +422,7 @@ throw() { return r; } -std::string functions::entriesAsString(int number, const char * wordForSingular, const char * wordForPlural) throw() { +std::string functions::entriesAsString(int number, const char * wordForSingular, const char * wordForPlural) { std::string result; std::string singular = (wordForSingular ? wordForSingular : "entry"); std::string plural = (wordForPlural ? wordForPlural : "entries"); @@ -437,7 +437,7 @@ std::string functions::entriesAsString(int number, const char * wordForSingular, } -std::string functions::justify(const std::string & title, TextJustifyMode::_v mode, char filler) throw() { +std::string functions::justify(const std::string & title, TextJustifyMode::_v mode, char filler) { std::string result; int d_size = title.size(); int repeat = PAGE_WIDTH_LENGTH - d_size - 1; @@ -466,7 +466,7 @@ std::string functions::justify(const std::string & title, TextJustifyMode::_v mo } -std::string functions::highlight(const std::string & title, TextHighlightMode::_v mode, char filler, bool appendCR) throw() { +std::string functions::highlight(const std::string & title, TextHighlightMode::_v mode, char filler, bool appendCR) { std::string result; int ou_repeat = title.size(); int lr_repeat = PAGE_WIDTH_LENGTH - ou_repeat - 1; @@ -509,7 +509,7 @@ std::string functions::highlight(const std::string & title, TextHighlightMode::_ } -std::string functions::tab(const std::string & text, int tabSpaces) throw() { +std::string functions::tab(const std::string & text, int tabSpaces) { std::string result; size_t pos, from = 0; std::string tab, crTab = "\n"; @@ -529,7 +529,7 @@ std::string functions::tab(const std::string & text, int tabSpaces) throw() { } -bool functions::endsWith(const std::string & pattern, const std::string & suffix, std::string & preffix) throw() { +bool functions::endsWith(const std::string & pattern, const std::string & suffix, std::string & preffix) { preffix = ""; if(pattern.size() < suffix.size()) return false; @@ -543,7 +543,7 @@ bool functions::endsWith(const std::string & pattern, const std::string & suffix } -bool functions::startsWith(const std::string & pattern, const std::string & preffix, std::string & suffix) throw() { +bool functions::startsWith(const std::string & pattern, const std::string & preffix, std::string & suffix) { suffix = ""; if(pattern.size() < preffix.size()) return false; @@ -555,7 +555,7 @@ bool functions::startsWith(const std::string & pattern, const std::string & pref } -std::string functions::replace(const std::string & text, const char *item, const char *target, bool all) throw() { +std::string functions::replace(const std::string & text, const char *item, const char *target, bool all) { std::string result = text; if(!item || !target) return result; // protection for NULL strings provided @@ -575,7 +575,7 @@ std::string functions::replace(const std::string & text, const char *item, const } -std::string functions::addQuotationMarks(const std::string & str) throw() { +std::string functions::addQuotationMarks(const std::string & str) { std::string result = "'"; result += str; result += "'"; @@ -583,7 +583,7 @@ std::string functions::addQuotationMarks(const std::string & str) throw() { } -std::string functions::addQuotationMarks(const char * str) throw() { +std::string functions::addQuotationMarks(const char * str) { std::string result = "'"; result += (str ? str : ""); result += "'"; @@ -591,7 +591,7 @@ std::string functions::addQuotationMarks(const char * str) throw() { } -std::string functions::addQuotationMarks(const int & integer) throw() { +std::string functions::addQuotationMarks(const int & integer) { std::string result = "'"; result += anna::functions::asString(integer); result += "'"; @@ -599,7 +599,7 @@ std::string functions::addQuotationMarks(const int & integer) throw() { } -std::string functions::vectorToStringRepresentation(const std::vector & v, const char separator) throw() { +std::string functions::vectorToStringRepresentation(const std::vector & v, const char separator) { std::string result = ""; if(v.size() != 0) { @@ -620,7 +620,7 @@ std::string functions::vectorToStringRepresentation(const std::vector & v, } -std::string functions::vectorToStringRepresentation(const std::vector & v, const char separator) throw() { +std::string functions::vectorToStringRepresentation(const std::vector & v, const char separator) { std::string result = ""; if(v.size() != 0) { @@ -641,7 +641,7 @@ std::string functions::vectorToStringRepresentation(const std::vector> 7) & 0x01); @@ -1430,7 +1430,7 @@ void functions::decodeIsupNumber(const char *buffer, int length, isup_number_t & } -void functions::codeIsupNumber(const isup_number_t & isupNumber, bool calledOrCalling, std::string & target) throw(anna::RuntimeException) { +void functions::codeIsupNumber(const isup_number_t & isupNumber, bool calledOrCalling, std::string & target) noexcept(false) { // Checkings: if(isupNumber.OddEven < 0 || isupNumber.OddEven > 1) throw anna::RuntimeException("functions::codeIsupNumber | Isup number 'OddEven' field out of range [0,1]", ANNA_FILE_LOCATION); @@ -1520,7 +1520,7 @@ void functions::codeIsupNumber(const isup_number_t & isupNumber, bool calledOrCa } -void functions::codeIsupNumber(const isup_number_t & isupNumber, bool calledOrCalling, char * buffer, int & length) throw(anna::RuntimeException) { +void functions::codeIsupNumber(const isup_number_t & isupNumber, bool calledOrCalling, char * buffer, int & length) noexcept(false) { std::string target; codeIsupNumber(isupNumber, calledOrCalling, target); length = target.size(); @@ -1614,7 +1614,7 @@ std::string functions::decodeBase64(const std::string & encodedString) { return ret; } -bool functions::getContentFromFile(const std::string &pathfile, std::string &content) throw(anna::RuntimeException) { +bool functions::getContentFromFile(const std::string &pathfile, std::string &content) noexcept(false) { std::ifstream inFile(pathfile.c_str(), std::ifstream::in); if(!inFile.good()) { diff --git a/source/core/internal/ModuleManager.cpp b/source/core/internal/ModuleManager.cpp index cbb4c5d..94fda25 100644 --- a/source/core/internal/ModuleManager.cpp +++ b/source/core/internal/ModuleManager.cpp @@ -17,7 +17,7 @@ using namespace std; using namespace anna; void ModuleManager::insert(const char* module, const char* revision) -throw() { +{ char* dup = strdup(module + anna_strlen("@(#)")); /* diff --git a/source/core/internal/sccs.cpp b/source/core/internal/sccs.cpp index a2a5224..2c7a4c9 100644 --- a/source/core/internal/sccs.cpp +++ b/source/core/internal/sccs.cpp @@ -13,7 +13,7 @@ anna_define_sccs_tag(core, 12); void anna::sccs::activate() -throw() { +{ ModuleManager::instantiate().insert(anna_use_sccs_tag(core), "00"); } diff --git a/source/core/mt/Guard.cpp b/source/core/mt/Guard.cpp index 259526a..e3c5575 100644 --- a/source/core/mt/Guard.cpp +++ b/source/core/mt/Guard.cpp @@ -29,7 +29,7 @@ using namespace anna; Logger::write (Logger::Local7, msg, (file), (line)); \ } -Guard::Guard(const Safe* object) throw(RuntimeException) : +Guard::Guard(const Safe* object) noexcept(false) : a_whatis(NULL) { if(object == NULL) throw RuntimeException("Can not lock NULL object", ANNA_FILE_LOCATION); @@ -37,7 +37,7 @@ Guard::Guard(const Safe* object) throw(RuntimeException) : lock(a_safeObject = const_cast (object), NULL); } -Guard::Guard(const Safe* object, const char* whatis) throw(RuntimeException) : +Guard::Guard(const Safe* object, const char* whatis) noexcept(false) : a_whatis(whatis) { if(object == NULL) throw RuntimeException("Can not lock NULL object", ANNA_FILE_LOCATION); @@ -46,7 +46,7 @@ Guard::Guard(const Safe* object, const char* whatis) throw(RuntimeException) : } void Guard::deactivate() -throw() { +{ if(a_safeObject == NULL) return; @@ -60,7 +60,7 @@ throw() { // Logger::writer tambien usa una Guard. //-------------------------------------------------------------------------------------------------------------- void Guard::lock(Safe* safe, const char* whatis) -throw(RuntimeException) { +noexcept(false) { trace_local7("Guard::lock", safe, __FILE__, __LINE__); safe->lock(); } diff --git a/source/core/mt/Mutex.cpp b/source/core/mt/Mutex.cpp index 92937e2..6b1b2a6 100644 --- a/source/core/mt/Mutex.cpp +++ b/source/core/mt/Mutex.cpp @@ -36,7 +36,7 @@ Mutex::~Mutex() { } void Mutex::lock() -throw(RuntimeException) { +noexcept(false) { #ifdef _MT int errorCode; @@ -47,7 +47,7 @@ throw(RuntimeException) { } void Mutex::unlock() -throw() { +{ #ifdef _MT int errorCode; @@ -62,7 +62,7 @@ throw() { } bool Mutex::trylock() -throw(RuntimeException) { +noexcept(false) { #ifdef _MT int errorCode; diff --git a/source/core/mt/Resource.cpp b/source/core/mt/Resource.cpp index e17b381..66f294a 100644 --- a/source/core/mt/Resource.cpp +++ b/source/core/mt/Resource.cpp @@ -14,7 +14,7 @@ using namespace std; using namespace anna; string Resource::asString() const -throw() { +{ string result("anna::Resource { Name: "); result += a_name; result += functions::asText(" | Enabled: ", a_isEnabled); diff --git a/source/core/mt/Runnable.cpp b/source/core/mt/Runnable.cpp index 582c264..1570dbd 100644 --- a/source/core/mt/Runnable.cpp +++ b/source/core/mt/Runnable.cpp @@ -13,13 +13,13 @@ using namespace std; using namespace anna; void Runnable::requestStop() -throw(RuntimeException) { +noexcept(false) { if(a_isRunning == true) a_requestedStop = true; } void Runnable::run() -throw(RuntimeException) { +noexcept(false) { a_requestedStop = false; while(hasRequestedStop() == false) { diff --git a/source/core/mt/Semaphore.cpp b/source/core/mt/Semaphore.cpp index 9898e86..ea36049 100644 --- a/source/core/mt/Semaphore.cpp +++ b/source/core/mt/Semaphore.cpp @@ -29,7 +29,7 @@ Semaphore::~Semaphore() { } void Semaphore::wait() -throw(RuntimeException) { +noexcept(false) { #ifdef _MT int errorCode; anna_signal_shield(errorCode, sem_wait(&a_id)); @@ -41,7 +41,7 @@ throw(RuntimeException) { } bool Semaphore::tryWait() -throw(RuntimeException) { +noexcept(false) { bool result(true); #ifdef _MT int errorCode; @@ -58,7 +58,7 @@ throw(RuntimeException) { } void Semaphore::signal() -throw(RuntimeException) { +noexcept(false) { #ifdef _MT int errorCode = sem_post(&a_id); @@ -69,7 +69,7 @@ throw(RuntimeException) { } std::string Semaphore::asString() const -throw() { +{ std::string msg("anna::Semaphone { Id: "); msg += functions::asHexString(anna_ptrnumber_cast(&a_id)); msg += " | Value: "; diff --git a/source/core/mt/Thread.cpp b/source/core/mt/Thread.cpp index 44e93e9..b5558f6 100644 --- a/source/core/mt/Thread.cpp +++ b/source/core/mt/Thread.cpp @@ -37,7 +37,7 @@ Thread::~Thread() { } void Thread::start(Runnable& runnable) -throw(RuntimeException) { +noexcept(false) { if(isRunning() == true) { std::string msg(asString()); msg += " | Already activated"; @@ -68,7 +68,7 @@ throw(RuntimeException) { } void Thread::join() -throw(RuntimeException) { +noexcept(false) { #ifdef _MT int errorCode; const pthread_t self(pthread_self()); @@ -134,7 +134,7 @@ void* Thread::exec(void* arg) { } std::string Thread::asString() const -throw() { +{ std::string result("anna::Thread { Id: "); result += functions::asHexString((int) a_id); result += functions::asString(" | Flags (0x%x): ", a_flags); diff --git a/source/core/mt/ThreadManager.cpp b/source/core/mt/ThreadManager.cpp index 956e9ae..a680baa 100644 --- a/source/core/mt/ThreadManager.cpp +++ b/source/core/mt/ThreadManager.cpp @@ -68,7 +68,7 @@ ThreadManager::~ThreadManager() { } Thread* ThreadManager::createThread() -throw(RuntimeException) { +noexcept(false) { Thread* result; if(a_mode == Mode::None) { @@ -136,7 +136,7 @@ throw(RuntimeException) { } void ThreadManager::join() -throw(RuntimeException) { +noexcept(false) { LOGDEBUG( string msg("ThreadManager::join (init) | "); msg += asString(); @@ -184,7 +184,7 @@ throw(RuntimeException) { } void ThreadManager::releaseThread(Thread* thread) -throw(RuntimeException) { +noexcept(false) { if(thread->isRunning() == true) { string msg(thread->asString()); msg += " | Still activated"; @@ -210,7 +210,7 @@ throw(RuntimeException) { } string ThreadManager::asString() const -throw() { +{ string result("anna::ThreadManager { Name: "); result += a_name; result += " | Mode: "; diff --git a/source/core/oam/Configuration.cpp b/source/core/oam/Configuration.cpp index ba50c48..d7c5bb3 100644 --- a/source/core/oam/Configuration.cpp +++ b/source/core/oam/Configuration.cpp @@ -39,7 +39,7 @@ anna::oam::Configuration::Configuration() { //------------------------------------------------------------------------------ //-------------------------------------- Configuration::setAlarmTextDelimiters() //------------------------------------------------------------------------------ -void anna::oam::Configuration::setAlarmTextDelimiters(const char zS, const std::string & psL, const std::string & psS, const std::string & psR) throw() { +void anna::oam::Configuration::setAlarmTextDelimiters(const char zS, const std::string & psL, const std::string & psS, const std::string & psR) { a_alarm_text_delimiter_zS = zS; a_alarm_text_delimiter_psL = psL; a_alarm_text_delimiter_psS = psS; @@ -50,7 +50,7 @@ void anna::oam::Configuration::setAlarmTextDelimiters(const char zS, const std:: //------------------------------------------------------------------------------ //-------------------------------------- Configuration::getAlarmTextDelimiters() //------------------------------------------------------------------------------ -void anna::oam::Configuration::getAlarmTextDelimiters(char & zS, std::string & psL, std::string & psS, std::string & psR) const throw() { +void anna::oam::Configuration::getAlarmTextDelimiters(char & zS, std::string & psL, std::string & psS, std::string & psR) const { zS = a_alarm_text_delimiter_zS; psL = a_alarm_text_delimiter_psL; psS = a_alarm_text_delimiter_psS; @@ -61,7 +61,7 @@ void anna::oam::Configuration::getAlarmTextDelimiters(char & zS, std::string & p //------------------------------------------------------------------------------ //----------------------------------------- Configuration::enableAlarmsPreffix() //------------------------------------------------------------------------------ -void anna::oam::Configuration::enableAlarmsPreffix(void) throw() { +void anna::oam::Configuration::enableAlarmsPreffix(void) { a_alarms_preffix_enabled = true; LOGDEBUG(anna::Logger::debug("Alarm preffix global components SHOWN", ANNA_FILE_LOCATION)); } @@ -70,7 +70,7 @@ void anna::oam::Configuration::enableAlarmsPreffix(void) throw() { //------------------------------------------------------------------------------ //------------------------------------------ Configuration::enableAlarmsSuffix() //------------------------------------------------------------------------------ -void anna::oam::Configuration::enableAlarmsSuffix(void) throw() { +void anna::oam::Configuration::enableAlarmsSuffix(void) { a_alarms_suffix_enabled = true; LOGDEBUG(anna::Logger::debug("Alarm suffix global components SHOWN", ANNA_FILE_LOCATION)); } @@ -79,7 +79,7 @@ void anna::oam::Configuration::enableAlarmsSuffix(void) throw() { //------------------------------------------------------------------------------ //---------------------------------------- Configuration::disableAlarmsPreffix() //------------------------------------------------------------------------------ -void anna::oam::Configuration::disableAlarmsPreffix(void) throw() { +void anna::oam::Configuration::disableAlarmsPreffix(void) { a_alarms_preffix_enabled = false; LOGDEBUG(anna::Logger::debug("Alarm preffix global components HIDDEN", ANNA_FILE_LOCATION)); } @@ -88,7 +88,7 @@ void anna::oam::Configuration::disableAlarmsPreffix(void) throw() { //------------------------------------------------------------------------------ //----------------------------------------- Configuration::disableAlarmsSuffix() //------------------------------------------------------------------------------ -void anna::oam::Configuration::disableAlarmsSuffix(void) throw() { +void anna::oam::Configuration::disableAlarmsSuffix(void) { a_alarms_suffix_enabled = false; LOGDEBUG(anna::Logger::debug("Alarm suffix global components HIDDEN", ANNA_FILE_LOCATION)); } @@ -97,7 +97,7 @@ void anna::oam::Configuration::disableAlarmsSuffix(void) throw() { //------------------------------------------------------------------------------ //------------------------------------------------------- Configuration::asXML() //------------------------------------------------------------------------------ -anna::xml::Node* anna::oam::Configuration::asXML(anna::xml::Node* parent) const throw() { +anna::xml::Node* anna::oam::Configuration::asXML(anna::xml::Node* parent) const { anna::xml::Node* result = parent->createChild("anna.oam.Configuration"); std::vector::const_iterator it, it_min, it_max; result->createAttribute("AlarmsPreffix", a_alarms_preffix_enabled ? "Enabled" : "Disabled"); diff --git a/source/core/oam/Counter.cpp b/source/core/oam/Counter.cpp index 73c06eb..88b9248 100644 --- a/source/core/oam/Counter.cpp +++ b/source/core/oam/Counter.cpp @@ -29,17 +29,17 @@ oam::Counter::Counter(oam::CounterScope& scope, const int id, const char* name) } int oam::Counter::getReference() const -throw() { +{ return (a_scope.getId() * CounterScope::MaxCounter) + a_id; } void oam::Counter::debug() const -throw() { +{ Logger::write(Logger::Information, functions::asString("%s| Counter%08d | %u | %s", TEST_COUNTER_TAG, getReference(), a_value, a_name.c_str()), ANNA_FILE_LOCATION); } string oam::Counter::asString() const -throw() { +{ string result("oam::Counter { Id: "); result += functions::asString("%08d", getReference()); result += " | Name: "; diff --git a/source/core/oam/CounterScope.cpp b/source/core/oam/CounterScope.cpp index 8900d3e..8842558 100644 --- a/source/core/oam/CounterScope.cpp +++ b/source/core/oam/CounterScope.cpp @@ -46,7 +46,7 @@ oam::CounterScope::~CounterScope() { } void oam::CounterScope::create(const int counter, const char* name) -throw(RuntimeException) { +noexcept(false) { test_range(counter); if(a_counters [counter] != NULL) { @@ -70,7 +70,7 @@ throw(RuntimeException) { } oam::Counter::type_t oam::CounterScope::increment(const int counter, const oam::Counter::type_t value) -throw(RuntimeException) { +noexcept(false) { test_range(counter); test_instance(counter); a_counters [counter]->a_value += value; @@ -80,7 +80,7 @@ throw(RuntimeException) { } oam::Counter::type_t oam::CounterScope::assign(const int counter, const oam::Counter::type_t value) -throw(RuntimeException) { +noexcept(false) { test_range(counter); test_instance(counter); a_counters [counter]->a_value = value; @@ -90,20 +90,20 @@ throw(RuntimeException) { } oam::Counter::type_t oam::CounterScope::getValue(const int counter) const -throw(RuntimeException) { +noexcept(false) { test_range(counter); test_instance(counter); return a_counters [counter]->a_value; } U64 oam::CounterScope::getAccValue(const int counter) const -throw(RuntimeException) { +noexcept(false) { test_range(counter); test_instance(counter); return a_counters [counter]->a_accValue; } -int oam::CounterScope::resetAccValues() throw(RuntimeException) { +int oam::CounterScope::resetAccValues() noexcept(false) { int result = 0; // affected counters for(int ii = 0; ii < MaxCounter; ii ++) @@ -114,14 +114,14 @@ int oam::CounterScope::resetAccValues() throw(RuntimeException) { } const oam::Counter* oam::CounterScope::getCounter(const int counter) const -throw(RuntimeException) { +noexcept(false) { test_range(counter); test_instance(counter); return a_counters [counter]; } string oam::CounterScope::asString() const -throw() { +{ string result("oam::CounterScope { Id: "); result += functions::asString(a_id); result += " | Name: "; @@ -130,7 +130,7 @@ throw() { } xml::Node* oam::CounterScope::asXML(xml::Node* parent) const -throw(RuntimeException) { +noexcept(false) { xml::Node* result = parent->createChild("Scope"); xml::Node* counter; diff --git a/source/core/oam/Handler.cpp b/source/core/oam/Handler.cpp index d711f83..6aeab5f 100644 --- a/source/core/oam/Handler.cpp +++ b/source/core/oam/Handler.cpp @@ -25,7 +25,7 @@ //------------------------------------------------------------------------------ //-------------------------------------------------------- Handler::alarmEvent() //------------------------------------------------------------------------------ -const anna::oam::alarm_data_t *anna::oam::Handler::alarmEvent(const anna::oam::Module *module, const char *textPreffix, const char *textSuffix, char textSeparator, bool activation, const int & type, va_list argList) const throw() { +const anna::oam::alarm_data_t *anna::oam::Handler::alarmEvent(const anna::oam::Module *module, const char *textPreffix, const char *textSuffix, char textSeparator, bool activation, const int & type, va_list argList) const { // OAM alarm const alarm_data_t *result = module->alarm(type); @@ -79,7 +79,7 @@ const anna::oam::alarm_data_t *anna::oam::Handler::alarmEvent(const anna::oam::M //------------------------------------------------------ Handler::counterEvent() //------------------------------------------------------------------------------ -const anna::oam::counter_data_t *anna::oam::Handler::counterEvent(const anna::oam::Module *module, const int & type, const int & amount) const throw() { +const anna::oam::counter_data_t *anna::oam::Handler::counterEvent(const anna::oam::Module *module, const int & type, const int & amount) const { // OAM counter const counter_data_t *result = module->counter(type); // Base text: diff --git a/source/core/oam/Module.cpp b/source/core/oam/Module.cpp index 2fa403e..8f8af47 100644 --- a/source/core/oam/Module.cpp +++ b/source/core/oam/Module.cpp @@ -42,7 +42,7 @@ anna::oam::Module::~Module() { //------------------------------------------------------------------------------ //----------------------------------------------------------- Module::getScope() //------------------------------------------------------------------------------ -anna::oam::CounterScope *anna::oam::Module::getScope(const int &id) throw() { +anna::oam::CounterScope *anna::oam::Module::getScope(const int &id) { scope_iterator it = scope_find(id); return ((it != scope_end()) ? scope(it) : NULL); } @@ -50,7 +50,7 @@ anna::oam::CounterScope *anna::oam::Module::getScope(const int &id) throw() { ////------------------------------------------------------------------------------ ////------------------------------------------------------- Module::alarm_remove() ////------------------------------------------------------------------------------ -//bool anna::oam::Module::alarm_remove(const int &key) throw() { +//bool anna::oam::Module::alarm_remove(const int &key) { // alarm_iterator it = alarm_find(key); // if (it != alarm_end()) { // a_alarms.erase(key); @@ -63,7 +63,7 @@ anna::oam::CounterScope *anna::oam::Module::getScope(const int &id) throw() { ////------------------------------------------------------------------------------ ////----------------------------------------------------- Module::counter_remove() ////------------------------------------------------------------------------------ -//bool anna::oam::Module::counter_remove(const int &key) throw() { +//bool anna::oam::Module::counter_remove(const int &key) { // counter_iterator it = counter_find(key); // if (it != counter_end()) { // a_counters.erase(key); @@ -80,7 +80,7 @@ anna::oam::CounterScope *anna::oam::Module::getScope(const int &id) throw() { //------------------------------------------------------------------------------ //----------------------------------------------------- Module::enableCounters() //------------------------------------------------------------------------------ -void anna::oam::Module::enableCounters(void) throw() { +void anna::oam::Module::enableCounters(void) { a_counters_enabled = true; LOGDEBUG(anna::Logger::debug("Scoped counters ENABLED", ANNA_FILE_LOCATION)); } @@ -89,7 +89,7 @@ void anna::oam::Module::enableCounters(void) throw() { //------------------------------------------------------------------------------ //---------------------------------------------------- Module::disableCounters() //------------------------------------------------------------------------------ -void anna::oam::Module::disableCounters(void) throw() { +void anna::oam::Module::disableCounters(void) { a_counters_enabled = false; LOGDEBUG(anna::Logger::debug("Scoped counters DISABLED", ANNA_FILE_LOCATION)); } @@ -98,7 +98,7 @@ void anna::oam::Module::disableCounters(void) throw() { //------------------------------------------------------------------------------ //------------------------------------------------------- Module::enableAlarms() //------------------------------------------------------------------------------ -void anna::oam::Module::enableAlarms(void) throw() { +void anna::oam::Module::enableAlarms(void) { a_alarms_enabled = true; LOGDEBUG(anna::Logger::debug("Scoped alarms ENABLED", ANNA_FILE_LOCATION)); } @@ -107,7 +107,7 @@ void anna::oam::Module::enableAlarms(void) throw() { //------------------------------------------------------------------------------ //------------------------------------------------------ Module::disableAlarms() //------------------------------------------------------------------------------ -void anna::oam::Module::disableAlarms(void) throw() { +void anna::oam::Module::disableAlarms(void) { a_alarms_enabled = false; LOGDEBUG(anna::Logger::debug("Scoped alarms DISABLED", ANNA_FILE_LOCATION)); } @@ -116,7 +116,7 @@ void anna::oam::Module::disableAlarms(void) throw() { //------------------------------------------------------------------------------ //------------------------------------------------ Module::enableAlarmsPreffix() //------------------------------------------------------------------------------ -void anna::oam::Module::enableAlarmsPreffix(void) throw() { +void anna::oam::Module::enableAlarmsPreffix(void) { a_alarms_preffix_enabled = true; LOGDEBUG(anna::Logger::debug("Alarm preffix module components SHOWN", ANNA_FILE_LOCATION)); } @@ -125,7 +125,7 @@ void anna::oam::Module::enableAlarmsPreffix(void) throw() { //------------------------------------------------------------------------------ //------------------------------------------------- Module::enableAlarmsSuffix() //------------------------------------------------------------------------------ -void anna::oam::Module::enableAlarmsSuffix(void) throw() { +void anna::oam::Module::enableAlarmsSuffix(void) { a_alarms_suffix_enabled = true; LOGDEBUG(anna::Logger::debug("Alarm suffix module components SHOWN", ANNA_FILE_LOCATION)); } @@ -134,7 +134,7 @@ void anna::oam::Module::enableAlarmsSuffix(void) throw() { //------------------------------------------------------------------------------ //----------------------------------------------- Module::disableAlarmsPreffix() //------------------------------------------------------------------------------ -void anna::oam::Module::disableAlarmsPreffix(void) throw() { +void anna::oam::Module::disableAlarmsPreffix(void) { a_alarms_preffix_enabled = false; LOGDEBUG(anna::Logger::debug("Alarm preffix module components HIDDEN", ANNA_FILE_LOCATION)); } @@ -143,7 +143,7 @@ void anna::oam::Module::disableAlarmsPreffix(void) throw() { //------------------------------------------------------------------------------ //------------------------------------------------ Module::disableAlarmsSuffix() //------------------------------------------------------------------------------ -void anna::oam::Module::disableAlarmsSuffix(void) throw() { +void anna::oam::Module::disableAlarmsSuffix(void) { a_alarms_suffix_enabled = false; LOGDEBUG(anna::Logger::debug("Alarm suffix module components HIDDEN", ANNA_FILE_LOCATION)); } @@ -152,7 +152,7 @@ void anna::oam::Module::disableAlarmsSuffix(void) throw() { //------------------------------------------------------------------------------ //--------------------------------- Module::getDefaultInternalAlarmDescription() //------------------------------------------------------------------------------ -std::string anna::oam::Module::getDefaultInternalAlarmDescription(const int & type) const throw() { +std::string anna::oam::Module::getDefaultInternalAlarmDescription(const int & type) const { return UNDEFINED_EVENT_DESCRIPTION; } @@ -160,7 +160,7 @@ std::string anna::oam::Module::getDefaultInternalAlarmDescription(const int & ty //------------------------------------------------------------------------------ //------------------------------- Module::getDefaultInternalCounterDescription() //------------------------------------------------------------------------------ -std::string anna::oam::Module::getDefaultInternalCounterDescription(const int & type) const throw() { +std::string anna::oam::Module::getDefaultInternalCounterDescription(const int & type) const { return UNDEFINED_EVENT_DESCRIPTION; } @@ -168,7 +168,7 @@ std::string anna::oam::Module::getDefaultInternalCounterDescription(const int & //------------------------------------------------------------------------------ //---------------------------------------------- Module::alarmComponentsToText() //------------------------------------------------------------------------------ -std::string anna::oam::Module::alarmComponentsToText(const std::vector & components, const std::string & psL, const std::string & psS, const std::string & psR) const throw() { +std::string anna::oam::Module::alarmComponentsToText(const std::vector & components, const std::string & psL, const std::string & psS, const std::string & psR) const { if(components.size() == 0) return (""); std::vector::const_iterator it_min(components.begin()); @@ -187,7 +187,7 @@ std::string anna::oam::Module::alarmComponentsToText(const std::vector * globalPreffixComponents = conf.getAlarmPreffixComponents(); const std::vector * globalSuffixComponents = conf.getAlarmSuffixComponents(); @@ -225,7 +225,7 @@ void anna::oam::Module::getAlarmPreffixSuffixAndZoneSeparator(std::string & pref //------------------------------------------------------------------------------ //--------------------------------------------- Module::initializeCounterScope() //------------------------------------------------------------------------------ -void anna::oam::Module::initializeCounterScope(const int & scopeId, const std::string & description) throw(anna::RuntimeException) { +void anna::oam::Module::initializeCounterScope(const int & scopeId, const std::string & description) noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("anna::oam::Module", "initializeCounterScope", ANNA_FILE_LOCATION)); // Order of use: @@ -266,7 +266,7 @@ void anna::oam::Module::initializeCounterScope(const int & scopeId, const std::s //------------------------------------------------------------------------------ //---------------------------------------------- Module::setActiveCounterScope() //------------------------------------------------------------------------------ -void anna::oam::Module::setActiveCounterScope(const int & scopeId) throw() { +void anna::oam::Module::setActiveCounterScope(const int & scopeId) { anna::oam::CounterScope *scope = getScope(scopeId); if(!scope) { @@ -281,7 +281,7 @@ void anna::oam::Module::setActiveCounterScope(const int & scopeId) throw() { //------------------------------------------------------------------------------ //---------------------------------------------------- Module::registerCounter() //------------------------------------------------------------------------------ -void anna::oam::Module::registerCounter(const int & type, const std::string & description, const int & offset) throw(anna::RuntimeException) { +void anna::oam::Module::registerCounter(const int & type, const std::string & description, const int & offset) noexcept(false) { // Handler-specific a_handler->registerCounter(this, type, description, offset); @@ -331,7 +331,7 @@ void anna::oam::Module::registerCounter(const int & type, const std::string & de //------------------------------------------------------------------------------ //------------------------------------------------------ Module::registerAlarm() //------------------------------------------------------------------------------ -void anna::oam::Module::registerAlarm(const int & type, const std::string &description, const int & externalId, const std::string & dynamicVariablesCSL, const int & activationId, const int & cancellationId) throw(anna::RuntimeException) { +void anna::oam::Module::registerAlarm(const int & type, const std::string &description, const int & externalId, const std::string & dynamicVariablesCSL, const int & activationId, const int & cancellationId) noexcept(false) { // Handler-specific a_handler->registerAlarm(this, type, description, externalId, dynamicVariablesCSL, activationId, cancellationId); // Check type existence: @@ -375,7 +375,7 @@ void anna::oam::Module::registerAlarm(const int & type, const std::string &descr //------------------------------------------------------------------------------ //------------------------------------------------------ Module::activateAlarm() //------------------------------------------------------------------------------ -void anna::oam::Module::alarmEvent(bool activation, const int & type, va_list argList) const throw() { +void anna::oam::Module::alarmEvent(bool activation, const int & type, va_list argList) const { // Preffix/Suffix and separator: std::string userPreffix, userSuffix; char separator; getAlarmPreffixSuffixAndZoneSeparator(userPreffix, userSuffix, separator); @@ -391,7 +391,7 @@ void anna::oam::Module::alarmEvent(bool activation, const int & type, va_list ar //------------------------------------------------------------------------------ //------------------------------------------------------ Module::activateAlarm() //------------------------------------------------------------------------------ -void anna::oam::Module::activateAlarm(int type, ...) const throw(anna::RuntimeException) { +void anna::oam::Module::activateAlarm(int type, ...) const noexcept(false) { // LOGMETHOD(anna::TraceMethod tttm("anna::oam::Module", "activateAlarm", ANNA_FILE_LOCATION)); // Checkings @@ -417,7 +417,7 @@ void anna::oam::Module::activateAlarm(int type, ...) const throw(anna::RuntimeEx //------------------------------------------------------------------------------ //-------------------------------------------------------- Module::cancelAlarm() //------------------------------------------------------------------------------ -void anna::oam::Module::cancelAlarm(int type, ...) const throw(anna::RuntimeException) { +void anna::oam::Module::cancelAlarm(int type, ...) const noexcept(false) { // LOGMETHOD(anna::TraceMethod tttm("anna::oam::Module", "cancelAlarm", ANNA_FILE_LOCATION)); // Checkings @@ -443,7 +443,7 @@ void anna::oam::Module::cancelAlarm(int type, ...) const throw(anna::RuntimeExce //------------------------------------------------------------------------------ //-------------------------------------------------------------- Module::count() //------------------------------------------------------------------------------ -void anna::oam::Module::count(const int & type, const int & amount) throw(anna::RuntimeException) { +void anna::oam::Module::count(const int & type, const int & amount) noexcept(false) { // LOGMETHOD(anna::TraceMethod tttm("anna::oam::Module", "count", ANNA_FILE_LOCATION)); // Checkings @@ -465,7 +465,7 @@ void anna::oam::Module::count(const int & type, const int & amount) throw(anna:: //------------------------------------------------------------------------------ //------------------------------------------------------ Module::resetCounters() //------------------------------------------------------------------------------ -int anna::oam::Module::resetCounters(const int & scopeId) throw() { +int anna::oam::Module::resetCounters(const int & scopeId) { LOGMETHOD(anna::TraceMethod tttm("anna::oam::Module", "resetCounters", ANNA_FILE_LOCATION)); int result = 0; // affected number @@ -496,7 +496,7 @@ anna::oam::Module::RecordingGuard::~RecordingGuard() { //------------------------------------------------------------------------------ //----------------------------------------------------- Module::recordCounters() //------------------------------------------------------------------------------ -void anna::oam::Module::recordCounters() throw(anna::RuntimeException) { +void anna::oam::Module::recordCounters() noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("anna::oam::Module", "recordCounters", ANNA_FILE_LOCATION)); if(a_counterRecorder == NULL) @@ -543,7 +543,7 @@ void anna::oam::Module::recordCounters() throw(anna::RuntimeException) { //------------------------------------------------------------------------------ //----------------------------------------------------------- Module::asString() //------------------------------------------------------------------------------ -std::string anna::oam::Module::asString(void) const throw() { +std::string anna::oam::Module::asString(void) const { std::string trace; trace = "Module name: '"; trace += getName(); @@ -616,7 +616,7 @@ std::string anna::oam::Module::asString(void) const throw() { //------------------------------------------------------------------------------ //-------------------------------------------------------------- Module::asXML() //------------------------------------------------------------------------------ -anna::xml::Node* anna::oam::Module::asXML(anna::xml::Node* parent) const throw() { +anna::xml::Node* anna::oam::Module::asXML(anna::xml::Node* parent) const { anna::xml::Node* result = parent->createChild("oam.Module"); result->createAttribute("Name", getName()); result->createAttribute("Counters", a_counters_enabled ? "Enabled" : "Disabled"); diff --git a/source/core/tracing/Configuration.cpp b/source/core/tracing/Configuration.cpp index 3b43f59..389da1e 100644 --- a/source/core/tracing/Configuration.cpp +++ b/source/core/tracing/Configuration.cpp @@ -25,7 +25,7 @@ using namespace anna; //------------------------------------------------------------------------------ //---------------------------------------- Configuration::activateTraceTrigger() //------------------------------------------------------------------------------ -void anna::tracing::Configuration::activateTraceTrigger(const std::string & trigger, bool accumulate, anna::Logger::Level level) throw() { +void anna::tracing::Configuration::activateTraceTrigger(const std::string & trigger, bool accumulate, anna::Logger::Level level) { if(!accumulate) resetTraceTriggers(); RegularExpression regEx(trigger); // not yet compiled (perhaps no regular expressions used) @@ -36,7 +36,7 @@ void anna::tracing::Configuration::activateTraceTrigger(const std::string & trig //------------------------------------------------------------------------------ //-------------------------------------- Configuration::deactivateTraceTrigger() //------------------------------------------------------------------------------ -void anna::tracing::Configuration::deactivateTraceTrigger(const std::string & trigger) throw() { +void anna::tracing::Configuration::deactivateTraceTrigger(const std::string & trigger) { RegularExpression regEx(trigger); // not yet compiled (perhaps no regular expressions used) trace_trigger_map_t::iterator it = a_traceTriggers.find(regEx); @@ -47,7 +47,7 @@ void anna::tracing::Configuration::deactivateTraceTrigger(const std::string & tr //------------------------------------------------------------------------------ //---------------------------------------------------- Configuration::asString() //------------------------------------------------------------------------------ -std::string anna::tracing::Configuration::asString(void) const throw() { +std::string anna::tracing::Configuration::asString(void) const { std::string result = ""; // Gets selective tracing trigger map representation with this format: // 'trigger1(desiredLevel1)|trigger2(desiredLevel2)| ... |triggerN(desiredLevelN)' diff --git a/source/core/tracing/Logger.cpp b/source/core/tracing/Logger.cpp index 608b927..c8b7ec4 100644 --- a/source/core/tracing/Logger.cpp +++ b/source/core/tracing/Logger.cpp @@ -32,7 +32,7 @@ Logger::Level Logger::st_level(Logger::Warning); NRMutex Logger::st_mutex; void Logger::initialize(const char* ident) -throw() { +{ if(st_writer == NULL) { st_writer = new TraceLogger; st_writer->initialize(ident); @@ -40,7 +40,7 @@ throw() { } void Logger::initialize(const char* ident, Writer* writer) -throw() { +{ if(st_writer == NULL && writer != NULL) { writer->initialize(ident); st_writer = writer; @@ -48,7 +48,7 @@ throw() { } void Logger::showPID(const bool show) -throw() { +{ #ifndef _MT if(show == true) { @@ -61,7 +61,7 @@ throw() { } void Logger::write(const Level level, const char* text, const char* fromFile, const int fromLine) -throw() { +{ #ifndef _MT if(isActive(level) && st_writer != NULL) { @@ -80,7 +80,7 @@ throw() { } void Logger::write(const Level level, const char* text, const char* value, const char* fromFile, const int fromLine) -throw() { +{ #ifndef _MT if(isActive(level) && st_writer != NULL) { @@ -99,7 +99,7 @@ throw() { } void Logger::write(const Level level, const char* text, const int value, const char* fromFile, const int fromLine) -throw() { +{ #ifndef _MT if(isActive(level) && st_writer != NULL) { @@ -118,7 +118,7 @@ throw() { } void Logger::write(const Level level, const char* text, const DataBlock& value, const char* fromFile, const int fromLine) -throw() { +{ if(isActive(level) && st_writer != NULL) { #ifndef _MT @@ -141,21 +141,21 @@ throw() { } void Logger::disable() -throw(RuntimeException) { +noexcept(false) { st_mutex.lock(); st_enabled = false; st_mutex.unlock(); } void Logger::enable() -throw(RuntimeException) { +noexcept(false) { st_mutex.lock(); st_enabled = true; st_mutex.unlock(); } Logger::Level Logger::asLevel(const char* stringLevel) -throw(RuntimeException) { +noexcept(false) { static struct { const char* stringLevel; const Level level; @@ -192,7 +192,7 @@ throw(RuntimeException) { } const char* Logger::asString(const Level level) -throw() { +{ static const char* levels [] = { "Emergency", "Alert", "Critical", "Error", "Warning", "Notice", "Information", "Debug" }; diff --git a/source/core/tracing/TraceLevelChecker.cpp b/source/core/tracing/TraceLevelChecker.cpp index c8a6258..2911ed5 100644 --- a/source/core/tracing/TraceLevelChecker.cpp +++ b/source/core/tracing/TraceLevelChecker.cpp @@ -26,7 +26,7 @@ using namespace anna; //------------------------------------------------------------------------------ //------------------------------------ TraceLevelChecker::changeLevelCondition() //------------------------------------------------------------------------------ -bool TraceLevelChecker::changeLevelCondition(const std::string & contextData, anna::Logger::Level & targetLevel) const throw() { +bool TraceLevelChecker::changeLevelCondition(const std::string & contextData, anna::Logger::Level & targetLevel) const { Configuration & conf = Configuration::instantiate(); Configuration::trace_trigger_map_t::const_iterator it; Configuration::trace_trigger_map_t & traceTriggers = (Configuration::trace_trigger_map_t &)conf.getTraceTriggers(); @@ -61,7 +61,7 @@ bool TraceLevelChecker::changeLevelCondition(const std::string & contextData, an //------------------------------------------------------------------------------ //---------------------------------------------------- TraceLevelChecker::load() //------------------------------------------------------------------------------ -bool TraceLevelChecker::load(const char * contextData) throw() { +bool TraceLevelChecker::load(const char * contextData) { a_previousLevel = Logger::getLevel(); if(contextData) a_contextData = contextData; // update with valid string provided @@ -90,7 +90,7 @@ bool TraceLevelChecker::load(const char * contextData) throw() { //------------------------------------------------------------------------------ //------------------------------------------------- TraceLevelChecker::restore() //------------------------------------------------------------------------------ -bool TraceLevelChecker::restore() throw() { +bool TraceLevelChecker::restore() { anna::Logger::Level currentLevel = Logger::getLevel(); if(currentLevel != a_previousLevel /* level at constructor begining */) { diff --git a/source/core/tracing/TraceLogger.cpp b/source/core/tracing/TraceLogger.cpp index b573953..30dfdb9 100644 --- a/source/core/tracing/TraceLogger.cpp +++ b/source/core/tracing/TraceLogger.cpp @@ -17,12 +17,12 @@ using namespace anna; void TraceLogger::initialize(const char* ident) -throw() { +{ openlog(ident, LOG_PID | LOG_CONS | LOG_ODELAY | LOG_NOWAIT, LOG_LOCAL0); } void TraceLogger::do_write(int level, const char* message, ...) -throw() { +{ va_list ap; int size; int nbytes; diff --git a/source/core/tracing/TraceWriter.cpp b/source/core/tracing/TraceWriter.cpp index 0fa28a1..6111526 100644 --- a/source/core/tracing/TraceWriter.cpp +++ b/source/core/tracing/TraceWriter.cpp @@ -47,7 +47,7 @@ TraceWriter::TraceWriter(const char* fileName, const int maxSize) : } void TraceWriter::setup(const char* fileName, const Configuration& configuration) -throw() { +{ int maxSize = a_maxSize; bool clean = true; @@ -74,7 +74,7 @@ throw() { } void TraceWriter::setup(const char* fileName, const int maxSize, const bool clean) -throw() { +{ ssize_t r; if(a_stream != -1) { @@ -127,7 +127,7 @@ throw() { } void TraceWriter::attach(TraceWriterObserver* observer) -throw() { +{ if(observer != NULL) { a_observed = true; a_observers.push_back(observer); @@ -138,7 +138,7 @@ throw() { } void TraceWriter::printResume() -throw() { +{ cout << "Traces file ..................................: " << a_outputFile << endl; cout << "Backup copy .................................: " << a_outputOldFile << endl; cout << "Files size (Kbytes) ..........................: " << (a_maxSize >> 10) << endl; @@ -146,7 +146,7 @@ throw() { } void TraceWriter::do_write(int level, const char* text, ...) -throw() { +{ va_list ap; const char* data; int size; @@ -201,7 +201,7 @@ throw() { } const char* TraceWriter::getDate() -throw() { +{ const Microsecond msnow = functions::hardwareClock(); if(a_lastTime == 0 || (msnow - a_lastTime) > 1000000L) { @@ -214,7 +214,7 @@ throw() { } int TraceWriter::prepareOutput(const char* date) -throw() { +{ int result = a_stream; if(result == ErrorStream) diff --git a/source/core/util/CommandLine.cpp b/source/core/util/CommandLine.cpp index 85d171d..42dfd17 100644 --- a/source/core/util/CommandLine.cpp +++ b/source/core/util/CommandLine.cpp @@ -24,7 +24,7 @@ using namespace anna; // (1) Verifica que la opcion no haya sido registrada previamente. //-------------------------------------------------------------------------------- void CommandLine::add(const char* argumentExpression, Argument::Type type, const char* comment, const bool needValue) -throw() { +{ Guard guard(a_mutex, "CommandLine::add"); std::string arg1 = "", arg2 = ""; @@ -62,7 +62,7 @@ throw() { } void CommandLine::initialize(const char** argv, const int argc, int positionalArguments) -throw(RuntimeException) { +noexcept(false) { if (argc < 1) throw RuntimeException("Provided argc < 1 as command-line argv size !", ANNA_FILE_LOCATION); if (positionalArguments < 0) throw RuntimeException("Provided negative number of positional arguments as command-line initializer", ANNA_FILE_LOCATION); if (positionalArguments > (argc-1)) throw RuntimeException("Provided positional arguments > (argc - 1) as command-line initializer", ANNA_FILE_LOCATION); @@ -77,7 +77,7 @@ throw(RuntimeException) { // linea de comandos. //-------------------------------------------------------------------------------- void CommandLine::verify() -throw(RuntimeException) { +noexcept(false) { if(a_argv == NULL) throw RuntimeException("CommandLine was not initialized", ANNA_FILE_LOCATION); @@ -103,7 +103,7 @@ throw(RuntimeException) { // Si el arguemento solicitado no esta en la LC y es opcional devolvera NULL. //-------------------------------------------------------------------------------- const char* CommandLine::getValue(const char* argumentExpression, const bool exitOnFault) -throw() { +{ const char* result = NULL; const Variable* argument = NULL; bool error = true; @@ -142,7 +142,7 @@ throw() { // Auxiliary function: // Returns first no-leading hyphen position -int removeLeadingHyphens(std::string &argv) throw() { +int removeLeadingHyphens(std::string &argv) { int startPos = -1; // Move until no hyphen: for (int i=0; i < argv.size(); i++) @@ -169,7 +169,7 @@ int removeLeadingHyphens(std::string &argv) throw() { // Analize command line to store the arguments //-------------------------------------------------------------------------------- bool CommandLine::analize() -throw() { +{ Variable* variable; bool result = true; int i = a_positionalArguments + 1; @@ -212,7 +212,7 @@ throw() { } const CommandLine::Variable* CommandLine::search(const char *argumentExpression) const -throw() { +{ if (!argumentExpression) return NULL; std::string name1, name2, arg; @@ -238,7 +238,7 @@ throw() { } string CommandLine::Variable::getHelpExpression() const -throw() { +{ std::string long_name, short_name, result = ""; int s1 = a_name1.size(); @@ -266,7 +266,7 @@ throw() { } void CommandLine::printUsage() const -throw() { +{ int i, maxi(a_arguments.size()); cout << "Usage: " << a_argv [0] << " "; @@ -282,7 +282,7 @@ throw() { } string CommandLine::Variable::asString() const -throw() { +{ string result; result = ((a_type == Argument::Optional) ? "[ " : ""); result += getHelpExpression(); @@ -293,7 +293,7 @@ throw() { } string CommandLine::asString() const -throw() { +{ string result = "Provided command-line parameters:\n\n"; vector ::const_iterator ii, maxii; const char *value; @@ -315,7 +315,7 @@ throw() { return result; } -xml::Node* CommandLine::asXML(xml::Node* parent) const throw() { +xml::Node* CommandLine::asXML(xml::Node* parent) const { xml::Node* result = parent->createChild("CommandLine"); vector ::const_iterator ii, maxii; const char *value; diff --git a/source/core/util/Component.cpp b/source/core/util/Component.cpp index 6dbbd22..8fea637 100644 --- a/source/core/util/Component.cpp +++ b/source/core/util/Component.cpp @@ -38,7 +38,7 @@ anna::Component::~Component() { } std::string anna::Component::asString() const -throw() { +{ std::string result("anna::Component { Name: "); result += a_className; result += " | Reference: "; @@ -47,7 +47,7 @@ throw() { } anna::xml::Node* anna::Component::asXML(anna::xml::Node* parent) const -throw() { +{ anna::xml::Node* result = parent->createChild("anna.Component"); result->createAttribute("Name", a_className); result->createAttribute("Reference", anna::functions::asHexString(anna_ptrnumber_cast(this))); diff --git a/source/core/util/ComponentManager.cpp b/source/core/util/ComponentManager.cpp index 9f486a6..1607d9d 100644 --- a/source/core/util/ComponentManager.cpp +++ b/source/core/util/ComponentManager.cpp @@ -19,7 +19,7 @@ anna::Component* anna::ComponentManager::find(const char* className) -throw() { +{ std::map ::iterator it = a_components.find(className); if(it != a_components.end()) return (*it).second; @@ -28,7 +28,7 @@ throw() { } void anna::ComponentManager::attach(anna::Component* component) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("anna::ComponentManager", "attach(component)", ANNA_FILE_LOCATION)); if(component == NULL) @@ -56,7 +56,7 @@ throw(anna::RuntimeException) { } void anna::ComponentManager::detach(anna::Component* component) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("anna::ComponentManager", "detach(component)", ANNA_FILE_LOCATION)); if(component == NULL) @@ -83,7 +83,7 @@ throw(anna::RuntimeException) { } anna::xml::Node* anna::ComponentManager::asXML(anna::xml::Node* parent) const -throw() { +{ anna::xml::Node* node(NULL); node = parent->createChild("anna.Components"); std::map ::const_iterator it; diff --git a/source/core/util/Configuration.cpp b/source/core/util/Configuration.cpp index cb1eb32..0cdb8fc 100644 --- a/source/core/util/Configuration.cpp +++ b/source/core/util/Configuration.cpp @@ -23,7 +23,7 @@ using namespace anna; const char* Configuration::defaultSection = "@global@"; void Configuration::load(const char* configFile) -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tm("Configuration", "load", ANNA_FILE_LOCATION)); char buffer [2048]; FILE* file; @@ -60,13 +60,13 @@ throw(RuntimeException) { } bool Configuration::exists(const char* sectionName, const char* variableName) const -throw() { +{ const VariableEx* var = find(string(sectionName), variableName); return (var == NULL) ? false : !var->isNull(); } void Configuration::setDefaultValue(const char* sectionName, const char* variableName, const char* defaultValue) -throw(RuntimeException) { +noexcept(false) { string section(sectionName); VariableEx* var = find(section, variableName); @@ -86,7 +86,7 @@ throw(RuntimeException) { } const char* Configuration::getValue(const char* sectionName, const char* variableName, const bool strict) const -throw(RuntimeException) { +noexcept(false) { const VariableEx* variable = find(string(sectionName), variableName); const char* result(NULL); @@ -108,7 +108,7 @@ throw(RuntimeException) { } int Configuration::getIntegerValue(const char* sectionName, const char* variableName, const bool strict) const -throw(RuntimeException) { +noexcept(false) { return atoi(getValue(sectionName, variableName, strict)); } @@ -151,7 +151,7 @@ bool Configuration::processSection(const int nline, char* buffer, string& curren } void Configuration::processVariable(const int nline, char* buffer, const string& currentSection) -throw(RuntimeException) { +noexcept(false) { char* variableName; char* value; char* aux; @@ -197,7 +197,7 @@ throw(RuntimeException) { } Configuration::VariableEx* Configuration::createVariable(const string& section, const char* variableName) -throw() { +{ map ::iterator isection(a_sections.find(section)); VariableEx* result; VariableEx::Vector* variables; @@ -214,7 +214,7 @@ throw() { } Configuration::VariableEx* Configuration::find(const string& section, const char* variableName) -throw() { +{ VariableEx* result(NULL); map ::iterator isection(a_sections.find(section)); @@ -234,7 +234,7 @@ throw() { } void Configuration::removeAll() -throw() { +{ map ::iterator ii(a_sections.begin()); map ::iterator end(a_sections.end()); VariableEx::Vector::iterator vv, maxvv; diff --git a/source/core/util/EncodedData.cpp b/source/core/util/EncodedData.cpp index e818814..16816eb 100644 --- a/source/core/util/EncodedData.cpp +++ b/source/core/util/EncodedData.cpp @@ -18,7 +18,7 @@ using namespace std; using namespace anna; void EncodedData::initialize(const xml::Node* parent) -throw(RuntimeException) { +noexcept(false) { if(fromBCD(parent->find("Key1")->getAttribute("Value")->getValue(), a_value) != sizeof(DES_key_schedule)) throw RuntimeException("anna::EncodedData::initialize | Key1 no valida", ANNA_FILE_LOCATION); @@ -44,7 +44,7 @@ throw(RuntimeException) { } xml::Node* EncodedData::asXML(xml::Node* parent) const -throw(RuntimeException) { +noexcept(false) { parent->createAttribute("Mode", "DES3"); xml::Node* node; string aux; @@ -63,7 +63,7 @@ throw(RuntimeException) { } const std::string& EncodedData::asBCD(const DataBlock& source, string& result) -throw() { +{ result = ""; const char* data = source.getData(); int c; @@ -81,7 +81,7 @@ throw() { } int EncodedData::fromBCD(const string& source, DataBlock& result) -throw() { +{ result.clear(); const char* data = source.c_str(); int len = 0, maxlen = source.length(); diff --git a/source/core/util/Encoder.cpp b/source/core/util/Encoder.cpp index b126a39..8daa666 100644 --- a/source/core/util/Encoder.cpp +++ b/source/core/util/Encoder.cpp @@ -17,12 +17,12 @@ using namespace std; using namespace anna; void Encoder::initialize() -throw() { +{ srand(functions::second()); } const EncodedData& Encoder::encode(const DataBlock& data) -throw(RuntimeException) { +noexcept(false) { DES_cblock key [3]; DES_key_schedule* skey [3]; @@ -58,7 +58,7 @@ throw(RuntimeException) { // (1) Elimina los 8 primeros bytes que tuvimos que poner de relleno en la codificacion. //------------------------------------------------------------------------------------------------- const DataBlock& Encoder::decode(const EncodedData& data) -throw(RuntimeException) { +noexcept(false) { if(data.a_realSize <= 0) { string msg("anna::Encoder::encode | Cannot decode an uninitialized data"); throw RuntimeException(msg, ANNA_FILE_LOCATION); @@ -93,7 +93,7 @@ throw(RuntimeException) { // 'const_cast (data).a_value.remove (sizeof (DES_cblock));' //------------------------------------------------------------------------------------------------- DataBlock& Encoder::setDataBlock(const DataBlock& other) -throw(RuntimeException) { +noexcept(false) { DataBlock& value = a_data.a_value; int r; value.clear(); diff --git a/source/core/util/Environment.cpp b/source/core/util/Environment.cpp index 63d1626..7ab71e2 100644 --- a/source/core/util/Environment.cpp +++ b/source/core/util/Environment.cpp @@ -23,7 +23,7 @@ using namespace anna; extern int errno; -void Environment::initialize(char **envp) throw() { +void Environment::initialize(char **envp) { LOGMETHOD(TraceMethod tm("Environment", "initialize", ANNA_FILE_LOCATION)); // clear data a_vars.clear(); @@ -47,7 +47,7 @@ void Environment::initialize(char **envp) throw() { } } -std::string Environment::getValue(const char* variableName, bool exceptionIfMissing) throw(RuntimeException) { +std::string Environment::getValue(const char* variableName, bool exceptionIfMissing) noexcept(false) { if(!variableName) throw RuntimeException("Invalid NULL variable name!", ANNA_FILE_LOCATION); @@ -55,7 +55,7 @@ std::string Environment::getValue(const char* variableName, bool exceptionIfMiss return getValue(var, exceptionIfMissing); } -std::string Environment::getValue(const std::string &variableName, bool exceptionIfMissing) throw(RuntimeException) { +std::string Environment::getValue(const std::string &variableName, bool exceptionIfMissing) noexcept(false) { std::string result = ""; std::map::const_iterator it = a_vars.find(variableName); @@ -82,7 +82,7 @@ std::string Environment::getValue(const std::string &variableName, bool exceptio } -void Environment::setVariable(const std::string &name, const std::string &value, bool overwrite) throw(RuntimeException) { +void Environment::setVariable(const std::string &name, const std::string &value, bool overwrite) noexcept(false) { if(name == "") throw RuntimeException("Must provide non-empty variable name", ANNA_FILE_LOCATION); if(setenv(name.c_str(), value.c_str(), overwrite ? 1 : 0) != 0) { @@ -101,7 +101,7 @@ void Environment::setVariable(const std::string &name, const std::string &value, } -void Environment::unsetVariable(const std::string &name) throw(RuntimeException) { +void Environment::unsetVariable(const std::string &name) noexcept(false) { if(name == "") throw RuntimeException("Must provide non-empty variable name", ANNA_FILE_LOCATION); if(unsetenv(name.c_str()) != 0) { diff --git a/source/core/util/Microsecond.cpp b/source/core/util/Microsecond.cpp index 9cd19bf..5b1bce4 100644 --- a/source/core/util/Microsecond.cpp +++ b/source/core/util/Microsecond.cpp @@ -20,12 +20,12 @@ using namespace anna; #define implement_operator(op) \ bool Microsecond::operator op (const Millisecond& other) const \ - throw ()\ + \ {\ return a_value op (((type_t) other.a_value) * 1000);\ }\ bool Microsecond::operator op (const Second& other) const\ - throw ()\ + \ {\ return a_value op ((type_t) other.a_value * 1000000);\ } @@ -35,14 +35,14 @@ Microsecond::Microsecond(const Millisecond& other) : a_value(other.a_value) { a_ Microsecond::Microsecond(const Second& other) : a_value(other.a_value) { a_value *= (type_t)1000000; } Microsecond& Microsecond::operator= (const Millisecond & other) -throw() { +{ a_value = other.a_value; a_value *= (type_t)1000; return *this; } Microsecond& Microsecond::operator= (const Second & other) -throw() { +{ a_value = other.a_value; a_value *= (type_t)1000000; return *this; @@ -56,7 +56,7 @@ implement_operator( <) //static Microsecond Microsecond::getTime() -throw() { +{ struct timeval tv; gettimeofday(&tv, NULL); Microsecond result(Second(tv.tv_sec)); @@ -65,14 +65,14 @@ throw() { } string Microsecond::asString() const -throw() { +{ string result(functions::asString(a_value)); return result += " us"; } //static Microsecond Microsecond::fromString(const std::string& value) -throw(RuntimeException) { +noexcept(false) { if(value.find(" us") == string::npos) { string msg("String: "); msg += value; diff --git a/source/core/util/Millisecond.cpp b/source/core/util/Millisecond.cpp index c24c814..8219c35 100644 --- a/source/core/util/Millisecond.cpp +++ b/source/core/util/Millisecond.cpp @@ -20,12 +20,12 @@ using namespace anna; #define implement_operator(op) \ bool Millisecond::operator op (const Second& other) const \ - throw ()\ + \ {\ return a_value op (other.a_value * (type_t)1000);\ }\ bool Millisecond::operator op (const Microsecond& other) const\ - throw ()\ + \ {\ return a_value op (other.a_value / 1000);\ } @@ -35,14 +35,14 @@ Millisecond::Millisecond(const Second& other) : a_value(other.a_value) { a_value Millisecond::Millisecond(const Microsecond& other) : a_value(other.a_value / 1000) {;} Millisecond& Millisecond::operator= (const Second & other) -throw() { +{ a_value = other.a_value; a_value *= (type_t)1000; return *this; } Millisecond& Millisecond::operator= (const Microsecond & other) -throw() { +{ a_value = (other.a_value / 1000); return *this; } @@ -54,7 +54,7 @@ implement_operator( <) //static Millisecond Millisecond::getTime() -throw() { +{ struct timeval tv; gettimeofday(&tv, NULL); Millisecond result(Second(tv.tv_sec)); @@ -64,7 +64,7 @@ throw() { } timeval* Millisecond::getTimeVal(timeval& tv) const -throw() { +{ if(a_value < 0) return NULL; @@ -74,14 +74,14 @@ throw() { } string Millisecond::asString() const -throw() { +{ string result(functions::asString(a_value)); return result += " ms"; } //static Millisecond Millisecond::fromString(const std::string& value) -throw(RuntimeException) { +noexcept(false) { if(value.find(" ms") == string::npos) { string msg("String: "); msg += value; diff --git a/source/core/util/MultiRangeExpression.cpp b/source/core/util/MultiRangeExpression.cpp index 817c0ed..bd4818b 100644 --- a/source/core/util/MultiRangeExpression.cpp +++ b/source/core/util/MultiRangeExpression.cpp @@ -24,7 +24,7 @@ //------------------------------------------------------------------------------ //---------------------------------------------- MultiRangeExpression::refresh() //------------------------------------------------------------------------------ -void anna::MultiRangeExpression::refresh(void) throw() { +void anna::MultiRangeExpression::refresh(void) { anna::Tokenizer ranges, borders; anna::Tokenizer::const_iterator ranges_it, borders_it; std::string range; @@ -63,7 +63,7 @@ void anna::MultiRangeExpression::refresh(void) throw() { //------------------------------------------------------------------------------ //----------------------------------- MultiRangeExpression::getExpandedLiteral() //------------------------------------------------------------------------------ -std::string anna::MultiRangeExpression::getExpandedLiteral(void) const throw() { +std::string anna::MultiRangeExpression::getExpandedLiteral(void) const { std::string result; std::map < unsigned int, int/*dummy*/ >::const_iterator it; std::map < unsigned int, int/*dummy*/ >::const_iterator it_min(a_data.begin()); @@ -85,7 +85,7 @@ std::string anna::MultiRangeExpression::getExpandedLiteral(void) const throw() { //------------------------------------------------------------------------------ //-------------------------------------- MultiRangeExpression::simplifyLiteral() //------------------------------------------------------------------------------ -const char * anna::MultiRangeExpression::simplifyLiteral(void) throw() { +const char * anna::MultiRangeExpression::simplifyLiteral(void) { if(a_data.size() == 0) return NULL; std::map < unsigned int, int/*dummy*/ >::const_iterator it; diff --git a/source/core/util/RegularExpression.cpp b/source/core/util/RegularExpression.cpp index 8dcae56..62ef4ca 100644 --- a/source/core/util/RegularExpression.cpp +++ b/source/core/util/RegularExpression.cpp @@ -17,14 +17,14 @@ // private -void anna::RegularExpression::freeRegex() throw() { +void anna::RegularExpression::freeRegex() { if(a_compiled) { regfree(&a_preg); a_compiled = false; } } -void anna::RegularExpression::compile() throw(anna::RuntimeException) { +void anna::RegularExpression::compile() noexcept(false) { if(a_compiled) return; int ret; @@ -52,7 +52,7 @@ void anna::RegularExpression::compile() throw(anna::RuntimeException) { //------------------------------------------------------------------------------ //---------------------------------------------- RegularExpression::setPattern() //------------------------------------------------------------------------------ -void anna::RegularExpression::setPattern(const std::string & pattern) throw() { +void anna::RegularExpression::setPattern(const std::string & pattern) { if(pattern == a_pattern) return; freeRegex(); @@ -63,7 +63,7 @@ void anna::RegularExpression::setPattern(const std::string & pattern) throw() { //------------------------------------------------------------------------------ //-------------------------------------------------- RegularExpression::isLike() //------------------------------------------------------------------------------ -bool anna::RegularExpression::isLike(const std::string & value) throw() { +bool anna::RegularExpression::isLike(const std::string & value) { compile(); const bool result = (regexec(&a_preg, value.c_str(), 0, NULL, 0) == 0) ? true : false; return result; diff --git a/source/core/util/Second.cpp b/source/core/util/Second.cpp index fcf75b1..eecb909 100644 --- a/source/core/util/Second.cpp +++ b/source/core/util/Second.cpp @@ -21,12 +21,12 @@ using namespace anna; #define implement_operator(op) \ bool Second::operator op (const Millisecond& other) const \ - throw ()\ + \ {\ return a_value op (other.a_value / 1000);\ }\ bool Second::operator op (const Microsecond& other) const\ - throw ()\ + \ {\ return a_value op (other.a_value / 1000000);\ } @@ -36,13 +36,13 @@ Second::Second(const Millisecond& other) : a_value(other.a_value / 1000) {;} Second::Second(const Microsecond& other) : a_value(other.a_value / 1000000) {;} Second& Second::operator= (const Millisecond & other) -throw() { +{ a_value = (other.a_value / 1000); return *this; } Second& Second::operator= (const Microsecond & other) -throw() { +{ a_value = (other.a_value / 1000000); return *this; } @@ -53,13 +53,13 @@ implement_operator( >) implement_operator( <) string Second::asDateTime(const char* format) const -throw() { +{ char aux [DateTimeSizeString]; return string(asDateTime(aux, format)); } const char* Second::asDateTime(char* result, const char* format) const -throw() { +{ struct tm* tt = localtime((time_t*) & a_value); char aux [256]; @@ -71,7 +71,7 @@ throw() { //static Second Second::getTime() -throw() { +{ struct timeval tv; gettimeofday(&tv, NULL); return Second(tv.tv_sec); @@ -79,19 +79,19 @@ throw() { //static Second Second::getLocalTime() -throw() { +{ return Second(time(NULL)); } string Second::asString() const -throw() { +{ string result(functions::asString(a_value)); return result += " sec"; } //static Second Second::fromString(const std::string& value) -throw(RuntimeException) { +noexcept(false) { if(value.find(" sec") == string::npos) { string msg("String: "); msg += value; diff --git a/source/core/util/String.cpp b/source/core/util/String.cpp index 30a7ce5..28381de 100644 --- a/source/core/util/String.cpp +++ b/source/core/util/String.cpp @@ -18,17 +18,17 @@ using namespace std; using namespace anna; void String::toUpper() -throw() { +{ std::transform(begin(), end(), begin(), (int(*)(int)) toupper); } void String::toLower() -throw() { +{ std::transform(begin(), end(), begin(), (int(*)(int)) tolower); } String& String::operator<< (const char* vv) -throw() { +{ if(vv == NULL) { if(a_flags & Flag::ShowNull) string::operator+= (""); @@ -39,7 +39,7 @@ throw() { } String& String::operator<< (const int vv) -throw() { +{ char aux [16]; sprintf(aux, "%d", vv); string::operator+= (aux); @@ -47,7 +47,7 @@ throw() { } String& String::operator<< (const unsigned int vv) -throw() { +{ char aux [16]; sprintf(aux, "%u", vv); string::operator+= (aux); @@ -55,7 +55,7 @@ throw() { } String& String::operator<< (const S64 vv) -throw() { +{ char aux [32]; //sprintf(aux, "%lld", vv); #ifdef __anna64__ @@ -68,7 +68,7 @@ throw() { } String& String::operator<< (const U64 vv) -throw() { +{ char aux [32]; //sprintf(aux, "%llu", vv); #ifdef __anna64__ @@ -81,7 +81,7 @@ throw() { } String& String::operator<< (const float vv) -throw() { +{ char aux [64]; sprintf(aux, "%f", vv); string::operator+= (aux); @@ -89,7 +89,7 @@ throw() { } String& String::operator<< (const double vv) -throw() { +{ char aux [64]; sprintf(aux, "%e", vv); string::operator+= (aux); @@ -97,12 +97,12 @@ throw() { } String& String::operator<< (const DataBlock& vv) -throw() { +{ return *this += vv.asString(); } //static String String::format(const DataBlock& vv, const int characterByLine) -throw() { +{ return String(vv.asString(characterByLine)); } diff --git a/source/core/util/TextComposer.cpp b/source/core/util/TextComposer.cpp index 465ea49..8471655 100644 --- a/source/core/util/TextComposer.cpp +++ b/source/core/util/TextComposer.cpp @@ -44,7 +44,7 @@ TextComposer::~TextComposer() { * var2 => nombre = variable2 => "%02d el resto" */ void TextComposer::initialize() -throw(RuntimeException) { +noexcept(false) { Tokenizer variables(a_expression, "${"); Tokenizer idAndText; Tokenizer nameAndFormat; @@ -105,7 +105,7 @@ throw(RuntimeException) { } TextVariable* TextComposer::find(const char* name, const Exception::Mode::_v emode) -throw(RuntimeException) { +noexcept(false) { for(variable_iterator ii = begin(), maxii = end(); ii != maxii; ii ++) { if(anna_strcmp(textVariable(ii)->getName(), name) == 0) return textVariable(ii); @@ -125,7 +125,7 @@ throw(RuntimeException) { } String TextComposer::apply() const -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod ttmm(Logger::Local7, "TextComposer::apply", ANNA_FILE_LOCATION)); String result; // No hace falta proteger porque sólo se podrá acceder desde el Protector @@ -155,7 +155,7 @@ throw(RuntimeException) { } String TextComposer::asString() const -throw() { +{ String result("TextComposer { Id: "); result << a_id; result << " | Expression: " << a_expression; @@ -164,7 +164,7 @@ throw() { //static TextVariable::Type::_v TextComposer::calculeType(const char* format) -throw(RuntimeException) { +noexcept(false) { static const char* typeInteger = "[:digit:]*d"; static const char* typeString = "[:digit:]*s"; static const char* typeFloat = "([:digit:]*.[:digit:]|.[:digit:]*)f|f"; diff --git a/source/core/util/TextManager.cpp b/source/core/util/TextManager.cpp index 6762aeb..982ba78 100644 --- a/source/core/util/TextManager.cpp +++ b/source/core/util/TextManager.cpp @@ -22,7 +22,7 @@ TextManager::TextManager(const char* name) : } void TextManager::clear() -throw() { +{ Guard guard(*this, "TextManager::clear"); for(TextComposerVector::iterator ii = a_composers.begin(), maxii = a_composers.end(); ii != maxii; ii ++) @@ -32,7 +32,7 @@ throw() { } void TextManager::create(const int composer, const char* expression) -throw(RuntimeException) { +noexcept(false) { TextComposer* result = NULL; Guard guard(*this, "TextManager::create"); @@ -65,7 +65,7 @@ throw(RuntimeException) { } TextComposer& TextManager::find(const int composer) -throw(RuntimeException) { +noexcept(false) { TextComposer* result; Guard guard(*this, "TextManager::find"); @@ -80,18 +80,18 @@ throw(RuntimeException) { } const TextComposer& TextManager::find(const int composer) const -throw(RuntimeException) { +noexcept(false) { const TextComposer& result = const_cast (this)->find(composer); return result; } TextComposer* TextManager::createTextComposer(const int composer, const char* expression) -throw() { +{ return new TextComposer(composer, expression); } TextComposer* TextManager::xfind(const int composer) -throw() { +{ for(TextComposerVector::iterator ii = a_composers.begin(), maxii = a_composers.end(); ii != maxii; ii ++) if((*ii)->getId() == composer) { return (*ii); diff --git a/source/core/util/TextVariable.cpp b/source/core/util/TextVariable.cpp index a367376..4727f9f 100644 --- a/source/core/util/TextVariable.cpp +++ b/source/core/util/TextVariable.cpp @@ -17,7 +17,7 @@ TextVariable::TextVariable(const char* name, const Type::_v type, const anna::St } const char* TextVariable::compose(DataBlock& buffer) const -throw(RuntimeException) { +noexcept(false) { if(Variable::isNull() == true) throw RuntimeException(asString(), ANNA_FILE_LOCATION); diff --git a/source/core/util/Tokenizer.cpp b/source/core/util/Tokenizer.cpp index d49f6ed..c51cf00 100644 --- a/source/core/util/Tokenizer.cpp +++ b/source/core/util/Tokenizer.cpp @@ -58,7 +58,7 @@ Tokenizer::~Tokenizer() { } int Tokenizer::_apply(const char* str, const char* separator) -throw(RuntimeException) { +noexcept(false) { a_maxItem = 0; @@ -91,7 +91,7 @@ throw(RuntimeException) { return a_maxItem; } -int Tokenizer::apply(const char *str, const char* separator, const char *tokenizeContiguous) throw(RuntimeException) { +int Tokenizer::apply(const char *str, const char* separator, const char *tokenizeContiguous) noexcept(false) { if(str == NULL) return 0; @@ -118,7 +118,7 @@ int Tokenizer::apply(const char *str, const char* separator, const char *tokeniz } const char* Tokenizer::at(const int i) -throw(RuntimeException) { +noexcept(false) { if(i >= a_maxItem) indexException(i, ANNA_FILE_LOCATION); @@ -126,7 +126,7 @@ throw(RuntimeException) { } const char* Tokenizer::at(const int i) const -throw(RuntimeException) { +noexcept(false) { if(i >= a_maxItem) indexException(i, ANNA_FILE_LOCATION); @@ -134,7 +134,7 @@ throw(RuntimeException) { } const char* Tokenizer::last() const -throw(RuntimeException) { +noexcept(false) { if(a_maxItem == 0) throw RuntimeException("There is any token to select", ANNA_FILE_LOCATION); @@ -142,7 +142,7 @@ throw(RuntimeException) { } char* Tokenizer::strip(char* str) -throw() { +{ char* result(str); if(str != NULL) { @@ -163,7 +163,7 @@ throw() { } void Tokenizer::indexException(const int index, const char* fromFile, const int fromLine) const -throw(RuntimeException) { +noexcept(false) { string msg(functions::asString("Index %d out of range [0,%d] | Items: ", index, a_maxItem)); for(const_iterator ii = begin(), maxii = end(); ii != maxii; ii ++) { diff --git a/source/core/util/Variable.cpp b/source/core/util/Variable.cpp index 60fdd6a..3145725 100644 --- a/source/core/util/Variable.cpp +++ b/source/core/util/Variable.cpp @@ -54,35 +54,35 @@ Variable::~Variable() { } void Variable::setValue(const char* value) -throw(RuntimeException) { +noexcept(false) { verifyMatchType(Type::String, ANNA_FILE_LOCATION); a_isNull = false; *a_value.a_string = value; } void Variable::setValue(const int value) -throw(RuntimeException) { +noexcept(false) { verifyMatchType(Type::Integer, ANNA_FILE_LOCATION); a_isNull = false; *a_value.a_integer = value; } void Variable::setValue(const S64 value) -throw(RuntimeException) { +noexcept(false) { verifyMatchType(Type::Integer64, ANNA_FILE_LOCATION); a_isNull = false; *a_value.a_longInteger = value; } void Variable::setValue(const bool value) -throw(RuntimeException) { +noexcept(false) { verifyMatchType(Type::Boolean, ANNA_FILE_LOCATION); a_isNull = false; *a_value.a_boolean = value; } void Variable::setValue(const DataBlock& value) -throw(RuntimeException) { +noexcept(false) { verifyMatchType(Type::Block, ANNA_FILE_LOCATION); if(a_value.a_dataBlock->deepCopy() == false) { @@ -97,7 +97,7 @@ throw(RuntimeException) { } void Variable::setValue(const float value) -throw(RuntimeException) { +noexcept(false) { verifyMatchSomeType(Type::Float, Type::Double, ANNA_FILE_LOCATION); if(a_type == Type::Float) { @@ -110,7 +110,7 @@ throw(RuntimeException) { } void Variable::setValue(const double value) -throw(RuntimeException) { +noexcept(false) { verifyMatchSomeType(Type::Float, Type::Double, ANNA_FILE_LOCATION); if(a_type == Type::Float) { @@ -123,21 +123,21 @@ throw(RuntimeException) { } const char* Variable::getStringValue() const -throw(RuntimeException) { +noexcept(false) { verifyIsNotNull(ANNA_FILE_LOCATION); verifyMatchType(Type::String, ANNA_FILE_LOCATION); return a_value.a_string->c_str(); } int Variable::getIntegerValue() const -throw(RuntimeException) { +noexcept(false) { verifyIsNotNull(ANNA_FILE_LOCATION); verifyMatchType(Type::Integer, ANNA_FILE_LOCATION); return *a_value.a_integer; } S64 Variable::getInteger64Value() const -throw(RuntimeException) { +noexcept(false) { int result(0); verifyIsNotNull(ANNA_FILE_LOCATION); verifyMatchSomeType(Type::Integer, Type::Integer64, ANNA_FILE_LOCATION); @@ -152,21 +152,21 @@ throw(RuntimeException) { } bool Variable::getBooleanValue() const -throw(RuntimeException) { +noexcept(false) { verifyIsNotNull(ANNA_FILE_LOCATION); verifyMatchType(Type::Boolean, ANNA_FILE_LOCATION); return *a_value.a_boolean; } const DataBlock& Variable::getDataBlockValue() const -throw(RuntimeException) { +noexcept(false) { verifyIsNotNull(ANNA_FILE_LOCATION); verifyMatchType(Type::Block, ANNA_FILE_LOCATION); return *a_value.a_dataBlock; } float Variable::getFloatValue() const -throw(RuntimeException) { +noexcept(false) { float result(0.0); verifyIsNotNull(ANNA_FILE_LOCATION); verifyMatchSomeType(Type::Float, Type::Double, ANNA_FILE_LOCATION); @@ -181,7 +181,7 @@ throw(RuntimeException) { } double Variable::getDoubleValue() const -throw(RuntimeException) { +noexcept(false) { double result(0.0); verifyIsNotNull(ANNA_FILE_LOCATION); verifyMatchSomeType(Type::Float, Type::Double, ANNA_FILE_LOCATION); @@ -196,7 +196,7 @@ throw(RuntimeException) { } String Variable::asString() const -throw() { +{ String result("anna::Variable { Name: "); result << a_name; result << " | Type: " << Type::asNotNullCString(a_type); @@ -222,7 +222,7 @@ throw() { } void* Variable::buffer() const -throw() { +{ void* result(NULL); switch(a_type) { @@ -241,7 +241,7 @@ throw() { } void* Variable::getReference() const -throw() { +{ void* result(NULL); switch(a_type) { @@ -260,7 +260,7 @@ throw() { } void Variable::verifyMatchType(const Type::_v type, const char* file, const int lineno) const -throw(RuntimeException) { +noexcept(false) { if(a_type != type) { String msg("Variable: "); msg << a_name << " | " << Type::asNotNullCString(type) << " mismatch data type"; @@ -269,7 +269,7 @@ throw(RuntimeException) { } void Variable::verifyMatchSomeType(const Type::_v firstType, const Type::_v secondType, const char* file, const int lineno) const -throw(RuntimeException) { +noexcept(false) { if(a_type != firstType && a_type != secondType) { String msg("Variable: "); msg << a_name << " | Neihter " << Type::asNotNullCString(firstType); @@ -279,7 +279,7 @@ throw(RuntimeException) { } void Variable::verifyIsNotNull(const char* file, const int lineno) const -throw(RuntimeException) { +noexcept(false) { if(a_isNull == true) { String msg("Variable: "); msg << a_name << " | Variable does not have assigned value"; diff --git a/source/core/util/ZBlock.cpp b/source/core/util/ZBlock.cpp index 2bc7d21..c569f5e 100644 --- a/source/core/util/ZBlock.cpp +++ b/source/core/util/ZBlock.cpp @@ -20,7 +20,7 @@ using namespace anna; * + buffer comprimido. */ const DataBlock& ZBlock::compress(const DataBlock& data, const Mode::_v mode) -throw(RuntimeException) { +noexcept(false) { if(&data == this) throw RuntimeException("ZBlock::compress | Source and target object cannot be the same", ANNA_FILE_LOCATION); @@ -66,7 +66,7 @@ throw(RuntimeException) { } const DataBlock& ZBlock::uncompress(const DataBlock& zdata) -throw(RuntimeException) { +noexcept(false) { if(&zdata == this) throw RuntimeException("ZBlock::uncompress | Source and target object cannot be the same", ANNA_FILE_LOCATION); diff --git a/source/dbms.mysql/BaseBind.cpp b/source/dbms.mysql/BaseBind.cpp index b91ca85..92d74c5 100644 --- a/source/dbms.mysql/BaseBind.cpp +++ b/source/dbms.mysql/BaseBind.cpp @@ -45,7 +45,7 @@ dbms::mysql::BaseBind::~BaseBind() { * y el truco para recoger BLOB's http://dev.mysql.com/doc/refman/4.1/en/mysql-stmt-fetch.html. */ void dbms::mysql::BaseBind::setupBind(st_mysql_bind& bind, dbms::Data& data) -throw(RuntimeException) { +noexcept(false) { anna_memset(&bind, 0, sizeof(bind)); bind.is_null = &a_nullIndicator; a_length = 0; diff --git a/source/dbms.mysql/Connection.cpp b/source/dbms.mysql/Connection.cpp index aae802c..f32884b 100644 --- a/source/dbms.mysql/Connection.cpp +++ b/source/dbms.mysql/Connection.cpp @@ -27,7 +27,7 @@ mysql::Connection::Connection(Database& database, const std::string& name, const } void mysql::Connection::open() -throw(dbms::DatabaseException) { +noexcept(false) { if(a_mysql != NULL) { LOGWARNING( string msg = asString(); @@ -60,7 +60,7 @@ throw(dbms::DatabaseException) { } void mysql::Connection::close() -throw() { +{ LOGINFORMATION( string msg("anna::dbms::mysql::Connection::close | "); msg += asString(); @@ -79,12 +79,12 @@ throw() { } void mysql::Connection::do_commit() -throw(RuntimeException, dbms::DatabaseException) { +noexcept(false) { anna_dbms_mysql_check(mysql_commit(a_mysql), a_mysql); } void mysql::Connection::do_rollback() -throw() { +{ try { anna_dbms_mysql_check(mysql_rollback(a_mysql), a_mysql); } catch(Exception& ex) { @@ -93,7 +93,7 @@ throw() { } string mysql::Connection::asString() const -throw() { +{ string result("dbms::mysql::Connection { "); result += dbms::Connection::asString(); result += " | Context: "; diff --git a/source/dbms.mysql/Database.cpp b/source/dbms.mysql/Database.cpp index 9508158..ccc64f1 100644 --- a/source/dbms.mysql/Database.cpp +++ b/source/dbms.mysql/Database.cpp @@ -31,7 +31,7 @@ mysql::Database::Database(const char* componentName, const char* dbmsName, const } void mysql::Database::do_initialize() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tm("anna::dbms::mysql::Database", "do_initialize", ANNA_FILE_LOCATION)); dbms::Database::do_initialize(); } @@ -47,31 +47,31 @@ mysql::Database::~Database() { } dbms::Connection* mysql::Database::allocateConnection(const std::string& name, const char* user, const char* password) -throw(RuntimeException) { +noexcept(false) { return new Connection(*this, name, user, password); } dbms::Statement* mysql::Database::allocateStatement(const char* name, const std::string& expression, const bool isCritical) -throw(RuntimeException) { +noexcept(false) { return new Statement(*this, name, expression, isCritical); } dbms::InputBind* mysql::Database::allocateInputBind(const char* name, Data& data) -throw(RuntimeException) { +noexcept(false) { return new InputBind(name, data); } void mysql::Database::deallocate(dbms::InputBind* inputBind) -throw() { +{ delete(InputBind*) inputBind; } dbms::OutputBind* mysql::Database::allocateOutputBind(const char* name, Data& data) -throw(RuntimeException) { +noexcept(false) { return new OutputBind(name, data); } void mysql::Database::deallocate(dbms::OutputBind* outputBind) -throw() { +{ delete(OutputBind*) outputBind; } diff --git a/source/dbms.mysql/InputBind.cpp b/source/dbms.mysql/InputBind.cpp index edfb2d3..87ab95a 100644 --- a/source/dbms.mysql/InputBind.cpp +++ b/source/dbms.mysql/InputBind.cpp @@ -38,7 +38,7 @@ InputBind::~InputBind() { * Completa la informacion establececida por el setupBind. */ void InputBind::prepare(anna::dbms::Statement* dbmsStmt, anna::dbms::Connection*, const int pos) -throw(RuntimeException) { +noexcept(false) { st_mysql_bind* bind = static_cast (dbmsStmt)->getBindParams() + pos; Data& data = anna::dbms::Bind::getData(); BaseBind::setupBind(*bind, data); @@ -57,7 +57,7 @@ throw(RuntimeException) { * Codificar� la informaci�n C++ de forma que encaje en las estructuras requeridas por el API de MySQL. */ void InputBind::code() const -throw(RuntimeException) { +noexcept(false) { InputBind* _this = const_cast (this); Data& data = _this->getData(); @@ -93,7 +93,7 @@ throw(RuntimeException) { * a establecer en �ste m�todo. */ void InputBind::codeDate(dbms::Data& data) -throw() { +{ dbms::Date& date = static_cast (data); if(data.getType() == Data::Type::TimeStamp) { diff --git a/source/dbms.mysql/OracleTranslator.cpp b/source/dbms.mysql/OracleTranslator.cpp index 4db0d52..93be662 100644 --- a/source/dbms.mysql/OracleTranslator.cpp +++ b/source/dbms.mysql/OracleTranslator.cpp @@ -31,7 +31,7 @@ mysql::OracleTranslator mysql::OracleTranslator::st_this; * update goo set xx=? where yy=? */ const char* mysql::OracleTranslator::apply(const char* statement) -throw(RuntimeException) { +noexcept(false) { bool makeit = false; if(anna_strchr(statement, ':') != NULL) @@ -77,7 +77,7 @@ throw(RuntimeException) { } void mysql::OracleTranslator::allocate(const char* statement) -throw() { +{ const int size = anna_strlen(statement); if(size > a_size) { diff --git a/source/dbms.mysql/OutputBind.cpp b/source/dbms.mysql/OutputBind.cpp index 016b9e9..1428e30 100644 --- a/source/dbms.mysql/OutputBind.cpp +++ b/source/dbms.mysql/OutputBind.cpp @@ -39,7 +39,7 @@ OutputBind::~OutputBind() { * http://dev.mysql.com/doc/refman/4.1/en/mysql-stmt-fetch.html. */ void OutputBind::prepare(anna::dbms::Statement* dbmsStmt, anna::dbms::Connection*, const int pos) -throw(RuntimeException) { +noexcept(false) { st_mysql_bind* bind = static_cast (dbmsStmt)->getBindResults() + pos; Data& data = anna::dbms::Bind::getData(); BaseBind::setupBind(*bind, data); @@ -61,7 +61,7 @@ throw(RuntimeException) { * estructuras dbms::Data de nuestro programa C++. */ void OutputBind::decode() const -throw(RuntimeException) { +noexcept(false) { OutputBind* _this = const_cast (this); char* str; Data& data = _this->getData(); @@ -106,7 +106,7 @@ throw(RuntimeException) { } void OutputBind::do_write(const dbms::LongBlock&) const -throw(RuntimeException, dbms::DatabaseException) { +noexcept(false) { } /* @@ -116,7 +116,7 @@ throw(RuntimeException, dbms::DatabaseException) { * contenidos en la variable C++ de nuestro entorno. */ void OutputBind::decodeDate(dbms::Data& data) -throw() { +{ if(data.isNull() == true) return; @@ -140,7 +140,7 @@ throw() { * programador final. */ void OutputBind::decodeLongBlob(dbms::Data& data) const -throw(RuntimeException, dbms::DatabaseException) { +noexcept(false) { const int bufferSize = a_blob->buffer.getMaxSize(); st_mysql_bind& bind = a_blob->binds [a_blob->pos]; DataBlock& target = static_cast (data).getValue(); diff --git a/source/dbms.mysql/ResultCode.cpp b/source/dbms.mysql/ResultCode.cpp index c4e8f2d..a3a89fb 100644 --- a/source/dbms.mysql/ResultCode.cpp +++ b/source/dbms.mysql/ResultCode.cpp @@ -42,22 +42,22 @@ mysql::ResultCode::ResultCode(st_mysql_stmt* stmt) : */ bool mysql::ResultCode::ErrorDecoder::notFound(const int errorCode) const -throw() { +{ return errorCode == CR_NO_DATA; } bool mysql::ResultCode::ErrorDecoder::successful(const int errorCode) const -throw() { +{ return errorCode == 0; } bool mysql::ResultCode::ErrorDecoder::locked(const int errorCode) const -throw() { +{ return false; // No parece que haya un código de error en MySQL para identificar esta situación ¿?¿? } bool mysql::ResultCode::ErrorDecoder::lostConnection(const int errorCode) const -throw() { +{ return errorCode == CR_INVALID_CONN_HANDLE || errorCode == CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR || errorCode == CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR || errorCode == CR_SHARED_MEMORY_CONNECT_MAP_ERROR || errorCode == CR_SHARED_MEMORY_CONNECT_SET_ERROR; } diff --git a/source/dbms.mysql/Statement.cpp b/source/dbms.mysql/Statement.cpp index df18acc..3c38364 100644 --- a/source/dbms.mysql/Statement.cpp +++ b/source/dbms.mysql/Statement.cpp @@ -34,7 +34,7 @@ dbms::mysql::Statement::~Statement() { * */ void dbms::mysql::Statement::prepare(dbms::Connection* dbmsConnection) -throw(RuntimeException, dbms::DatabaseException) { +noexcept(false) { LOGMETHOD(TraceMethod tm("anna::dbms::mysql::Statement", "prepare", ANNA_FILE_LOCATION)); Connection* connection(static_cast (dbmsConnection)); //Database& dbms(static_cast (connection->getDatabase())); @@ -127,7 +127,7 @@ throw(RuntimeException, dbms::DatabaseException) { } dbms::ResultCode dbms::mysql::Statement::execute(dbms::Connection* dbmsConnection) -throw(RuntimeException, dbms::DatabaseException) { +noexcept(false) { //Connection* connection(static_cast (dbmsConnection)); for(input_iterator ii = input_begin(), maxii = input_end(); ii != maxii; ii ++) { @@ -148,7 +148,7 @@ throw(RuntimeException, dbms::DatabaseException) { * Según la información de http://dev.mysql.com/doc/refman/4.1/en/mysql-stmt-fetch.html */ bool dbms::mysql::Statement::fetch() -throw(RuntimeException, dbms::DatabaseException) { +noexcept(false) { bool result = false; switch(mysql_stmt_fetch(a_mysqlStmt)) { @@ -177,7 +177,7 @@ throw(RuntimeException, dbms::DatabaseException) { } st_mysql_bind* dbms::mysql::Statement::create(const int size, const char* whatis) -throw(RuntimeException) { +noexcept(false) { st_mysql_bind* result = NULL; if(size > 0) { diff --git a/source/dbms.mysql/internal/sccs.cpp b/source/dbms.mysql/internal/sccs.cpp index 5317de4..0e10e80 100644 --- a/source/dbms.mysql/internal/sccs.cpp +++ b/source/dbms.mysql/internal/sccs.cpp @@ -15,7 +15,7 @@ anna_define_sccs_tag_ex(dbms_mysql, dbms.mysql, 0); void anna::dbms::mysql::sccs::activate() -throw() { +{ dbms::sccs::activate(); ModuleManager::instantiate().insert(anna_use_sccs_tag(dbms_mysql), "00"); } diff --git a/source/dbms.oracle/BaseBind.cpp b/source/dbms.oracle/BaseBind.cpp index 4eb7b75..c4a8aa1 100644 --- a/source/dbms.oracle/BaseBind.cpp +++ b/source/dbms.oracle/BaseBind.cpp @@ -55,7 +55,7 @@ dbms::oracle::BaseBind::~BaseBind() { // tratamiento. // dbms::oracle::BaseBind::oci_param dbms::oracle::BaseBind::getOCIParam(dbms::oracle::Database& database, dbms::oracle::Connection* connection, dbms::Data& data) -throw(RuntimeException) { +noexcept(false) { oci_param ociparam; switch(a_type) { diff --git a/source/dbms.oracle/Connection.cpp b/source/dbms.oracle/Connection.cpp index b3cea7a..a556705 100644 --- a/source/dbms.oracle/Connection.cpp +++ b/source/dbms.oracle/Connection.cpp @@ -29,7 +29,7 @@ oracle::Connection::Connection(Database& database, const std::string& name, cons } void oracle::Connection::open() -throw(dbms::DatabaseException) { +noexcept(false) { OCIError* error = a_oracleDatabase.getErrorHandler(); if(a_context != NULL) { @@ -80,7 +80,7 @@ throw(dbms::DatabaseException) { } void oracle::Connection::close() -throw() { +{ OCIError* error = a_oracleDatabase.getErrorHandler(); try { @@ -117,13 +117,13 @@ throw() { } void oracle::Connection::do_commit() -throw(RuntimeException, dbms::DatabaseException) { +noexcept(false) { OCIError* error = a_oracleDatabase.getErrorHandler(); anna_dbms_oracle_check(OCITransCommit(a_context, error, 0), error); } void oracle::Connection::do_rollback() -throw() { +{ try { OCIError* error = a_oracleDatabase.getErrorHandler(); anna_dbms_oracle_check(OCITransRollback(a_context, error, 0), error); @@ -133,7 +133,7 @@ throw() { } string oracle::Connection::asString() const -throw() { +{ string result("dbms::oracle::Connection { "); result += dbms::Connection::asString(); result += " | Context: "; diff --git a/source/dbms.oracle/Database.cpp b/source/dbms.oracle/Database.cpp index a90785e..2ff1553 100644 --- a/source/dbms.oracle/Database.cpp +++ b/source/dbms.oracle/Database.cpp @@ -37,7 +37,7 @@ oracle::Database::Database(const char* componentName, const char* dbmsName) : } void oracle::Database::do_initialize() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tm("anna::dbms::oracle::Database", "do_initialize", ANNA_FILE_LOCATION)); if(a_env != NULL) { @@ -89,32 +89,32 @@ oracle::Database::~Database() { } dbms::Connection* oracle::Database::allocateConnection(const std::string& name, const char* user, const char* password) -throw(RuntimeException) { +noexcept(false) { return new Connection(*this, name, user, password); } dbms::Statement* oracle::Database::allocateStatement(const char* name, const std::string& expression, const bool isCritical) -throw(RuntimeException) { +noexcept(false) { return new Statement(*this, name, expression, isCritical); } dbms::InputBind* oracle::Database::allocateInputBind(const char* name, Data& data) -throw(RuntimeException) { +noexcept(false) { return new InputBind(name, data); } void oracle::Database::deallocate(dbms::InputBind* inputBind) -throw() { +{ delete(InputBind*) inputBind; } dbms::OutputBind* oracle::Database::allocateOutputBind(const char* name, Data& data) -throw(RuntimeException) { +noexcept(false) { return new OutputBind(name, data); } void oracle::Database::deallocate(dbms::OutputBind* outputBind) -throw() { +{ delete(OutputBind*) outputBind; } @@ -128,7 +128,7 @@ throw() { */ /*static*/ void oracle::Database::initializeDecimalPoint() -throw(RuntimeException) { +noexcept(false) { setlocale(LC_NUMERIC, ""); struct lconv *locale = localeconv(); diff --git a/source/dbms.oracle/Descriptor.cpp b/source/dbms.oracle/Descriptor.cpp index b7e5011..253c8e8 100644 --- a/source/dbms.oracle/Descriptor.cpp +++ b/source/dbms.oracle/Descriptor.cpp @@ -23,7 +23,7 @@ dbms::oracle::Descriptor::~Descriptor() { } void dbms::oracle::Descriptor::allocate(dbms::oracle::Database& database, dbms::oracle::Connection* connection, const int _type) -throw(RuntimeException) { +noexcept(false) { if(*reference != NULL) return; diff --git a/source/dbms.oracle/InputBind.cpp b/source/dbms.oracle/InputBind.cpp index c554843..0855a57 100644 --- a/source/dbms.oracle/InputBind.cpp +++ b/source/dbms.oracle/InputBind.cpp @@ -39,7 +39,7 @@ InputBind::~InputBind() { // comunicar con Oracle, para indicar la longitud de una variable, o su estado de nulo o // no nulo. void InputBind::prepare(dbms::Statement* dbmsStatement, dbms::Connection* connection, const int pos) -throw(RuntimeException, dbms::DatabaseException) { +noexcept(false) { if(a_ociBind != NULL) return; @@ -96,7 +96,7 @@ throw(RuntimeException, dbms::DatabaseException) { // cada base de datos se ocupen toda la complejidad de convertir los datos. //------------------------------------------------------------------------------- void InputBind::code() const -throw(RuntimeException) { +noexcept(false) { InputBind* _this = const_cast (this); Data& data = _this->getData(); @@ -138,7 +138,7 @@ throw(RuntimeException) { * Oracle (tm). */ void InputBind::codeFloat(dbms::Data& data) const -throw() { +{ dbms::Float& _float = static_cast (data); InputBind* _this = const_cast (this); char* buffer = (char*) _this->a_ofb->getData(); @@ -154,7 +154,7 @@ throw() { } void InputBind::codeShortBlock(dbms::Data& data) const -throw() { +{ const int length = static_cast (data).getSize(); InputBind* _this = const_cast (this); @@ -180,7 +180,7 @@ throw() { } void InputBind::codeDate(dbms::Data& data) const -throw(RuntimeException, dbms::DatabaseException) { +noexcept(false) { dbms::Date& date = static_cast (data); ub4 fsec(0); diff --git a/source/dbms.oracle/OutputBind.cpp b/source/dbms.oracle/OutputBind.cpp index 9b18d68..4009d9a 100644 --- a/source/dbms.oracle/OutputBind.cpp +++ b/source/dbms.oracle/OutputBind.cpp @@ -35,7 +35,7 @@ OutputBind::~OutputBind() { } void OutputBind::prepare(dbms::Statement* dbmsStatement, dbms::Connection* connection, const int pos) -throw(dbms::DatabaseException) { +noexcept(false) { if(a_ociDefine != NULL) return; @@ -86,7 +86,7 @@ throw(dbms::DatabaseException) { // (1) Truco para fijar el contenido y la longitud actual. //------------------------------------------------------------------------------- void OutputBind::decode() const -throw(RuntimeException) { +noexcept(false) { OutputBind* _this = const_cast (this); char* str; Data& data = _this->getData(); @@ -128,7 +128,7 @@ throw(RuntimeException) { } void OutputBind::decodeFloat(dbms::Data& data) const -throw(RuntimeException) { +noexcept(false) { dbms::Float& _float = static_cast (data); if(data.isNull() == true) { @@ -150,7 +150,7 @@ throw(RuntimeException) { } void OutputBind::decodeShortBlock(dbms::Data& data) const -throw(RuntimeException) { +noexcept(false) { const anna::DataBlock& constdbms(static_cast (data).getValue()); anna::DataBlock& dataBlock(const_cast (constdbms)); @@ -181,7 +181,7 @@ throw(RuntimeException) { // (1) Offset = 1 => primer caracter. //-------------------------------------------------------------------------------------------- void OutputBind::decodeLongBlock(dbms::Data& data) const -throw(RuntimeException) { +noexcept(false) { const anna::DataBlock& constdbms(static_cast (data).getValue()); anna::DataBlock& dataBlock(const_cast (constdbms)); dataBlock.clear(); @@ -223,7 +223,7 @@ throw(RuntimeException) { } void OutputBind::do_write(const dbms::LongBlock& data) const -throw(RuntimeException, dbms::DatabaseException) { +noexcept(false) { const anna::DataBlock& dataBlock = data.getValue(); if(a_blob.handle == NULL) { @@ -242,7 +242,7 @@ throw(RuntimeException, dbms::DatabaseException) { } void OutputBind::decodeDate(dbms::Data& data) const -throw(RuntimeException, dbms::DatabaseException) { +noexcept(false) { if(data.isNull() == true) return; diff --git a/source/dbms.oracle/ResultCode.cpp b/source/dbms.oracle/ResultCode.cpp index d9a2200..8003db1 100644 --- a/source/dbms.oracle/ResultCode.cpp +++ b/source/dbms.oracle/ResultCode.cpp @@ -50,16 +50,16 @@ oracle::ResultCode::ResultCode(const int status, OCIError* error) : } bool oracle::ResultCode::ErrorDecoder::notFound(const int errorCode) const -throw() { +{ return errorCode == OCI_NO_DATA; } bool oracle::ResultCode::ErrorDecoder::successful(const int errorCode) const -throw() { +{ return errorCode == OCI_SUCCESS; } bool oracle::ResultCode::ErrorDecoder::lostConnection(const int errorCode) const -throw() { +{ return errorCode == 28 || errorCode == 3113 || errorCode == 3114 || errorCode == 1012 || errorCode == 12570 || errorCode == 12571; } diff --git a/source/dbms.oracle/Statement.cpp b/source/dbms.oracle/Statement.cpp index 1cf6e8a..55c94a0 100644 --- a/source/dbms.oracle/Statement.cpp +++ b/source/dbms.oracle/Statement.cpp @@ -22,7 +22,7 @@ dbms::oracle::Statement::~Statement() { } void dbms::oracle::Statement::prepare(dbms::Connection* dbmsConnection) -throw(RuntimeException, dbms::DatabaseException) { +noexcept(false) { LOGMETHOD(TraceMethod tm("anna::dbms::oracle::Statement", "prepare", ANNA_FILE_LOCATION)); Connection* connection(static_cast (dbmsConnection)); Database& dbms(static_cast (connection->getDatabase())); @@ -54,7 +54,7 @@ throw(RuntimeException, dbms::DatabaseException) { } dbms::ResultCode dbms::oracle::Statement::execute(dbms::Connection* dbmsConnection) -throw(RuntimeException, dbms::DatabaseException) { +noexcept(false) { Connection* connection(static_cast (dbmsConnection)); for(input_iterator ii = input_begin(), maxii = input_end(); ii != maxii; ii ++) { @@ -95,7 +95,7 @@ throw(RuntimeException, dbms::DatabaseException) { // 'fetch' para obtener los datos, pero en Oracle, la primera llamada no har�nada. //------------------------------------------------------------------------------------------------- bool dbms::oracle::Statement::fetch() -throw(RuntimeException, dbms::DatabaseException) { +noexcept(false) { bool result; if(a_firstFetch == true) { // (1) diff --git a/source/dbms.oracle/internal/sccs.cpp b/source/dbms.oracle/internal/sccs.cpp index aa19165..755936a 100644 --- a/source/dbms.oracle/internal/sccs.cpp +++ b/source/dbms.oracle/internal/sccs.cpp @@ -15,7 +15,7 @@ anna_define_sccs_tag_ex(dbms_oracle, dbms.oracle, 1); void anna::dbms::oracle::sccs::activate() -throw() { +{ dbms::sccs::activate(); ModuleManager::instantiate().insert(anna_use_sccs_tag(dbms_oracle), "00"); } diff --git a/source/dbms/Bind.cpp b/source/dbms/Bind.cpp index b54cdbe..ae2cb13 100644 --- a/source/dbms/Bind.cpp +++ b/source/dbms/Bind.cpp @@ -12,7 +12,7 @@ using namespace anna; std::string dbms::Bind::asString() const -throw() { +{ std::string result("dbms::Bind { Name: "); result += a_name; result += " | "; diff --git a/source/dbms/Connection.cpp b/source/dbms/Connection.cpp index 9dcdcb5..a6cda56 100644 --- a/source/dbms/Connection.cpp +++ b/source/dbms/Connection.cpp @@ -24,7 +24,7 @@ using namespace anna; // (1) Si no tiene variables de salida => consideramos que es un update, insert o delete. //----------------------------------------------------------------------------------------------------------- dbms::ResultCode dbms::Connection::execute(Statement* statement) -throw(RuntimeException, dbms::DatabaseException) { +noexcept(false) { if(statement == NULL) { string msg(asString()); msg += " | Cannot execute a NULL sentence"; @@ -110,7 +110,7 @@ throw(RuntimeException, dbms::DatabaseException) { // y los volcados de contexto. //------------------------------------------------------------------------------------------------ void dbms::Connection::commit() -throw(RuntimeException, dbms::DatabaseException) { +noexcept(false) { LOGINFORMATION( string msg("dbms::Connection::commit | "); msg += asString(); @@ -133,7 +133,7 @@ throw(RuntimeException, dbms::DatabaseException) { // y los volcados de contexto. //------------------------------------------------------------------------------------------------ void dbms::Connection::rollback() -throw() { +{ LOGWARNING( string msg("dbms::Connection::rollback | "); msg += asString(); @@ -152,7 +152,7 @@ throw() { } void dbms::Connection::lock() -throw(RuntimeException) { +noexcept(false) { if(isAvailable() == false) { string msg(asString()); msg += " | Unavailable connection"; @@ -181,7 +181,7 @@ throw(RuntimeException) { } void dbms::Connection::unlock() -throw() { +{ LOGDEBUG( string msg("dbms::Connection::unlock | "); msg += asString(); @@ -205,7 +205,7 @@ throw() { } string dbms::Connection::asString() const -throw() { +{ string result("dbms::Connection { "); result += comm::Resource::asString(); result += " | "; @@ -219,7 +219,7 @@ throw() { } xml::Node* dbms::Connection::asXML(xml::Node* parent) const -throw() { +{ xml::Node* result = comm::Resource::asXML(parent); result->createAttribute("User", a_user); result->createAttribute("LockingCounter", a_lockingCounter); diff --git a/source/dbms/Data.cpp b/source/dbms/Data.cpp index 3e75b0f..976fe49 100644 --- a/source/dbms/Data.cpp +++ b/source/dbms/Data.cpp @@ -13,7 +13,7 @@ using namespace anna; std::string dbms::Data::asString() const -throw() { +{ static const char* typeName [] = { "Integer", "String", "Float", "ShortBlock", "LongBlock", "Date", "TimeStamp" }; std::string result("dbms::Data { Type: "); result += typeName [a_type]; diff --git a/source/dbms/Database.cpp b/source/dbms/Database.cpp index 987038f..4349d7e 100644 --- a/source/dbms/Database.cpp +++ b/source/dbms/Database.cpp @@ -44,7 +44,7 @@ Database::~Database() { } void Database::do_initialize() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tm("dbms::Database", "do_initialize", ANNA_FILE_LOCATION)); int counter(0); bool error = false; @@ -71,7 +71,7 @@ throw(RuntimeException) { } void Database::do_stop() -throw() { +{ LOGMETHOD(TraceMethod tm("dbms::Database", "do_stop", ANNA_FILE_LOCATION)); try { @@ -96,7 +96,7 @@ throw() { * padre) y se abre una nueva conexion con los mismos parametros y contra la misma base de datos. */ void Database::do_cloneChild() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tm("dbms::Database", "do_cloneChild", ANNA_FILE_LOCATION)); for(connection_iterator ii = connection_begin(), maxii = connection_end(); ii != maxii; ii ++) { @@ -111,7 +111,7 @@ throw(RuntimeException) { } Connection* Database::createConnection(const char* name, const char* user, const char* password) -throw(RuntimeException, DatabaseException) { +noexcept(false) { Guard guard(this, "dbms::Database (createConnection)"); if(a_connections.size() >= MaxConnection) { @@ -169,7 +169,7 @@ throw(RuntimeException, DatabaseException) { } Connection& Database::findConnection(const char* name) -throw(RuntimeException) { +noexcept(false) { Guard guard(this, "dbms::Database (findConnection)"); Connection* result = NULL; @@ -207,7 +207,7 @@ throw(RuntimeException) { } Statement* Database::createStatement(const char* name, const char* expression, const bool isCritical) -throw(RuntimeException) { +noexcept(false) { if(findStatement(name) != NULL) throw RuntimeException(functions::asString("Sentence: %s | Name already in use", name), ANNA_FILE_LOCATION); @@ -232,7 +232,7 @@ throw(RuntimeException) { } Statement* Database::findStatement(const char* name) -throw() { +{ Guard guard(this, "dbms::Database::findStatement"); vector ::iterator ii, maxii; Statement* result(NULL); @@ -248,7 +248,7 @@ throw() { } void Database::releaseStatement(Statement* statement) -throw() { +{ if(statement == NULL) { Logger::write(Logger::Warning, asString(), "Cannot release a NULL SQL sentence", ANNA_FILE_LOCATION); return; @@ -270,7 +270,7 @@ throw() { } void Database::recover(Connection& connection, const int tryCounter) -throw(RuntimeException) { +noexcept(false) { try { connection.close(); connection.open(); @@ -283,7 +283,7 @@ throw(RuntimeException) { } string Database::asString() const -throw() { +{ string result("dbms::Database { "); result += Component::asString(); @@ -298,7 +298,7 @@ throw() { } xml::Node* Database::asXML(xml::Node* parent) const -throw() { +{ parent = Component::asXML(parent); xml::Node* result = parent->createChild("dbms.Database"); xml::Node* node; diff --git a/source/dbms/Date.cpp b/source/dbms/Date.cpp index 5c9afaf..f8811e4 100644 --- a/source/dbms/Date.cpp +++ b/source/dbms/Date.cpp @@ -47,7 +47,7 @@ Date::~Date() { } const char* dbms::Date::getCStringValue() const -throw() { +{ const char* format; if((format = a_format) == NULL) @@ -57,7 +57,7 @@ throw() { } Date& Date::operator = (const Date & other) -throw(RuntimeException) { +noexcept(false) { if(this != &other) { if(other.isNull() == true) { setNull(true); @@ -72,7 +72,7 @@ throw(RuntimeException) { } void Date::setValue(const char* str) -throw(RuntimeException) { +noexcept(false) { if(a_format == NULL) { string msg(asString()); msg += " | anna::dbms::Data::setValue (const char*) requires format especification"; @@ -95,7 +95,7 @@ throw(RuntimeException) { } void Date::setValue(const Second &second) -throw(RuntimeException) { +noexcept(false) { tm* aux = localtime((time_t*) & second); if(aux == NULL) { @@ -110,7 +110,7 @@ throw(RuntimeException) { } void dbms::Date::set(const char* what, int& variable, const int value, const int min, const int max) -throw(RuntimeException) { +noexcept(false) { if(value < min) { string msg(what); msg += functions::asText(" must be greater than or equal to ", min); @@ -128,7 +128,7 @@ throw(RuntimeException) { } string dbms::Date::asString() const -throw() { +{ const char* cstring; string result("dbms::Date { "); result += dbms::Data::asString(); diff --git a/source/dbms/Delivery.cpp b/source/dbms/Delivery.cpp index 8ae88e4..5430a32 100644 --- a/source/dbms/Delivery.cpp +++ b/source/dbms/Delivery.cpp @@ -17,7 +17,7 @@ using namespace std; using namespace anna; void dbms::Delivery::createConnections(dbms::Database& database, const char* prefixName, const char* user, const char* password, const int n) -throw(RuntimeException, dbms::DatabaseException) { +noexcept(false) { string name; for(int i = 0; i < n; i ++) { @@ -30,7 +30,7 @@ throw(RuntimeException, dbms::DatabaseException) { } dbms::Connection& dbms::Delivery::getConnection() -throw(RuntimeException) { +noexcept(false) { return *(static_cast (comm::Delivery::apply())); } @@ -40,7 +40,7 @@ throw(RuntimeException) { // (0) Si no hay registrada ninguna conexion //-------------------------------------------------------------------------------------------------- comm::Resource* dbms::Delivery::do_apply() -throw(RuntimeException) { +noexcept(false) { iterator maxii = end(); if(a_iiConnection == maxii) // (0) diff --git a/source/dbms/Float.cc.new b/source/dbms/Float.cc.new index 92ffbac..7fe21ec 100644 --- a/source/dbms/Float.cc.new +++ b/source/dbms/Float.cc.new @@ -8,7 +8,7 @@ using namespace anna; using namespace anna::dbms; std::string dbms::Float::asString () const - throw () + { std::string result ("dbms::Float { "); result += dbms::Data::asString (); diff --git a/source/dbms/Float.cpp b/source/dbms/Float.cpp index 7f4185d..dca026e 100644 --- a/source/dbms/Float.cpp +++ b/source/dbms/Float.cpp @@ -16,7 +16,7 @@ using namespace anna; using namespace anna::dbms; std::string dbms::Float::asString() const -throw() { +{ std::string result("dbms::Float { "); result += dbms::Data::asString(); result += " | Value: "; diff --git a/source/dbms/Integer.cpp b/source/dbms/Integer.cpp index 605a20b..d183a6e 100644 --- a/source/dbms/Integer.cpp +++ b/source/dbms/Integer.cpp @@ -13,7 +13,7 @@ using namespace anna; std::string dbms::Integer::asString() const -throw() { +{ std::string result("dbms::Integer { "); result += dbms::Data::asString(); result += " | Valor: "; diff --git a/source/dbms/LongBlock.cpp b/source/dbms/LongBlock.cpp index da1796a..09f1146 100644 --- a/source/dbms/LongBlock.cpp +++ b/source/dbms/LongBlock.cpp @@ -13,7 +13,7 @@ using namespace anna; dbms::LongBlock& dbms::LongBlock::operator = (const dbms::LongBlock & other) -throw(RuntimeException) { +noexcept(false) { if(this == &other) return *this; @@ -26,14 +26,14 @@ throw(RuntimeException) { } dbms::LongBlock& dbms::LongBlock::operator = (const anna::DataBlock & value) -throw(RuntimeException) { +noexcept(false) { a_value = value; setNull(a_value.isEmpty()); return *this; } std::string dbms::LongBlock::asString() const -throw() { +{ std::string result("dbms::LongBlock { "); result += dbms::Data::asString(); result += " | Size: "; diff --git a/source/dbms/OutputBind.cpp b/source/dbms/OutputBind.cpp index 53e6b23..2415916 100644 --- a/source/dbms/OutputBind.cpp +++ b/source/dbms/OutputBind.cpp @@ -16,7 +16,7 @@ using namespace anna; using namespace std; void dbms::OutputBind::write() const -throw(RuntimeException, dbms::DatabaseException) { +noexcept(false) { const dbms::Data& data = Bind::getData(); if(data.getType() != Data::Type::LongBlock) { diff --git a/source/dbms/ResultCode.cpp b/source/dbms/ResultCode.cpp index 453f78b..4a93752 100644 --- a/source/dbms/ResultCode.cpp +++ b/source/dbms/ResultCode.cpp @@ -14,7 +14,7 @@ using namespace std; using namespace anna::dbms; bool ResultCode::notFound() const -throw(anna::RuntimeException) { +noexcept(false) { if(a_errorDecoder == NULL) { string msg(asString()); msg += " | Has no decoder for associated error"; @@ -25,7 +25,7 @@ throw(anna::RuntimeException) { } bool ResultCode::successful() const -throw(anna::RuntimeException) { +noexcept(false) { if(a_errorDecoder == NULL) { string msg(asString()); msg += " | Has no decoder for associated error"; @@ -36,7 +36,7 @@ throw(anna::RuntimeException) { } bool ResultCode::locked() const -throw(anna::RuntimeException) { +noexcept(false) { if(a_errorDecoder == NULL) { string msg(asString()); msg += " | Has no decoder for associated error"; @@ -47,7 +47,7 @@ throw(anna::RuntimeException) { } bool ResultCode::lostConnection() const -throw(anna::RuntimeException) { +noexcept(false) { if(a_errorDecoder == NULL) { string msg(asString()); msg += " | Has no decoder for associated error"; @@ -62,7 +62,7 @@ throw(anna::RuntimeException) { // correcta => no hará falta reservar ninguna memoria. // void ResultCode::copy(const char* text) -throw() { +{ if(text == NULL) { if(a_errorText != NULL) { free(a_errorText); @@ -88,7 +88,7 @@ throw() { } std::string ResultCode::asString() const -throw() { +{ std::string result("dbms::ResultCode { Error: "); result += functions::asString(a_errorCode); result += " | Error: "; diff --git a/source/dbms/Sentence.cpp b/source/dbms/Sentence.cpp index 34dfaf3..5ab68be 100644 --- a/source/dbms/Sentence.cpp +++ b/source/dbms/Sentence.cpp @@ -18,13 +18,13 @@ using namespace std; using namespace anna; const string& dbms::Sentence::getName() const -throw() { +{ static string empty; return (a_dbStatement == NULL) ? empty : a_dbStatement->getName(); } void dbms::Sentence::initialize(dbms::Database& database) -throw(RuntimeException) { +noexcept(false) { Guard guard(this, "anna::dbms::Sentence (initialize)"); a_dbStatement = do_initialize(database); } @@ -34,7 +34,7 @@ throw(RuntimeException) { // activa externamente ... para recoger datos multiples, etc, etc. //------------------------------------------------------------------------------------- dbms::ResultCode dbms::Sentence::execute(dbms::Connection& connection, dbms::Statement* statement) -throw(RuntimeException) { +noexcept(false) { using namespace anna::dbms; ResultCode result; @@ -59,7 +59,7 @@ throw(RuntimeException) { } bool dbms::Sentence::fetch() -throw(RuntimeException) { +noexcept(false) { bool result = false; try { @@ -73,7 +73,7 @@ throw(RuntimeException) { string dbms::Sentence::asString() const /*virtual*/ -throw() { +{ string result("dbms::Sentence { Mode: "); result += (a_mode == Mode::SilentWhenNotFound) ? "SilentWhenNotFound" : "ExceptionWhenNotFound"; result += " | "; @@ -88,7 +88,7 @@ throw() { /*virtual*/ xml::Node* dbms::Sentence::asXML(xml::Node* parent) const -throw() { +{ xml::Node* result = parent->createChild("dbms.Sentence"); result->createAttribute("Mode", (a_mode == Mode::SilentWhenNotFound) ? "SilentWhenNotFound" : "ExceptionWhenNotFound"); diff --git a/source/dbms/ShortBlock.cpp b/source/dbms/ShortBlock.cpp index a47de5f..867ce5a 100644 --- a/source/dbms/ShortBlock.cpp +++ b/source/dbms/ShortBlock.cpp @@ -13,7 +13,7 @@ using namespace anna; dbms::ShortBlock& dbms::ShortBlock::operator = (const dbms::ShortBlock & other) -throw(RuntimeException) { +noexcept(false) { if(this == &other) return *this; @@ -26,7 +26,7 @@ throw(RuntimeException) { } dbms::ShortBlock& dbms::ShortBlock::operator = (const anna::DataBlock & value) -throw(RuntimeException) { +noexcept(false) { if(value.getSize() > Data::getMaxSize()) { throw RuntimeException( functions::asString( @@ -42,7 +42,7 @@ throw(RuntimeException) { } std::string dbms::ShortBlock::asString() const -throw() { +{ std::string result("dbms::ShortBlock { "); result += dbms::Data::asString(); result += " | Value: "; diff --git a/source/dbms/Statement.cpp b/source/dbms/Statement.cpp index e2895e0..52c9b60 100644 --- a/source/dbms/Statement.cpp +++ b/source/dbms/Statement.cpp @@ -38,7 +38,7 @@ Statement::~Statement() { } string Statement::asString() const -throw() { +{ string result("dbms::Statement { Nombre: "); result += a_name; result += functions::asText(" | Var.Entrada: ", input_size()); @@ -51,7 +51,7 @@ throw() { } xml::Node* dbms::Statement::asXML(xml::Node* parent) const -throw() { +{ xml::Node* result = parent->createChild("dbms.Statement"); result->createAttribute("Name", a_name); xml::Node* node = result->createChild("Timing"); @@ -63,24 +63,24 @@ throw() { } void Statement::bindInput(const char* name, Data& data) -throw() { +{ a_inputBinds.push_back(a_database.allocateInputBind(name, data)); } const OutputBind* Statement::bindOutput(const char* name, Data& i) -throw() { +{ OutputBind* result = a_database.allocateOutputBind(name, i); a_outputBinds.push_back(result); return result; } Data& Statement::input(input_iterator& ii) -throw() { +{ return (*ii)->getData(); } Data& Statement::output(output_iterator& ii) -throw() { +{ return (*ii)->getData(); } diff --git a/source/dbms/String.cpp b/source/dbms/String.cpp index 2e7e6fb..dc3af03 100644 --- a/source/dbms/String.cpp +++ b/source/dbms/String.cpp @@ -12,7 +12,7 @@ using namespace anna; using namespace anna::dbms; String& String::operator = (const String & other) -throw(RuntimeException) { +noexcept(false) { if(this == &other) return *this; @@ -26,7 +26,7 @@ throw(RuntimeException) { } String& String::operator = (const char * str) -throw(RuntimeException) { +noexcept(false) { if(a_value != str) { if(anna_strlen(str) > Data::getMaxSize()) throw RuntimeException( @@ -42,7 +42,7 @@ throw(RuntimeException) { } char* String::strip(char *str) -throw() { +{ int len; if(str == NULL || (len = anna_strlen(str)) == 0) @@ -59,7 +59,7 @@ throw() { } std::string dbms::String::asString() const -throw() { +{ std::string result("dbms::String { "); result += dbms::Data::asString(); result += " | Value: "; diff --git a/source/dbms/TimeStamp.cpp b/source/dbms/TimeStamp.cpp index 7cfe654..784d350 100644 --- a/source/dbms/TimeStamp.cpp +++ b/source/dbms/TimeStamp.cpp @@ -18,7 +18,7 @@ using namespace anna; using namespace anna::dbms; const char* dbms::TimeStamp::getCStringValue() const -throw() { +{ const char* format; if((format = a_format) == NULL) diff --git a/source/dbms/functions.cpp b/source/dbms/functions.cpp index 97a4e88..af3c662 100644 --- a/source/dbms/functions.cpp +++ b/source/dbms/functions.cpp @@ -19,7 +19,7 @@ using namespace anna; /*static*/ void dbms::functions::verifyDataScheme(dbms::Connection& connection, const char* tableName, const char* requiredPatch, const char* columnID, const char* columnDate) -throw(RuntimeException) { +noexcept(false) { dbms::Database& database = connection.getDatabase(); dbms::Statement* statement = NULL; dbms::String id(8); diff --git a/source/dbms/internal/sccs.cpp b/source/dbms/internal/sccs.cpp index 313df2c..85d56b5 100644 --- a/source/dbms/internal/sccs.cpp +++ b/source/dbms/internal/sccs.cpp @@ -18,7 +18,7 @@ anna_define_sccs_tag(dbms, 2); void anna::dbms::sccs::activate() -throw() { +{ anna::sccs::activate(); xml::sccs::activate(); app::sccs::activate(); diff --git a/source/dbos/Accesor.cpp b/source/dbos/Accesor.cpp index f77d2aa..2a34b23 100644 --- a/source/dbos/Accesor.cpp +++ b/source/dbos/Accesor.cpp @@ -32,7 +32,7 @@ dbos::Accesor::~Accesor() { // Slo habr�que invocar al 'fetch' para coger los siguientes registros' //------------------------------------------------------------------------------------------ bool dbos::Accesor::load(dbms::Connection* connection, const dbos::StorageArea* ssaa) -throw(RuntimeException, dbms::DatabaseException) { +noexcept(false) { if(connection == NULL) { std::string msg(ssaa->asString()); diff --git a/source/dbos/Repository.cpp b/source/dbos/Repository.cpp index 49dd961..0e146a4 100644 --- a/source/dbos/Repository.cpp +++ b/source/dbos/Repository.cpp @@ -31,7 +31,7 @@ dbos::Repository::Repository(const std::string& name) : } dbos::StorageArea* dbos::Repository::createStorageArea(const dbos::StorageId index, const char* name, const dbos::Size maxSize, dbos::ObjectAllocator objectAllocator, const int errorCode, const StorageArea::AccessMode::_v accessMode) -throw(RuntimeException) { +noexcept(false) { Guard guard(this, "dbos::Repository from createStorageArea"); storage_iterator ii = a_storageAreas.find(index) ; @@ -54,14 +54,14 @@ throw(RuntimeException) { } dbos::StorageArea* dbos::Repository::findStorageArea(const dbos::StorageId index) -throw() { +{ Guard guard(this, "dbos::Repository from findStorageArea"); storage_iterator ii = a_storageAreas.find(index); return (ii != a_storageAreas.end()) ? storageArea(ii) : NULL; } void dbos::Repository::clear() -throw(RuntimeException) { +noexcept(false) { Guard guard(this, "dbos::Repository from clear"); LOGWARNING( string msg("dbos::Repository::clear | Name: "); @@ -74,7 +74,7 @@ throw(RuntimeException) { } xml::Node* dbos::Repository::asXML(xml::Node* parent) const -throw() { +{ xml::Node* result = parent->createChild("dbos.Repository"); dbos::Size maxSize(0); dbos::Size size(0); diff --git a/source/dbos/StorageArea.cpp b/source/dbos/StorageArea.cpp index 830f647..66ee16b 100644 --- a/source/dbos/StorageArea.cpp +++ b/source/dbos/StorageArea.cpp @@ -58,7 +58,7 @@ StorageArea::~StorageArea() { // caso se ha reusado. //------------------------------------------------------------------------------------------------ Object* StorageArea::instance(Connection* connection, Loader& loader) -throw(RuntimeException, DatabaseException) { +noexcept(false) { const Index index = loader.getIndex(); Object* result(NULL); Instance* instance(NULL); @@ -157,7 +157,7 @@ throw(RuntimeException, DatabaseException) { } Object* StorageArea::instance(Connection* connection, CrossedLoader& crossedLoader, Loader& loader) -throw(RuntimeException, DatabaseException) { +noexcept(false) { Object* result = NULL; crossedLoader.a_connection = connection; // Si el seek devuelve 'true' es que ya tiene cargada la correspondencia entre la clave alternativa y la @@ -183,7 +183,7 @@ throw(RuntimeException, DatabaseException) { // Crea un nuevo objeto en el area de almacenamiento. //------------------------------------------------------------------------- Object* StorageArea::create(Connection* connection, Creator& creator) -throw(RuntimeException, DatabaseException) { +noexcept(false) { const Index index = creator.getIndex(); Instance* instance = NULL; Object* result = NULL; @@ -266,7 +266,7 @@ throw(RuntimeException, DatabaseException) { // lo sacamos de ah� //------------------------------------------------------------------------- Object* StorageArea::find(Loader& loader) -throw(RuntimeException) { +noexcept(false) { const Index index = loader.getIndex(); Instance* instance = NULL; Object* result = NULL; @@ -303,7 +303,7 @@ throw(RuntimeException) { } Object* StorageArea::duplicate(const Object* object) -throw(RuntimeException) { +noexcept(false) { if(object == NULL) return NULL; std::string name("dbos::StorageArea::duplicate with "); @@ -336,7 +336,7 @@ throw(RuntimeException) { } bool StorageArea::isLoaded(const Loader& loader) -throw(RuntimeException) { +noexcept(false) { const Index index = loader.getIndex(); std::string name("dbos::StorageArea::isLoaded with "); name += typeid(loader).name(); @@ -356,7 +356,7 @@ throw(RuntimeException) { } void StorageArea::apply(Connection& connection, Recorder& recorder) -throw(RuntimeException, DatabaseException) { +noexcept(false) { ResultCode resultCode = connection.execute(recorder.getStatement()); if(resultCode.successful() == false) @@ -373,7 +373,7 @@ throw(RuntimeException, DatabaseException) { // instancia en cuanto pueda. //------------------------------------------------------------------------------------------------ void StorageArea::apply(Connection& connection, Eraser& eraser) -throw(RuntimeException, DatabaseException) { +noexcept(false) { if(a_accessMode == AccessMode::ReadOnly) { string msg(asString()); msg += " | Cannot erase object with AccessMode::ReadOnly"; @@ -424,7 +424,7 @@ throw(RuntimeException, DatabaseException) { // memoria alcance un numero tal que implique comenzar a reusar objetos liberados. //------------------------------------------------------------------------------------------------ void StorageArea::release(Object** object) -throw(RuntimeException) { +noexcept(false) { if(object == NULL) return; if(*object == NULL) return; @@ -468,7 +468,7 @@ throw(RuntimeException) { // si fuera necesario invocara al 'destroy'. //------------------------------------------------------------------------------------------------ void StorageArea::erase(Object** object) -throw(RuntimeException) { +noexcept(false) { if(object == NULL) return; if(*object == NULL) return; @@ -505,7 +505,7 @@ throw(RuntimeException) { } void StorageArea::dirty(Object* object) -throw(RuntimeException) { +noexcept(false) { if(object == NULL) return; std::string name("dbos::StorageArea::dirty with "); @@ -544,7 +544,7 @@ throw(RuntimeException) { // expulsarla de cache. //-------------------------------------------------------------------------------------------- void StorageArea::clear() -throw(RuntimeException) { +noexcept(false) { Guard guard(this, "dbos::StorageArea::clear"); Instance* instance; int n = 0; @@ -594,7 +594,7 @@ throw(RuntimeException) { // y se libera su memoria. //--------------------------------------------------------------------------------------------------- Object* StorageArea::reload(dbms::Connection* connection, Loader& loader, StorageArea::Instance* instance) -throw(RuntimeException, dbms::DatabaseException) { +noexcept(false) { const bool enableUpdate = (instance->flags & Flag::Dirty) ? true : instance->object->enableUpdate(); bool hasChanges(false); @@ -658,7 +658,7 @@ throw(RuntimeException, dbms::DatabaseException) { // a instanciar, etc, etc //------------------------------------------------------------------------------------------------ void StorageArea::checkIncoherence(StorageArea::Instance* instance) -throw() { +{ if(quickReusing(instance) == true) { LOGWARNING( string msg("dbos::StorageArea::checkIncoherence | "); @@ -693,7 +693,7 @@ throw() { // esta, cambiarle el msHoleTime y volverlo a grabar. //------------------------------------------------------------------------------------------------ bool StorageArea::quickReusing(StorageArea::Instance* instance) -throw() { +{ bool result(false); if(a_holes.insert(instance, Holes::Mode::ReadyToReuse) == true) { // (1) @@ -722,7 +722,7 @@ throw() { } void StorageArea::verifyStatus(StorageArea::Instance* instance, const bool ignoreDirty) -throw(RuntimeException) { +noexcept(false) { if(instance->flags & Flag::Incoherent) { string msg(asString()); msg += " | "; @@ -757,7 +757,7 @@ throw(RuntimeException) { } string StorageArea::asString() const -throw() { +{ string result("dbos::StorageArea { Name: "); const int ratio = (a_hit == 0) ? 0 : (a_hit * 100) / (a_fault + a_hit); /* Nº real de objetos en uso. En el directorio también se mantienen los que tienen la cuenta de utilización a 0 */ @@ -785,7 +785,7 @@ throw() { } xml::Node* StorageArea::asXML(xml::Node* parent) const -throw() { +{ xml::Node* result = parent->createChild("dbos.StorageArea"); xml::Node* node; const int ratio = (a_hit == 0) ? 0 : (a_hit * 100) / (a_fault + a_hit); @@ -808,7 +808,7 @@ throw() { } string StorageArea::asMemorySize(const Size size) -throw() { +{ string result; if(size < 1024) { @@ -825,7 +825,7 @@ throw() { } StorageArea::Instance* StorageArea::allocate() -throw() { +{ Instance* result = NULL; if((result = reuse()) == NULL) { @@ -858,7 +858,7 @@ throw() { // (2) Si el primero de los registros disponibles no es suficientemente antiguo => no hay huecos libres //----------------------------------------------------------------------------------------------------- StorageArea::Instance* StorageArea::reuse() -throw() { +{ if(a_holes.empty() == true) return NULL; @@ -913,7 +913,7 @@ throw() { } std::string StorageArea::asString(const Instance* instance) -throw() { +{ std::string result("Instance { "); if(instance == NULL) @@ -955,7 +955,7 @@ throw() { } const char* StorageArea::AccessMode::asString(const AccessMode::_v v) -throw() { +{ static const char* text [] = { "ReadOnly", "ReadWrite", "ReadEver" }; return text [v]; } @@ -973,7 +973,7 @@ StorageArea::Block::Block(ObjectAllocator objectAllocator, const Size maxSize) : } bool StorageArea::Holes::insert(Instance* instance, const StorageArea::Holes::Mode::_v mode) -throw() { +{ if(instance->copyCounter > 0) return false; @@ -1007,7 +1007,7 @@ throw() { } void StorageArea::Holes::erase(Instance* instance) -throw() { +{ // instance->msHoleTime = 0; instance->flags |= Flag::Ready; diff --git a/source/dbos/internal/sccs.cpp b/source/dbos/internal/sccs.cpp index 9c2905d..57e6945 100644 --- a/source/dbos/internal/sccs.cpp +++ b/source/dbos/internal/sccs.cpp @@ -16,7 +16,7 @@ anna_define_sccs_tag(dbos, 1); void anna::dbos::sccs::activate() -throw() { +{ dbms::sccs::activate(); ModuleManager::instantiate().insert(anna_use_sccs_tag(dbos), "00"); } diff --git a/source/diameter.comm/ApplicationMessageOamModule.cpp b/source/diameter.comm/ApplicationMessageOamModule.cpp index 5511db9..8f3dfa0 100644 --- a/source/diameter.comm/ApplicationMessageOamModule.cpp +++ b/source/diameter.comm/ApplicationMessageOamModule.cpp @@ -36,7 +36,7 @@ anna_assign_enum(anna::diameter::comm::ApplicationMessageOamModule::Counter) = { NULL /* list end indicator */ }; -void anna::diameter::comm::ApplicationMessageOamModule::createStackCounterScope(int scopeId, unsigned int stackId) throw(anna::RuntimeException) { +void anna::diameter::comm::ApplicationMessageOamModule::createStackCounterScope(int scopeId, unsigned int stackId) noexcept(false) { initializeCounterScope(scopeId, anna::functions::asString("Application Message Events for stack id %lu", stackId)); @@ -47,7 +47,7 @@ void anna::diameter::comm::ApplicationMessageOamModule::createStackCounterScope( a_stackMap[stackId] = scopeId; } -void anna::diameter::comm::ApplicationMessageOamModule::count (int messageCode, int resultCode, unsigned int stackId, const int & type, const int & amount) throw(anna::RuntimeException) { +void anna::diameter::comm::ApplicationMessageOamModule::count (int messageCode, int resultCode, unsigned int stackId, const int & type, const int & amount) noexcept(false) { // Optimization: // Checkings diff --git a/source/diameter.comm/ClassCode.cpp b/source/diameter.comm/ClassCode.cpp index 40d2c37..6f75663 100644 --- a/source/diameter.comm/ClassCode.cpp +++ b/source/diameter.comm/ClassCode.cpp @@ -12,14 +12,14 @@ using namespace std; //string anna::diameter::comm::ClassCode::asString(const ClassCode::_v v) -//throw() { +//{ // static const char* text [] = { "Undefined", "Bind", "ApplicationMessage" }; // string result("ClassCode: "); // return result += (v >= Min && v < Max) ? text [v] : "[null]"; //} string anna::diameter::comm::ClassCode::asText(const ClassCode::_v v) -throw() { +{ static const char* text [] = { "Undefined", "Bind", "ApplicationMessage" }; return string((v >= Min && v < Max) ? text [v] : "[null]"); } diff --git a/source/diameter.comm/ClientSession.cpp b/source/diameter.comm/ClientSession.cpp index c624155..fa4a9c3 100644 --- a/source/diameter.comm/ClientSession.cpp +++ b/source/diameter.comm/ClientSession.cpp @@ -57,7 +57,7 @@ ClientSession::ClientSession() : Session("diameter::comm::ClientSession", "Diame { initialize(); } -void ClientSession::initialize() throw() { +void ClientSession::initialize() { Session::initialize(); a_autoRecovery = true; a_parent = NULL; @@ -69,22 +69,22 @@ void ClientSession::initialize() throw() { //ClientSession::~ClientSession() {;} -const std::string& ClientSession::getAddress() const throw() { +const std::string& ClientSession::getAddress() const { return a_parent->getAddress(); } -int ClientSession::getPort() const throw() { +int ClientSession::getPort() const { return a_parent->getPort(); } -void ClientSession::setState(State::_v state) throw() { +void ClientSession::setState(State::_v state) { Session::setState(state); // Inform father server (availability changes): a_parent->refreshAvailability(); } -void ClientSession::bind() throw(anna::RuntimeException) { +void ClientSession::bind() noexcept(false) { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "bind", ANNA_FILE_LOCATION)); if(a_state != State::Closed) @@ -125,7 +125,7 @@ void ClientSession::bind() throw(anna::RuntimeException) { } -void ClientSession::setCERandDWR(const anna::DataBlock & cer, const anna::DataBlock & dwr) throw(anna::RuntimeException) { +void ClientSession::setCERandDWR(const anna::DataBlock & cer, const anna::DataBlock & dwr) noexcept(false) { if(codec::functions::getCommandId(cer) != helpers::base::COMMANDID__Capabilities_Exchange_Request) { throw anna::RuntimeException("The message provided as 'CER' is not a Capabilities-Exchange-Request", ANNA_FILE_LOCATION); } @@ -144,7 +144,7 @@ void ClientSession::setCERandDWR(const anna::DataBlock & cer, const anna::DataBl } -const Response* ClientSession::send(const Message* message) throw(anna::RuntimeException) { +const Response* ClientSession::send(const Message* message) noexcept(false) { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "send", ANNA_FILE_LOCATION)); if(!message) @@ -356,7 +356,7 @@ const Response* ClientSession::send(const Message* message) throw(anna::RuntimeE } bool ClientSession::unbind(bool forceDisconnect) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "unbind", ANNA_FILE_LOCATION)); if(a_state == State::Closed) @@ -442,12 +442,12 @@ throw(anna::RuntimeException) { return false; } -void ClientSession::eventPeerShutdown() throw() { +void ClientSession::eventPeerShutdown() { // Inform father server: a_parent->eventPeerShutdown(this); } -void ClientSession::eventRequestRetransmission(Message *request) throw() { +void ClientSession::eventRequestRetransmission(Message *request) { // OAM OamModule &oamModule = OamModule::instantiate(); @@ -458,22 +458,22 @@ void ClientSession::eventRequestRetransmission(Message *request) throw() { a_parent->eventRequestRetransmission(this, request); } -void ClientSession::eventResponse(const Response& response) throw(anna::RuntimeException) { +void ClientSession::eventResponse(const Response& response) noexcept(false) { // Inform father server: a_parent->eventResponse(response); } -void ClientSession::eventRequest(const anna::DataBlock &request) throw(anna::RuntimeException) { +void ClientSession::eventRequest(const anna::DataBlock &request) noexcept(false) { // Inform father server: a_parent->eventRequest(this, request); } -void ClientSession::eventUnknownResponse(const anna::DataBlock& response) throw(anna::RuntimeException) { +void ClientSession::eventUnknownResponse(const anna::DataBlock& response) noexcept(false) { // Inform father server: a_parent->eventUnknownResponse(this, response); } -void ClientSession::eventDPA(const anna::DataBlock& response) throw(anna::RuntimeException) { +void ClientSession::eventDPA(const anna::DataBlock& response) noexcept(false) { // Inform father server: a_parent->eventDPA(this, response); } @@ -484,7 +484,7 @@ void ClientSession::eventDPA(const anna::DataBlock& response) throw(anna::Runtim // Se invoca desde el diameter::comm::Receiver //------------------------------------------------------------------------------------------ void ClientSession::receive(const anna::comm::Message& message) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "receive", ANNA_FILE_LOCATION)); // Activity: updateIncomingActivityTime(); @@ -729,7 +729,7 @@ throw(anna::RuntimeException) { unbind(immediateUnbind); } -void ClientSession::finalize() throw() { +void ClientSession::finalize() { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "finalize", ANNA_FILE_LOCATION)); Session::finalize(); // Inform father server (availability changes): @@ -749,7 +749,7 @@ void ClientSession::finalize() throw() { } } -void ClientSession::recover() throw() { +void ClientSession::recover() { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "recover", ANNA_FILE_LOCATION)); try { @@ -781,7 +781,7 @@ void ClientSession::recover() throw() { } void ClientSession::sendDWAToServer(const anna::DataBlock& dwrDB) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "sendDWAToServer", ANNA_FILE_LOCATION)); anna::DataBlock dwa(true); a_engine->readDWA(dwa, dwrDB); // Asume that DWA is valid ... @@ -798,7 +798,7 @@ throw(anna::RuntimeException) { // Se invoca desde diameter::comm::Timer //------------------------------------------------------------------------- void ClientSession::expireResponse(diameter::comm::Response* response) -throw() { +{ LOGMETHOD(anna::TraceMethod traceMethod(a_className, "expireResponse", ANNA_FILE_LOCATION)); Session::expireResponse(response); // OAM @@ -821,7 +821,7 @@ throw() { std::string ClientSession::asString() const -throw() { +{ string result = Session::asString(); result += " | Parent Server: "; result += anna::functions::socketLiteralAsString(getAddress(), getPort()); @@ -844,7 +844,7 @@ throw() { } anna::xml::Node* ClientSession::asXML(anna::xml::Node* parent) const -throw() { +{ anna::xml::Node* result = Session::asXML(parent); parent->createChild("diameter.comm.ClientSession"); result->createAttribute("ParentServer", anna::functions::socketLiteralAsString(getAddress(), getPort())); @@ -861,7 +861,7 @@ throw() { const char* ClientSession::asText(const WatchdogState::_v watchdogState) -throw() { +{ static const char* text [] = { "TimerStopped", "WaitingTimerExpiration", "WaitingDWA" }; return text [watchdogState]; } @@ -870,7 +870,7 @@ throw() { //------------------------------------------------------------------------------ //------------------------------------------------------ ClientSession::expire() //------------------------------------------------------------------------------ -void ClientSession::expire(anna::timex::Engine *timeController) throw(anna::RuntimeException) { +void ClientSession::expire(anna::timex::Engine *timeController) noexcept(false) { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "expire (watchdog timer)", ANNA_FILE_LOCATION)); // The client MUST NOT close the primary connection until the @@ -907,11 +907,11 @@ void ClientSession::expire(anna::timex::Engine *timeController) throw(anna::Runt activateTimer(); } -void ClientSession::setWatchdogPeriod(const anna::Millisecond & watchdogPeriod) throw() { +void ClientSession::setWatchdogPeriod(const anna::Millisecond & watchdogPeriod) { setTimeout(watchdogPeriod); } -void ClientSession::setWatchdogState(WatchdogState::_v wState) throw() { +void ClientSession::setWatchdogState(WatchdogState::_v wState) { LOGDEBUG( if(wState != a_watchdogState) { @@ -926,12 +926,12 @@ void ClientSession::setWatchdogState(WatchdogState::_v wState) throw() { } -void ClientSession::timerStopped() throw() { +void ClientSession::timerStopped() { LOGDEBUG(anna::Logger::debug("Watchdog timer stopped", ANNA_FILE_LOCATION)); setWatchdogState(WatchdogState::TimerStopped); } -void ClientSession::timerStarted() throw() { +void ClientSession::timerStarted() { LOGDEBUG(anna::Logger::debug("Watchdog timer started", ANNA_FILE_LOCATION)); if(a_watchdogState == WatchdogState::WaitingDWA) return; @@ -943,7 +943,7 @@ void ClientSession::timerStarted() throw() { //------------------------------------------------------------------------------ //---------------------------------- ClientSession::updateIncomingActivityTime() //------------------------------------------------------------------------------ -void ClientSession::updateIncomingActivityTime() throw() { +void ClientSession::updateIncomingActivityTime() { Session::updateIncomingActivityTime(); a_parent->updateIncomingActivityTime(); } @@ -952,7 +952,7 @@ void ClientSession::updateIncomingActivityTime() throw() { //------------------------------------------------------------------------------ //---------------------------------- ClientSession::updateOutgoingActivityTime() //------------------------------------------------------------------------------ -void ClientSession::updateOutgoingActivityTime(void) throw() { +void ClientSession::updateOutgoingActivityTime(void) { Session::updateOutgoingActivityTime(); a_parent->updateOutgoingActivityTime(); } @@ -962,7 +962,7 @@ void ClientSession::updateOutgoingActivityTime(void) throw() { //------------------------------------------------------------------------------ //----------------------------------------------- ClientSession::countSendings() //------------------------------------------------------------------------------ -void ClientSession::countSendings(const diameter::CommandId & cid, unsigned int aid, bool ok)throw() { +void ClientSession::countSendings(const diameter::CommandId & cid, unsigned int aid, bool ok){ OamModule &oamModule = OamModule::instantiate(); ApplicationMessageOamModule &appMsgOamModule = ApplicationMessageOamModule::instantiate(); diff --git a/source/diameter.comm/ClientSessionReceiver.cpp b/source/diameter.comm/ClientSessionReceiver.cpp index d59d787..daa573b 100644 --- a/source/diameter.comm/ClientSessionReceiver.cpp +++ b/source/diameter.comm/ClientSessionReceiver.cpp @@ -24,19 +24,19 @@ using namespace anna::diameter::comm; void ClientSessionReceiver::apply(anna::comm::ClientSocket& clientSocket, const anna::comm::Message& message) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("diameter.comm.ClientSessionReceiver", "apply", ANNA_FILE_LOCATION)); a_session->receive(message); } void ClientSessionReceiver::eventBreakConnection(const anna::comm::ClientSocket& clientSocket) -throw() { +{ LOGMETHOD(anna::TraceMethod tm("diameter.comm.ClientSessionReceiver", "eventBreakConnection", ANNA_FILE_LOCATION)); a_session->finalize(); } void ClientSessionReceiver::eventCreateConnection(const anna::comm::Server* server) -throw() { +{ LOGMETHOD(anna::TraceMethod tm("diameter.comm.ClientSessionReceiver", "eventCreateConnection", ANNA_FILE_LOCATION)); a_session->recover(); } diff --git a/source/diameter.comm/Engine.cpp b/source/diameter.comm/Engine.cpp index 867b6cc..94c7d2d 100644 --- a/source/diameter.comm/Engine.cpp +++ b/source/diameter.comm/Engine.cpp @@ -71,7 +71,7 @@ comm::Engine::Engine(const char *className, const stack::Dictionary *baseProtoco } -void comm::Engine::assertBaseProtocolHealth() throw(anna::RuntimeException) { +void comm::Engine::assertBaseProtocolHealth() noexcept(false) { if (!getBaseProtocolCodecEngine()->getDictionary()) throw anna::RuntimeException("Invalid diameter::comm::Engine object: base protocol dictionary provided on constructor was NULL", ANNA_FILE_LOCATION); // it would be interesting to check and identify certain base protocol elements in the dictionary ... @@ -79,13 +79,13 @@ void comm::Engine::assertBaseProtocolHealth() throw(anna::RuntimeException) { } -comm::Server* comm::Engine::allocateServer() throw() { return a_serversRecycler.create(); } -void comm::Engine::releaseServer(Server *server) throw() { a_serversRecycler.release(server); } -comm::ClientSession* comm::Engine::allocateClientSession() throw() { return a_clientSessionsRecycler.create(); } -void comm::Engine::releaseClientSession(ClientSession *clientSession) throw() { a_clientSessionsRecycler.release(clientSession); } +comm::Server* comm::Engine::allocateServer() { return a_serversRecycler.create(); } +void comm::Engine::releaseServer(Server *server) { a_serversRecycler.release(server); } +comm::ClientSession* comm::Engine::allocateClientSession() { return a_clientSessionsRecycler.create(); } +void comm::Engine::releaseClientSession(ClientSession *clientSession) { a_clientSessionsRecycler.release(clientSession); } -void comm::Engine::setClientCERandDWR(const anna::DataBlock & cer, const anna::DataBlock & dwr) throw(anna::RuntimeException) { +void comm::Engine::setClientCERandDWR(const anna::DataBlock & cer, const anna::DataBlock & dwr) noexcept(false) { if(codec::functions::getCommandId(cer) != helpers::base::COMMANDID__Capabilities_Exchange_Request) { throw anna::RuntimeException("The message provided as 'CER' is not a Capabilities-Exchange-Request", ANNA_FILE_LOCATION); } @@ -98,7 +98,7 @@ void comm::Engine::setClientCERandDWR(const anna::DataBlock & cer, const anna::D a_dwr = dwr; } -void comm::Engine::setClientCERandDWR(const std::string & cer, const std::string & dwr) throw(anna::RuntimeException) { +void comm::Engine::setClientCERandDWR(const std::string & cer, const std::string & dwr) noexcept(false) { // Check for base protocol codec engine health: assertBaseProtocolHealth(); @@ -178,7 +178,7 @@ void comm::Engine::setClientCERandDWR(const std::string & cer, const std::string setClientCERandDWR(diameterCER.code(), diameterDWR.code()); } -void comm::Engine::setWatchdogPeriod(const anna::Millisecond & wp) throw(anna::RuntimeException) { +void comm::Engine::setWatchdogPeriod(const anna::Millisecond & wp) noexcept(false) { if(wp < ClientSession::DefaultWatchdogPeriod) { throw anna::RuntimeException(anna::functions::asString("Please set watchdog period over %s", ClientSession::DefaultWatchdogPeriod.asString().c_str()), ANNA_FILE_LOCATION); } @@ -186,7 +186,7 @@ void comm::Engine::setWatchdogPeriod(const anna::Millisecond & wp) throw(anna::R a_watchdogPeriod = wp; } -void comm::Engine::checkEntityCollision(const socket_v &v) throw(anna::RuntimeException) { +void comm::Engine::checkEntityCollision(const socket_v &v) noexcept(false) { socket_v::const_iterator it; socket_v::const_iterator it_min(v.begin()); socket_v::const_iterator it_max(v.end()); @@ -208,7 +208,7 @@ void comm::Engine::checkEntityCollision(const socket_v &v) throw(anna::RuntimeEx } comm::Entity* comm::Engine::createEntity(const socket_v & socketList, const std::string &description) -throw(anna::RuntimeException) { +noexcept(false) { Entity* result(NULL); anna::Guard guard(this, "anna::diameter::comm::Engine::createEntity"); @@ -257,7 +257,7 @@ throw(anna::RuntimeException) { comm::LocalServer *comm::Engine::createLocalServer(const std::string & addr, int port, int maxConnections, const anna::Millisecond & allowedInactivityTime, int category, const std::string & description) -throw(anna::RuntimeException) { +noexcept(false) { LocalServer* result(NULL); anna::Guard guard(this, "anna::diameter::comm::Engine::createLocalServer"); // Proteccion antes de reservar memoria para un LocalServer @@ -292,7 +292,7 @@ throw(anna::RuntimeException) { comm::Entity* comm::Engine::createEntity(const std::string & addr1, int port1, const std::string & addr2, int port2, const std::string &description) -throw(anna::RuntimeException) { +noexcept(false) { socket_v dualList; dualList.push_back(socket_t(addr1, port1)); dualList.push_back(socket_t(addr2, port2)); @@ -301,7 +301,7 @@ throw(anna::RuntimeException) { comm::Server* comm::Engine::createServer(Entity *entity, const socket_t & socket) -throw(anna::RuntimeException) { +noexcept(false) { Server* result(NULL); anna::Guard guard(this, "anna::diameter::comm::Engine::createServer"); @@ -333,7 +333,7 @@ throw(anna::RuntimeException) { // Lohacemos privado comm::ClientSession* comm::Engine::createClientSession(Server *server, int socketId) -throw(anna::RuntimeException) { +noexcept(false) { ClientSession* result(NULL); anna::Guard guard(this, "anna::diameter::comm::Engine::createClientSession"); @@ -377,7 +377,7 @@ throw(anna::RuntimeException) { } -bool comm::Engine::broadcastEntities(const Message* message) throw(anna::RuntimeException) { +bool comm::Engine::broadcastEntities(const Message* message) noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::Engine", "broadcastEntities", ANNA_FILE_LOCATION)); bool allok = true; bool ok; @@ -396,7 +396,7 @@ bool comm::Engine::broadcastEntities(const Message* message) throw(anna::Runtime return allok; } -bool comm::Engine::broadcastLocalServers(const Message* message) throw(anna::RuntimeException) { +bool comm::Engine::broadcastLocalServers(const Message* message) noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::Engine", "broadcastLocalServers", ANNA_FILE_LOCATION)); bool allok = true; bool ok; @@ -415,7 +415,7 @@ bool comm::Engine::broadcastLocalServers(const Message* message) throw(anna::Run return allok; } -bool comm::Engine::bind() throw(anna::RuntimeException) { +bool comm::Engine::bind() noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::Engine", "bind", ANNA_FILE_LOCATION)); bool result = true; // all OK return @@ -432,12 +432,12 @@ bool comm::Engine::bind() throw(anna::RuntimeException) { } comm::ClientSession* comm::Engine::findClientSession(const std::string & addr, int port, int socketId, anna::Exception::Mode::_v emode) -throw(anna::RuntimeException) { +noexcept(false) { return findClientSession(ClientSession::getKey(addr, port, socketId), emode); } comm::ClientSession* comm::Engine::findClientSession(const std::string & key, anna::Exception::Mode::_v emode) -throw(anna::RuntimeException) { +noexcept(false) { anna::Guard guard(this, "anna::diameter::comm::Engine::findClientSession"); clientSession_iterator ii = clientSession_find(key); @@ -461,7 +461,7 @@ throw(anna::RuntimeException) { comm::Server* comm::Engine::findServer(const std::string & addr, int port, anna::Exception::Mode::_v emode) -throw(anna::RuntimeException) { +noexcept(false) { anna::Guard guard(this, "anna::diameter::comm::Engine::findServer"); server_iterator ii = server_find(server_key(addr, port)); @@ -485,7 +485,7 @@ throw(anna::RuntimeException) { } comm::Entity* comm::Engine::findEntity(const socket_v & socketList, anna::Exception::Mode::_v emode) -throw(anna::RuntimeException) { +noexcept(false) { anna::Guard guard(this, "anna::diameter::comm::Engine::findEntity"); entity_key key(getEntityKey(socketList)); entity_iterator ii = entity_find(key); @@ -509,7 +509,7 @@ throw(anna::RuntimeException) { } comm::Entity* comm::Engine::findEntity(const std::string & addr1, int port1, const std::string & addr2, int port2, anna::Exception::Mode::_v emode) -throw(anna::RuntimeException) { +noexcept(false) { socket_v dualList; dualList.push_back(socket_t(addr1, port1)); dualList.push_back(socket_t(addr2, port2)); @@ -518,7 +518,7 @@ throw(anna::RuntimeException) { //Entity* Engine::findEntity(int category, anna::Exception::Mode::_v emode) -//throw(anna::RuntimeException) { +//noexcept(false) { // // Entity *entity; // @@ -532,7 +532,7 @@ throw(anna::RuntimeException) { comm::LocalServer* comm::Engine::findLocalServer(const std::string & addr, int port, anna::Exception::Mode::_v emode) -throw(anna::RuntimeException) { +noexcept(false) { anna::Guard guard(this, "anna::diameter::comm::Engine::findLocalServer"); socket_t key(addr, port); localServer_iterator ii = localServer_find(key); @@ -557,7 +557,7 @@ throw(anna::RuntimeException) { } -comm::ServerSession* comm::Engine::findServerSession(int socketId, anna::Exception::Mode::_v emode) throw(anna::RuntimeException) { +comm::ServerSession* comm::Engine::findServerSession(int socketId, anna::Exception::Mode::_v emode) noexcept(false) { anna::Guard guard(this, "anna::diameter::comm::Engine::findServerSession"); ServerSession *result; @@ -585,7 +585,7 @@ comm::ServerSession* comm::Engine::findServerSession(int socketId, anna::Excepti void comm::Engine::closeClientSession(comm::ClientSession* clientSession, bool destroy) -throw(anna::RuntimeException) { +noexcept(false) { if(clientSession == NULL) return; @@ -623,7 +623,7 @@ throw(anna::RuntimeException) { void comm::Engine::closeServer(comm::Server* server, bool destroy) -throw(anna::RuntimeException) { +noexcept(false) { if(server == NULL) return; @@ -655,7 +655,7 @@ throw(anna::RuntimeException) { void comm::Engine::closeEntity(comm::Entity* entity, bool destroy) -throw(anna::RuntimeException) { +noexcept(false) { if(entity == NULL) return; @@ -690,7 +690,7 @@ throw(anna::RuntimeException) { void comm::Engine::closeLocalServer(comm::LocalServer* localServer, bool destroy) -throw(anna::RuntimeException) { +noexcept(false) { if(localServer == NULL) return; @@ -722,7 +722,7 @@ throw(anna::RuntimeException) { -void comm::Engine::closeEntities(bool destroy) throw(anna::RuntimeException) { +void comm::Engine::closeEntities(bool destroy) noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::Engine", "closeEntities", ANNA_FILE_LOCATION)); anna::Guard guard(this, "anna::diameter::comm::Engine::closeEntities"); @@ -730,7 +730,7 @@ void comm::Engine::closeEntities(bool destroy) throw(anna::RuntimeException) { closeEntity(entity(it), destroy); } -void comm::Engine::closeLocalServers(bool destroy) throw(anna::RuntimeException) { +void comm::Engine::closeLocalServers(bool destroy) noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::Engine", "closeLocalServers", ANNA_FILE_LOCATION)); anna::Guard guard(this, "anna::diameter::comm::Engine::closeLocalServers"); @@ -738,7 +738,7 @@ void comm::Engine::closeLocalServers(bool destroy) throw(anna::RuntimeException) closeLocalServer(localServer(it), destroy); } -void comm::Engine::eraseDeprecatedIdleEntities() throw() { +void comm::Engine::eraseDeprecatedIdleEntities() { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::Engine", "eraseDeprecatedIdleEntities", ANNA_FILE_LOCATION)); Entity *et; @@ -749,7 +749,7 @@ void comm::Engine::eraseDeprecatedIdleEntities() throw() { } } -int comm::Engine::getOTARequestsForEntities() const throw() { +int comm::Engine::getOTARequestsForEntities() const { int result = 0; for(const_entity_iterator it = entity_begin(), maxii = entity_end(); it != maxii; it ++) @@ -758,7 +758,7 @@ int comm::Engine::getOTARequestsForEntities() const throw() { return result; } -int comm::Engine::getOTARequestsForLocalServers() const throw() { +int comm::Engine::getOTARequestsForLocalServers() const { int result = 0; for(const_localServer_iterator it = localServer_begin(), maxii = localServer_end(); it != maxii; it ++) @@ -768,18 +768,18 @@ int comm::Engine::getOTARequestsForLocalServers() const throw() { } -void comm::Engine::setOriginRealmName(const std::string & originRealmName) throw() { +void comm::Engine::setOriginRealmName(const std::string & originRealmName) { a_originRealm = ((originRealmName != "") ? originRealmName : anna::functions::getDomainname()); } -void comm::Engine::setOriginHostName(const std::string & originHostName) throw() { +void comm::Engine::setOriginHostName(const std::string & originHostName) { a_originHost = ((originHostName != "") ? originHostName : anna::functions::getHostname()); } -void comm::Engine::raiseAutoRecovery(bool autoRecovery) throw(anna::RuntimeException) { +void comm::Engine::raiseAutoRecovery(bool autoRecovery) noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::Engine", "raiseAutoRecovery", ANNA_FILE_LOCATION)); for(entity_iterator it = entity_begin(), maxii = entity_end(); it != maxii; it ++) @@ -787,12 +787,12 @@ void comm::Engine::raiseAutoRecovery(bool autoRecovery) throw(anna::RuntimeExcep } void comm::Engine::do_stop() -throw() { +{ LOGMETHOD(anna::TraceMethod tttm("diameter::comm::Engine", "do_stop", ANNA_FILE_LOCATION)); close(true /* destroy */); } -std::string comm::Engine::asString(void) const throw() { +std::string comm::Engine::asString(void) const { std::string trace; trace = "\n================================"; trace += "\nDiameter comm Engine information"; @@ -834,7 +834,7 @@ std::string comm::Engine::asString(void) const throw() { anna::xml::Node* comm::Engine::asXML(anna::xml::Node* parent) const -throw() { +{ parent = anna::app::Component::asXML(parent); anna::xml::Node* result = parent->createChild("diameter.comm.Engine"); result->createAttribute("AutoBind", a_autoBind ? "yes" : "no"); @@ -883,30 +883,30 @@ throw() { return result; } -comm::Engine::clientSession_iterator comm::Engine::clientSession_find(const clientSession_key &key) throw() { +comm::Engine::clientSession_iterator comm::Engine::clientSession_find(const clientSession_key &key) { return a_clientSessions.find(key); } -comm::Engine::server_iterator comm::Engine::server_find(const server_key &key) throw() { +comm::Engine::server_iterator comm::Engine::server_find(const server_key &key) { return a_servers.find(key); } -comm::Engine::entity_iterator comm::Engine::entity_find(const entity_key &key) throw() { +comm::Engine::entity_iterator comm::Engine::entity_find(const entity_key &key) { return a_entities.find(key); } -comm::Engine::localServer_iterator comm::Engine::localServer_find(const socket_t &key) throw() { +comm::Engine::localServer_iterator comm::Engine::localServer_find(const socket_t &key) { return a_localServers.find(key); } -comm::Engine::entity_key comm::Engine::getEntityKey(const std::string & addr1, int port1, const std::string & addr2, int port2) const throw() { +comm::Engine::entity_key comm::Engine::getEntityKey(const std::string & addr1, int port1, const std::string & addr2, int port2) const { socket_v dualList; dualList.push_back(socket_t(addr1, port1)); dualList.push_back(socket_t(addr2, port2)); return (getEntityKey(dualList)); } -comm::Engine::entity_key comm::Engine::getEntityKey(const socket_v &v) const throw() { +comm::Engine::entity_key comm::Engine::getEntityKey(const socket_v &v) const { std::string result; socket_v::const_iterator it; socket_v::const_iterator it_min(v.begin()); @@ -922,7 +922,7 @@ comm::Engine::entity_key comm::Engine::getEntityKey(const socket_v &v) const thr } -void comm::Engine::availabilityLostForEntities() throw() { +void comm::Engine::availabilityLostForEntities() { a_availableForEntities = false; LOGDEBUG( std::string msg = "diameter::comm::Engine { Origin-Realm: "; @@ -941,7 +941,7 @@ void comm::Engine::availabilityLostForEntities() throw() { } -void comm::Engine::availabilityRecoveredForEntities() throw() { +void comm::Engine::availabilityRecoveredForEntities() { a_availableForEntities = true; LOGDEBUG( std::string msg = "diameter::comm::Engine { Origin-Realm: "; @@ -960,7 +960,7 @@ void comm::Engine::availabilityRecoveredForEntities() throw() { } -void comm::Engine::availabilityLostForLocalServers() throw() { +void comm::Engine::availabilityLostForLocalServers() { a_availableForLocalServers = false; LOGDEBUG( std::string msg = "diameter::comm::Engine { Origin-Realm: "; @@ -979,7 +979,7 @@ void comm::Engine::availabilityLostForLocalServers() throw() { } -void comm::Engine::availabilityRecoveredForLocalServers() throw() { +void comm::Engine::availabilityRecoveredForLocalServers() { a_availableForLocalServers = true; LOGDEBUG( std::string msg = "diameter::comm::Engine { Origin-Realm: "; @@ -998,7 +998,7 @@ void comm::Engine::availabilityRecoveredForLocalServers() throw() { } -bool comm::Engine::refreshAvailabilityForEntities() throw() { +bool comm::Engine::refreshAvailabilityForEntities() { // Here available if(a_availableForEntities) { // check not-bound state for all client-sessions: bool isolate = true; @@ -1024,7 +1024,7 @@ bool comm::Engine::refreshAvailabilityForEntities() throw() { return false; } -bool comm::Engine::refreshAvailabilityForLocalServers() throw() { +bool comm::Engine::refreshAvailabilityForLocalServers() { // Here available if(a_availableForLocalServers) { // check not-bound state for all client-sessions: bool isolate = true; @@ -1051,7 +1051,7 @@ bool comm::Engine::refreshAvailabilityForLocalServers() throw() { } -void comm::Engine::readDPA(anna::DataBlock &dpa, const anna::DataBlock & dpr) throw() { +void comm::Engine::readDPA(anna::DataBlock &dpa, const anna::DataBlock & dpr) { // Check for base protocol codec engine health: try { @@ -1107,7 +1107,7 @@ void comm::Engine::readDPA(anna::DataBlock &dpa, const anna::DataBlock & dpr) th } -void comm::Engine::readCEA(anna::DataBlock &cea, const anna::DataBlock &cer) throw() { +void comm::Engine::readCEA(anna::DataBlock &cea, const anna::DataBlock &cer) { // Check for base protocol codec engine health: assertBaseProtocolHealth(); @@ -1195,7 +1195,7 @@ void comm::Engine::readCEA(anna::DataBlock &cea, const anna::DataBlock &cer) thr } } -void comm::Engine::manageDrDhServerSession(ServerSession *ss, bool register_or_desregister) throw() { +void comm::Engine::manageDrDhServerSession(ServerSession *ss, bool register_or_desregister) { // Decode CER (TODO: use raw buffer helpers) std::string destinationRealm, destinationHost; @@ -1255,7 +1255,7 @@ void comm::Engine::manageDrDhServerSession(ServerSession *ss, bool register_or_d } } -void comm::Engine::readDWA(anna::DataBlock &dwa, const anna::DataBlock & dwr) throw() { +void comm::Engine::readDWA(anna::DataBlock &dwa, const anna::DataBlock & dwr) { // Check for base protocol codec engine health: assertBaseProtocolHealth(); @@ -1305,7 +1305,7 @@ void comm::Engine::readDWA(anna::DataBlock &dwa, const anna::DataBlock & dwr) th } } -void comm::Engine::resetStatistics() throw() { +void comm::Engine::resetStatistics() { for(server_iterator it = server_begin(), maxii = server_end(); it != maxii; it ++) server(it)->resetStatistics(); @@ -1313,18 +1313,18 @@ void comm::Engine::resetStatistics() throw() { localServer(it)->resetStatistics(); } -void comm::Engine::do_initialize() throw(RuntimeException) { +void comm::Engine::do_initialize() noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::Engine", "do_initialize", ANNA_FILE_LOCATION)); LOGDEBUG(anna::Logger::debug("Nothing special done on component initialization", ANNA_FILE_LOCATION)); } -void comm::Engine::lazyInitialize() throw(RuntimeException) { +void comm::Engine::lazyInitialize() noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::Engine", "lazyInitialize", ANNA_FILE_LOCATION)); anna::app::Component::initialize(); // this will invoke do_initialize } // Not tested yet -const comm::Response* comm::Engine::sendRealmHost(const Message* message, const std::string &destinationRealm, const std::string &destinationHost) throw(anna::RuntimeException) { +const comm::Response* comm::Engine::sendRealmHost(const Message* message, const std::string &destinationRealm, const std::string &destinationHost) noexcept(false) { if (destinationRealm == "") throw anna::RuntimeException("Unable to resolve the destination: empty provided Destination-Realm name", ANNA_FILE_LOCATION); diff --git a/source/diameter.comm/Entity.cpp b/source/diameter.comm/Entity.cpp index fc07148..d48b139 100644 --- a/source/diameter.comm/Entity.cpp +++ b/source/diameter.comm/Entity.cpp @@ -28,7 +28,7 @@ using namespace anna::diameter::comm; -void Entity::initialize() throw() { +void Entity::initialize() { a_engine = NULL; a_servers.clear(); // importante (el recycler creo que no lo tocaba) a_available = false; @@ -44,7 +44,7 @@ void Entity::initialize() throw() { } -void Entity::assertReady() throw(anna::RuntimeException) { +void Entity::assertReady() noexcept(false) { if(a_servers.size() != a_maxServers) { std::string msg(asString()); msg += " | Non-configured entity: you must add the remaining servers before any operation (bind, send, etc.)"; @@ -54,7 +54,7 @@ void Entity::assertReady() throw(anna::RuntimeException) { void Entity::addServer(const socket_t & serverId) -throw(anna::RuntimeException) { +noexcept(false) { if(a_servers.size() == a_maxServers) { LOGDEBUG ( @@ -75,7 +75,7 @@ throw(anna::RuntimeException) { } -int Entity::readSocketId(const Message* message, int maxClientSessions) const throw() { +int Entity::readSocketId(const Message* message, int maxClientSessions) const { if(a_sessionBasedModelsType == SessionBasedModelsType::RoundRobin) return -1; // IEC also would return -1 @@ -118,7 +118,7 @@ int Entity::readSocketId(const Message* message, int maxClientSessions) const th } -bool Entity::send(const Message* message) throw(anna::RuntimeException) { +bool Entity::send(const Message* message) noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::Entity", "send", ANNA_FILE_LOCATION)); assertReady(); // Carried socket id (forwarding/proxy features): @@ -201,7 +201,7 @@ bool Entity::send(const Message* message) throw(anna::RuntimeException) { return false; } -bool Entity::broadcast(const Message* message) throw(anna::RuntimeException) { +bool Entity::broadcast(const Message* message) noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::Entity", "broadcast", ANNA_FILE_LOCATION)); assertReady(); bool allok = true; @@ -221,7 +221,7 @@ bool Entity::broadcast(const Message* message) throw(anna::RuntimeException) { return allok; } -bool Entity::bind() throw(anna::RuntimeException) { +bool Entity::bind() noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::Entity", "bind", ANNA_FILE_LOCATION)); assertReady(); bool result = true; // all OK return @@ -238,7 +238,7 @@ bool Entity::bind() throw(anna::RuntimeException) { return result; } -void Entity::raiseAutoRecovery(bool autoRecovery) throw(anna::RuntimeException) { +void Entity::raiseAutoRecovery(bool autoRecovery) noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::Entity", "raiseAutoRecovery", ANNA_FILE_LOCATION)); assertReady(); @@ -246,7 +246,7 @@ void Entity::raiseAutoRecovery(bool autoRecovery) throw(anna::RuntimeException) (*it)->raiseAutoRecovery(autoRecovery); } -void Entity::setClassCodeTimeout(const ClassCode::_v v, const anna::Millisecond & millisecond) throw() { +void Entity::setClassCodeTimeout(const ClassCode::_v v, const anna::Millisecond & millisecond) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::Entity", "setClassCodeTimeout", ANNA_FILE_LOCATION)); assertReady(); @@ -261,7 +261,7 @@ void Entity::setClassCodeTimeout(const ClassCode::_v v, const anna::Millisecond // Private close/destroy method -void Entity::close(bool destroy) throw(anna::RuntimeException) { +void Entity::close(bool destroy) noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::Entity", "close", ANNA_FILE_LOCATION)); if(!a_engine) @@ -274,12 +274,12 @@ void Entity::close(bool destroy) throw(anna::RuntimeException) { } const char* Entity::asText(const SessionBasedModelsType::_v sbmt) -throw() { +{ static const char* text [] = { "RoundRobin", "SessionIdOptionalPart", "SessionIdHighPart", "SessionIdLowPart" }; return text [sbmt]; } -socket_v Entity::getAddressPortList() const throw() { +socket_v Entity::getAddressPortList() const { socket_v result; for(std::vector::const_iterator it = begin(); it != end(); it++) { @@ -290,7 +290,7 @@ socket_v Entity::getAddressPortList() const throw() { return result; } -int Entity::getOTARequests() const throw() { +int Entity::getOTARequests() const { int result = 0; for(std::vector::const_iterator it = begin(); it != end(); it++) @@ -299,36 +299,36 @@ int Entity::getOTARequests() const throw() { return result; } -void Entity::childIdle() const throw() { +void Entity::childIdle() const { // Check father engine idleness: if(idle()) a_engine->eraseDeprecatedIdleEntities(); } -void Entity::hide() throw() { +void Entity::hide() { for(std::vector::iterator it = begin(); it != end(); it++) (*it)->hide(); } -void Entity::show() throw() { +void Entity::show() { for(std::vector::iterator it = begin(); it != end(); it++) (*it)->show(); } -bool Entity::hidden() const throw() { +bool Entity::hidden() const { for(std::vector::const_iterator it = begin(); it != end(); it++) if((*it)->shown()) return false; return true; } -bool Entity::shown() const throw() { +bool Entity::shown() const { for(std::vector::const_iterator it = begin(); it != end(); it++) if((*it)->hidden()) return false; return true; } -void Entity::eventPeerShutdown(const ClientSession* clientSession) throw() { +void Entity::eventPeerShutdown(const ClientSession* clientSession) { LOGWARNING( std::string msg(clientSession->asString()); msg += " | eventPeerShutdown"; @@ -336,7 +336,7 @@ void Entity::eventPeerShutdown(const ClientSession* clientSession) throw() { ); } -void Entity::eventRequestRetransmission(const ClientSession* clientSession, Message *request) throw() { +void Entity::eventRequestRetransmission(const ClientSession* clientSession, Message *request) { LOGWARNING( std::string msg(clientSession->asString()); @@ -348,7 +348,7 @@ void Entity::eventRequestRetransmission(const ClientSession* clientSession, Mess ); } -std::string Entity::asString() const throw() { +std::string Entity::asString() const { std::string result("diameter::comm::Entity { "); std::string originRealm = a_engine->getOriginRealmName(); std::string originHost = a_engine->getOriginHostName(); @@ -393,7 +393,7 @@ std::string Entity::asString() const throw() { return result; } -anna::xml::Node* Entity::asXML(anna::xml::Node* parent) const throw() { +anna::xml::Node* Entity::asXML(anna::xml::Node* parent) const { anna::xml::Node* result = parent->createChild("diameter.Entity"); std::string originRealm = a_engine->getOriginRealmName(); std::string originHost = a_engine->getOriginHostName(); @@ -422,7 +422,7 @@ anna::xml::Node* Entity::asXML(anna::xml::Node* parent) const throw() { return result; } -void Entity::availabilityLost() throw() { +void Entity::availabilityLost() { a_available = false; LOGDEBUG( std::string msg = "diameter::comm::Entity { Description: "; @@ -447,7 +447,7 @@ void Entity::availabilityLost() throw() { } -void Entity::availabilityRecovered() throw() { +void Entity::availabilityRecovered() { a_available = true; LOGDEBUG( std::string msg = "diameter::comm::Entity { Description: "; @@ -472,7 +472,7 @@ void Entity::availabilityRecovered() throw() { } -bool Entity::refreshAvailability() throw() { +bool Entity::refreshAvailability() { // Here available if(a_available) { // check not-bound state for all servers: bool isolate = true; @@ -501,7 +501,7 @@ bool Entity::refreshAvailability() throw() { //------------------------------------------------------------------------------ //----------------------------------------- Entity::updateIncomingActivityTime() //------------------------------------------------------------------------------ -void Entity::updateIncomingActivityTime() throw() { +void Entity::updateIncomingActivityTime() { a_lastIncomingActivityTime = anna::functions::millisecond(); LOGDEBUG ( @@ -515,7 +515,7 @@ void Entity::updateIncomingActivityTime() throw() { //------------------------------------------------------------------------------ //----------------------------------------- Entity::updateOutgoingActivityTime() //------------------------------------------------------------------------------ -void Entity::updateOutgoingActivityTime(void) throw() { +void Entity::updateOutgoingActivityTime(void) { a_lastOutgoingActivityTime = anna::functions::millisecond(); LOGDEBUG ( diff --git a/source/diameter.comm/LocalServer.cpp b/source/diameter.comm/LocalServer.cpp index 3224793..a445245 100644 --- a/source/diameter.comm/LocalServer.cpp +++ b/source/diameter.comm/LocalServer.cpp @@ -46,7 +46,7 @@ LocalServer::LocalServer() : a_lastUsedResource(NULL) {} -void LocalServer::initializeStatisticResources() throw() { +void LocalServer::initializeStatisticResources() { std::string accName = "local server '"; accName += anna::functions::socketLiteralAsString(a_key.first, a_key.second); accName += "' on origin-realm '"; @@ -57,35 +57,35 @@ void LocalServer::initializeStatisticResources() throw() { a_messageStatistics.initialize(accName); } -void LocalServer::resetStatistics() throw() { +void LocalServer::resetStatistics() { a_messageStatistics.getAccumulator()->reset(); } -void LocalServer::updateProcessingTimeStatisticConcept(const double &value, const anna::diameter::CommandId &cid) throw() { +void LocalServer::updateProcessingTimeStatisticConcept(const double &value, const anna::diameter::CommandId &cid) { a_messageStatistics.process(MessageStatistics::ConceptType::SentRequestProcessingTime, cid, value); LOGDEBUG(anna::Logger::debug(a_messageStatistics.getAccumulator()->asString(), ANNA_FILE_LOCATION)); } -void LocalServer::updateReceivedMessageSizeStatisticConcept(const double &value, const anna::diameter::CommandId &cid) throw() { +void LocalServer::updateReceivedMessageSizeStatisticConcept(const double &value, const anna::diameter::CommandId &cid) { a_messageStatistics.process(MessageStatistics::ConceptType::ReceivedMessageSize, cid, value); LOGDEBUG(anna::Logger::debug(a_messageStatistics.getAccumulator()->asString(), ANNA_FILE_LOCATION)); } -ServerSession* LocalServer::allocateServerSession() throw() { return a_serverSessionsRecycler.create(); } -void LocalServer::releaseServerSession(ServerSession *serverSession) throw() { a_serverSessionsRecycler.release(serverSession); } +ServerSession* LocalServer::allocateServerSession() { return a_serverSessionsRecycler.create(); } +void LocalServer::releaseServerSession(ServerSession *serverSession) { a_serverSessionsRecycler.release(serverSession); } -LocalServer::serverSession_iterator LocalServer::serverSession_find(const serverSession_key &key) throw() { +LocalServer::serverSession_iterator LocalServer::serverSession_find(const serverSession_key &key) { return a_serverSessions.find(key); } -LocalServer::serverSession_key LocalServer::getServerSessionKey(const anna::comm::ClientSocket &clientSocket) const throw() { +LocalServer::serverSession_key LocalServer::getServerSessionKey(const anna::comm::ClientSocket &clientSocket) const { return (anna::functions::hash(clientSocket.getRemoteAccessPoint().getINetAddress().serialize().c_str())); } -void LocalServer::availabilityLost() throw() { +void LocalServer::availabilityLost() { a_available = false; std::string socket = anna::functions::socketLiteralAsString(a_key.first, a_key.second); LOGDEBUG( @@ -103,7 +103,7 @@ void LocalServer::availabilityLost() throw() { } -void LocalServer::availabilityRecovered() throw() { +void LocalServer::availabilityRecovered() { a_available = true; std::string socket = anna::functions::socketLiteralAsString(a_key.first, a_key.second); LOGDEBUG( @@ -122,7 +122,7 @@ void LocalServer::availabilityRecovered() throw() { -bool LocalServer::refreshAvailability() throw() { +bool LocalServer::refreshAvailability() { // Here available if(a_available) { // check not-bound state for all server-sessions: // bool isolate = true; @@ -153,7 +153,7 @@ bool LocalServer::refreshAvailability() throw() { } -void LocalServer::enable(bool unlock) throw(anna::RuntimeException) { +void LocalServer::enable(bool unlock) noexcept(false) { // Unlock ? if(unlock) a_lock = false; @@ -173,7 +173,7 @@ void LocalServer::enable(bool unlock) throw(anna::RuntimeException) { attach(); } -void LocalServer::attach() throw() { +void LocalServer::attach() { try { // Attach to communicator anna::comm::Communicator * communicator = anna::app::functions::component (ANNA_FILE_LOCATION); @@ -188,7 +188,7 @@ void LocalServer::attach() throw() { } } -void LocalServer::attachPlanning() throw() { +void LocalServer::attachPlanning() { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::LocalServer", "attachPlanning", ANNA_FILE_LOCATION)); try { @@ -200,7 +200,7 @@ void LocalServer::attachPlanning() throw() { } -void LocalServer::disable(bool lock) throw(anna::RuntimeException) { +void LocalServer::disable(bool lock) noexcept(false) { // Permanent ? a_lock = lock; anna::comm::Communicator * communicator = anna::app::functions::component (ANNA_FILE_LOCATION); @@ -212,13 +212,13 @@ void LocalServer::disable(bool lock) throw(anna::RuntimeException) { } -void LocalServer::lostConnection() throw() { +void LocalServer::lostConnection() { a_currentConnections--; enable(); } -void LocalServer::newConnection() throw(anna::RuntimeException) { +void LocalServer::newConnection() noexcept(false) { a_currentConnections++; // Check capacity @@ -237,7 +237,7 @@ void LocalServer::newConnection() throw(anna::RuntimeException) { -ServerSession *LocalServer::createServerSession(const anna::comm::ClientSocket &clientSocket) throw(anna::RuntimeException) { +ServerSession *LocalServer::createServerSession(const anna::comm::ClientSocket &clientSocket) noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::LocalServer", "createServerSession", ANNA_FILE_LOCATION)); ServerSession* result(NULL); // First erase deprecated ones: @@ -285,7 +285,7 @@ ServerSession *LocalServer::createServerSession(const anna::comm::ClientSocket & void LocalServer::closeServerSession(ServerSession* serverSession) -throw(anna::RuntimeException) { +noexcept(false) { if(serverSession == NULL) return; @@ -338,7 +338,7 @@ throw(anna::RuntimeException) { ServerSession* LocalServer::findServerSession(int socketId, anna::Exception::Mode::_v emode) -throw(anna::RuntimeException) { +noexcept(false) { serverSession_iterator ii = serverSession_find(socketId); if(ii != serverSession_end()) @@ -360,12 +360,12 @@ throw(anna::RuntimeException) { } ServerSession* LocalServer::findServerSession(const anna::comm::ClientSocket &clientSocket, anna::Exception::Mode::_v emode) -throw(anna::RuntimeException) { +noexcept(false) { return findServerSession(getServerSessionKey(clientSocket), emode); } -int LocalServer::getOTARequests() const throw() { +int LocalServer::getOTARequests() const { int result = 0; for(const_serverSession_iterator it = serverSession_begin(); it != serverSession_end(); it++) @@ -374,7 +374,7 @@ int LocalServer::getOTARequests() const throw() { return result; } -void LocalServer::close() throw(anna::RuntimeException) { +void LocalServer::close() noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::LocalServer", "close", ANNA_FILE_LOCATION)); // Close listener (permanently to avoid reopening when local connections are being deleted): disable(true /* lock */); @@ -383,7 +383,7 @@ void LocalServer::close() throw(anna::RuntimeException) { closeServerSession(serverSession(it)); } -void LocalServer::setClassCodeTimeout(const ClassCode::_v v, const anna::Millisecond & millisecond) throw() { +void LocalServer::setClassCodeTimeout(const ClassCode::_v v, const anna::Millisecond & millisecond) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::LocalServer", "setClassCodeTimeout", ANNA_FILE_LOCATION)); for(serverSession_iterator it = serverSession_begin(); it != serverSession_end(); it++) { @@ -395,7 +395,7 @@ void LocalServer::setClassCodeTimeout(const ClassCode::_v v, const anna::Millise } } -void LocalServer::setMaxConnections(int maxConnections) throw(anna::RuntimeException) { +void LocalServer::setMaxConnections(int maxConnections) noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("anna::diameter::comm::LocalServer", "setMaxConnections", ANNA_FILE_LOCATION)); // Negative & initial @@ -450,7 +450,7 @@ void LocalServer::setMaxConnections(int maxConnections) throw(anna::RuntimeExcep } -bool LocalServer::send(const Message* message, int socketId) throw(anna::RuntimeException) { +bool LocalServer::send(const Message* message, int socketId) noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::LocalServer", "send", ANNA_FILE_LOCATION)); if(!isAvailable()) { @@ -518,7 +518,7 @@ bool LocalServer::send(const Message* message, int socketId) throw(anna::Runtime } -bool LocalServer::broadcast(const Message* message) throw(anna::RuntimeException) { +bool LocalServer::broadcast(const Message* message) noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::LocalServer", "broadcast", ANNA_FILE_LOCATION)); bool allok = true; @@ -534,7 +534,7 @@ bool LocalServer::broadcast(const Message* message) throw(anna::RuntimeException return allok; } -void LocalServer::eventPeerShutdown(const ServerSession* serverSession) throw() { +void LocalServer::eventPeerShutdown(const ServerSession* serverSession) { LOGWARNING( std::string msg(serverSession->asString()); msg += " | eventPeerShutdown"; @@ -542,7 +542,7 @@ void LocalServer::eventPeerShutdown(const ServerSession* serverSession) throw() ); } -void LocalServer::eventRequestRetransmission(const ServerSession* serverSession, Message *request) throw() { +void LocalServer::eventRequestRetransmission(const ServerSession* serverSession, Message *request) { LOGWARNING( std::string msg(serverSession->asString()); msg += " | eventRequestRetransmission"; @@ -550,7 +550,7 @@ void LocalServer::eventRequestRetransmission(const ServerSession* serverSession, ); } -std::string LocalServer::asString() const throw() { +std::string LocalServer::asString() const { std::string result("diameter::comm::LocalServer { "); result += "Description: "; result += (a_description != "") ? a_description : "undefined"; @@ -577,7 +577,7 @@ std::string LocalServer::asString() const throw() { } -anna::xml::Node* LocalServer::asXML(anna::xml::Node* parent) const throw() { +anna::xml::Node* LocalServer::asXML(anna::xml::Node* parent) const { anna::xml::Node* result = parent->createChild("diameter.LocalServer"); result->createAttribute("Description", (a_description != "") ? a_description : "undefined"); result->createAttribute("Available", a_available ? "yes" : "no"); @@ -608,7 +608,7 @@ anna::xml::Node* LocalServer::asXML(anna::xml::Node* parent) const throw() { //------------------------------------------------------------------------------ //------------------------------------ LocalServer::updateIncomingActivityTime() //------------------------------------------------------------------------------ -void LocalServer::updateIncomingActivityTime() throw() { +void LocalServer::updateIncomingActivityTime() { a_lastIncomingActivityTime = anna::functions::millisecond(); LOGDEBUG ( @@ -622,7 +622,7 @@ void LocalServer::updateIncomingActivityTime() throw() { //------------------------------------------------------------------------------ //------------------------------------ LocalServer::updateOutgoingActivityTime() //------------------------------------------------------------------------------ -void LocalServer::updateOutgoingActivityTime(void) throw() { +void LocalServer::updateOutgoingActivityTime(void) { a_lastOutgoingActivityTime = anna::functions::millisecond(); LOGDEBUG ( diff --git a/source/diameter.comm/Message.cpp b/source/diameter.comm/Message.cpp index a07de1a..43c4301 100644 --- a/source/diameter.comm/Message.cpp +++ b/source/diameter.comm/Message.cpp @@ -26,13 +26,13 @@ using namespace anna::diameter::comm; const char* Message::asText(const OnExpiry::_v rc) -throw() { +{ static const char* text [] = { "Abandon", "Ignore", "Retransmit" }; return text [rc]; } string Message::asString() const -throw() { +{ string result("diameter::comm::Message { "); result += "ClassCode: "; result += ClassCode::asText(a_classCode); @@ -44,7 +44,7 @@ throw() { } anna::xml::Node* Message::asXML(anna::xml::Node* parent) const -throw() { +{ anna::xml::Node* result = parent->createChild("diameter.comm.Message"); result->createAttribute("ClassCode", ClassCode::asText(a_classCode)); result->createAttribute("OnExpiry", asText(a_onExpiry)); @@ -54,7 +54,7 @@ throw() { } //void Message::clear () -// throw () +// //{ // ::clear(); //// a_classCode = ClassCode::Undefined; @@ -62,7 +62,7 @@ throw() { //} -bool Message::fixRequestSequence(HopByHop hbh, EndToEnd ete) throw() { +bool Message::fixRequestSequence(HopByHop hbh, EndToEnd ete) { setRequestHopByHop(getHopByHop()); // original request hop-by-hop (backup) setRequestEndToEnd(getEndToEnd()); // original request end-to-end (backup) bool result = false; @@ -98,7 +98,7 @@ bool Message::fixRequestSequence(HopByHop hbh, EndToEnd ete) throw() { -void Message::restoreSequencesAfterFix() throw() { +void Message::restoreSequencesAfterFix() { LOGDEBUG( string msg("diameter::comm::restoreSequencesAfterFix { "); msg += "Hop by hop: "; @@ -119,7 +119,7 @@ void Message::restoreSequencesAfterFix() throw() { void Message::send(ClientSession& clientSession) const -throw(anna::RuntimeException) { +noexcept(false) { try { clientSession.getServer()->send((Message *)this); } catch(anna::RuntimeException&) { @@ -128,7 +128,7 @@ throw(anna::RuntimeException) { } void Message::send(ServerSession& serverSession) const -throw(anna::RuntimeException) { +noexcept(false) { try { serverSession.getClientSocket()->send((Message *)this); } catch(anna::RuntimeException&) { @@ -138,21 +138,21 @@ throw(anna::RuntimeException) { -anna::diameter::CommandId Message::getCommandId(bool &isRequest) const throw() { +anna::diameter::CommandId Message::getCommandId(bool &isRequest) const { diameter::CommandId result = diameter::codec::functions::getCommandId(getBody()); isRequest = result.second; // diameter::codec::functions::isRequest(result); return result; } -anna::diameter::ApplicationId Message::getApplicationId() const throw() { +anna::diameter::ApplicationId Message::getApplicationId() const { diameter::ApplicationId result = diameter::codec::functions::getApplicationId(getBody()); return result; } -HopByHop Message::getHopByHop() const throw() { +HopByHop Message::getHopByHop() const { return (diameter::codec::functions::getHopByHop(getBody())); } -EndToEnd Message::getEndToEnd() const throw() { +EndToEnd Message::getEndToEnd() const { return (diameter::codec::functions::getEndToEnd(getBody())); } diff --git a/source/diameter.comm/MessageStatistics.cpp b/source/diameter.comm/MessageStatistics.cpp index 00ba91a..8a87291 100644 --- a/source/diameter.comm/MessageStatistics.cpp +++ b/source/diameter.comm/MessageStatistics.cpp @@ -18,12 +18,12 @@ #include -void anna::diameter::comm::MessageStatistics::initialize(const std::string &name) throw(anna::RuntimeException) { +void anna::diameter::comm::MessageStatistics::initialize(const std::string &name) noexcept(false) { a_accumulator = anna::statistics::Engine::instantiate().createAccumulator(name); } -void anna::diameter::comm::MessageStatistics::process(const ConceptType::_v &conceptType, const anna::diameter::CommandId &cid, const double & value) throw(anna::RuntimeException) { +void anna::diameter::comm::MessageStatistics::process(const ConceptType::_v &conceptType, const anna::diameter::CommandId &cid, const double & value) noexcept(false) { // Development issue: // if (!a_accumulator) { diff --git a/source/diameter.comm/OriginHost.cpp b/source/diameter.comm/OriginHost.cpp index 498c6fa..42f1ab3 100644 --- a/source/diameter.comm/OriginHost.cpp +++ b/source/diameter.comm/OriginHost.cpp @@ -50,11 +50,11 @@ OriginHost::OriginHost(anna::diameter::comm::Engine* commEngine, unsigned int ap a_burstPopCounter = 0; } -const std::string &OriginHost::getName() const throw() { +const std::string &OriginHost::getName() const { return a_commEngine->getOriginHostName(); } -void OriginHost::createEntity(const std::string &entityRepresentation, const anna::Millisecond &bindTimeout, const anna::Millisecond &applicationTimeout) throw(anna::RuntimeException) { +void OriginHost::createEntity(const std::string &entityRepresentation, const anna::Millisecond &bindTimeout, const anna::Millisecond &applicationTimeout) noexcept(false) { anna::socket_v servers = anna::functions::getSocketVectorFromString(entityRepresentation); std::string entityDescription = "Launcher diameter entity for "; entityDescription += getName(); @@ -63,7 +63,7 @@ void OriginHost::createEntity(const std::string &entityRepresentation, const ann a_entity->setClassCodeTimeout(anna::diameter::comm::ClassCode::ApplicationMessage, applicationTimeout); } -void OriginHost::createDiameterServer(const std::string &serverRepresentation, int sessions, const anna::Millisecond &inactivityTimeout, const anna::Millisecond &applicationTimeout, const std::string &ceaPathfile) throw(anna::RuntimeException) { +void OriginHost::createDiameterServer(const std::string &serverRepresentation, int sessions, const anna::Millisecond &inactivityTimeout, const anna::Millisecond &applicationTimeout, const std::string &ceaPathfile) noexcept(false) { //if(sessions <= 0) return; negative implies no limit for accepted connections @@ -80,7 +80,7 @@ void OriginHost::createDiameterServer(const std::string &serverRepresentation, i a_diameterServer->setClassCodeTimeout(anna::diameter::comm::ClassCode::ApplicationMessage, applicationTimeout); } -anna::diameter::comm::Message *OriginHost::createCommMessage() throw(anna::RuntimeException) { +anna::diameter::comm::Message *OriginHost::createCommMessage() noexcept(false) { anna::diameter::comm::Message *result = a_commMessages.create(); result->setRetries(a_requestRetransmissions); if (a_requestRetransmissions > 0) result->setOnExpiry(anna::diameter::comm::Message::OnExpiry::Retransmit); @@ -88,19 +88,19 @@ anna::diameter::comm::Message *OriginHost::createCommMessage() throw(anna::Runti } -void OriginHost::releaseCommMessage(anna::diameter::comm::Message *msg) throw() { +void OriginHost::releaseCommMessage(anna::diameter::comm::Message *msg) { a_commMessages.release(msg); } -void OriginHost::writeLogFile(const anna::DataBlock & db, const std::string &logExtension, const std::string &detail) const throw() { +void OriginHost::writeLogFile(const anna::DataBlock & db, const std::string &logExtension, const std::string &detail) const { anna::diameter::codec::Message codecMsg; try { codecMsg.decode(db); } catch(anna::RuntimeException &ex) { ex.trace(); } writeLogFile(codecMsg, logExtension, detail); } // Already decoded: -void OriginHost::writeLogFile(const anna::diameter::codec::Message &decodedMessage, const std::string &logExtension, const std::string &detail) const throw() { +void OriginHost::writeLogFile(const anna::diameter::codec::Message &decodedMessage, const std::string &logExtension, const std::string &detail) const { // Open target file: std::string targetFile = a_logFile; @@ -162,7 +162,7 @@ void OriginHost::writeLogFile(const anna::diameter::codec::Message &decodedMessa out.close(); } -void OriginHost::writeBurstLogFile(const std::string &buffer) throw() { +void OriginHost::writeBurstLogFile(const std::string &buffer) { std::ofstream out(a_burstLogFile.c_str(), std::ifstream::out | std::ifstream::app); out.write(buffer.c_str(), buffer.size()); out.close(); // close() will be called when the object is destructed (i.e., when it goes out of scope). @@ -170,7 +170,7 @@ void OriginHost::writeBurstLogFile(const std::string &buffer) throw() { // earlier than it goes out of scope. } -int OriginHost::clearBurst() throw() { +int OriginHost::clearBurst() { int size = a_burstMessages.size(); if(size) { @@ -193,14 +193,14 @@ int OriginHost::clearBurst() throw() { return size; } -int OriginHost::loadBurstMessage(const anna::DataBlock & db) throw(anna::RuntimeException) { +int OriginHost::loadBurstMessage(const anna::DataBlock & db) noexcept(false) { anna::diameter::comm::Message *msg = createCommMessage(); msg->setBody(db); a_burstMessages[a_burstLoadIndx++] = msg; return (a_burstLoadIndx - 1); } -int OriginHost::stopBurst() throw() { +int OriginHost::stopBurst() { if(!a_burstActive) { std::string msg = "Burst launch is already stopped. Nothing done"; std::cout << msg << std::endl; @@ -213,7 +213,7 @@ int OriginHost::stopBurst() throw() { return (a_burstMessages.size() - (*a_burstDeliveryIt).first); } -int OriginHost::popBurst(int releaseAmount) throw() { +int OriginHost::popBurst(int releaseAmount) { if(!a_burstActive) { std::string msg = "Burst launch is stopped. Nothing done"; std::cout << msg << std::endl; @@ -233,7 +233,7 @@ int OriginHost::popBurst(int releaseAmount) throw() { return a_burstPopCounter; } -int OriginHost::pushBurst(int loadAmount) throw() { +int OriginHost::pushBurst(int loadAmount) { if(a_burstMessages.size() == 0) { std::string msg = "Burst data not found (empty list). Ignoring burst launch"; std::cout << msg << std::endl; @@ -257,7 +257,7 @@ int OriginHost::pushBurst(int loadAmount) throw() { return count; } -int OriginHost::sendBurst(int loadAmount) throw() { +int OriginHost::sendBurst(int loadAmount) { if(a_burstMessages.size() == 0) { std::string msg = "Burst data not found (empty list). Ignoring burst launch"; std::cout << msg << std::endl; @@ -280,7 +280,7 @@ int OriginHost::sendBurst(int loadAmount) throw() { return count; } -int OriginHost::startBurst(int initialLoad) throw() { +int OriginHost::startBurst(int initialLoad) { if(initialLoad < 1) { std::string msg = "No initial load is specified. Ignoring burst start"; std::cout << msg << std::endl; @@ -294,7 +294,7 @@ int OriginHost::startBurst(int initialLoad) throw() { return (pushBurst(initialLoad)); } -bool OriginHost::sendBurstMessage(bool anyway) throw() { +bool OriginHost::sendBurstMessage(bool anyway) { if(!anyway && !burstActive()) return false; if(a_burstPopCounter > 0) { @@ -358,7 +358,7 @@ bool OriginHost::sendBurstMessage(bool anyway) throw() { return result; } -std::string OriginHost::lookBurst(int order) const throw() { +std::string OriginHost::lookBurst(int order) const { if (order == -1) order = a_burstDeliveryIt->first; @@ -375,7 +375,7 @@ std::string OriginHost::lookBurst(int order) const throw() { return result; } -std::string OriginHost::gotoBurst(int order) throw() { +std::string OriginHost::gotoBurst(int order) { std::string result = "Position not found for order provided ("; std::map::iterator it = a_burstMessages.find(order - 1); @@ -390,7 +390,7 @@ std::string OriginHost::gotoBurst(int order) throw() { } anna::xml::Node* OriginHost::asXML(anna::xml::Node* parent) const -throw() { +{ anna::xml::Node* result = parent->createChild("OriginHost"); result->createAttribute("originHost", getName()); @@ -409,7 +409,7 @@ throw() { return result; } -std::string OriginHost::asXMLString() const throw() { +std::string OriginHost::asXMLString() const { anna::xml::Node root("root"); return anna::xml::Compiler().apply(asXML(&root)); } diff --git a/source/diameter.comm/OriginHostManager.cpp b/source/diameter.comm/OriginHostManager.cpp index d821a7a..ff929bf 100644 --- a/source/diameter.comm/OriginHostManager.cpp +++ b/source/diameter.comm/OriginHostManager.cpp @@ -15,7 +15,7 @@ using namespace anna::diameter::comm; -OriginHost *OriginHostManager::getOriginHost(const std::string &name) const throw() { +OriginHost *OriginHostManager::getOriginHost(const std::string &name) const { origin_hosts_it it = a_origin_hosts.find(name); if (it != a_origin_hosts.end()) return it->second; @@ -23,13 +23,13 @@ OriginHost *OriginHostManager::getOriginHost(const std::string &name) const thro return NULL; } -void OriginHostManager::registerOriginHost(const std::string &name, OriginHost* originHost) throw() { +void OriginHostManager::registerOriginHost(const std::string &name, OriginHost* originHost) { if (!originHost) return; // nothing done a_origin_hosts[name] = originHost; } anna::xml::Node* OriginHostManager::asXML(anna::xml::Node* parent) const -throw() { +{ anna::xml::Node* result = parent->createChild("OriginHostManager"); origin_hosts_it it_min(a_origin_hosts.begin()); origin_hosts_it it_max(a_origin_hosts.end()); diff --git a/source/diameter.comm/Response.cpp b/source/diameter.comm/Response.cpp index b2d108d..9676a03 100644 --- a/source/diameter.comm/Response.cpp +++ b/source/diameter.comm/Response.cpp @@ -27,7 +27,7 @@ diameter::comm::Response::response_pool diameter::comm::Response::st_responses; // Se invocan desde diameter::comm::Session //---------------------------------------------------------------------------------------- diameter::comm::Response* diameter::comm::Response::instance(const ClassCode::_v & classCode, const HopByHop hopByHop) -throw(anna::RuntimeException) { +noexcept(false) { diameter::comm::Response* result = st_responses.create(); result->a_classCode = classCode; result->a_hopByHop = hopByHop; @@ -41,7 +41,7 @@ throw(anna::RuntimeException) { } void diameter::comm::Response::release(diameter::comm::Response* response) -throw() { +{ try { st_responses.release(response); } catch(anna::RuntimeException& ex) { @@ -58,7 +58,7 @@ diameter::comm::Response::Response() : } void diameter::comm::Response::clear() -throw() { +{ a_resultCode = ResultCode::Undefined; a_session = NULL; a_timer = NULL; @@ -66,12 +66,12 @@ throw() { } void diameter::comm::Response::activateTimer() -throw(anna::RuntimeException) { +noexcept(false) { a_timer = TimerManager::instantiate().createTimer(this); } void diameter::comm::Response::cancelTimer() -throw() { +{ if(a_timer != NULL) { try { TimerManager::instantiate().cancelTimer(a_timer); @@ -84,13 +84,13 @@ throw() { } const char* diameter::comm::Response::asText(const ResultCode::_v rc) -throw() { +{ static const char* text [] = { "Undefined", "Success", "Timeout", "DiameterUnavailable" }; return text [rc]; } //bool diameter::comm::Response::isKeepAlive() const -//throw() { +//{ // if (a_request) { // if (a_request->getCommandId() == diameter::helpers::base::COMMANDID__Device_Watchdog_Request) // return true; @@ -100,7 +100,7 @@ throw() { //} string diameter::comm::Response::asString() const -throw() { +{ string result("diameter::comm::Response { ClassCode: "); result += ClassCode::asText(a_classCode); result += anna::functions::asString(" | HopByHop: %u", a_hopByHop); diff --git a/source/diameter.comm/Server.cpp b/source/diameter.comm/Server.cpp index 32b3efa..4721b10 100644 --- a/source/diameter.comm/Server.cpp +++ b/source/diameter.comm/Server.cpp @@ -28,7 +28,7 @@ using namespace anna::diameter; using namespace anna::diameter::comm; -void Server::initialize() throw() { +void Server::initialize() { a_parent = NULL; a_engine = NULL; a_clientSessions.clear(); // importante (el recycler creo que no lo tocaba) @@ -39,7 +39,7 @@ void Server::initialize() throw() { a_lastUsedResource = NULL; } -void Server::initializeStatisticResources() throw() { +void Server::initializeStatisticResources() { std::string accName = "remote server '"; accName += anna::functions::socketLiteralAsString(a_socket.first, a_socket.second); accName += "' from origin-realm '"; @@ -50,22 +50,22 @@ void Server::initializeStatisticResources() throw() { a_messageStatistics.initialize(accName); } -void Server::resetStatistics() throw() { +void Server::resetStatistics() { a_messageStatistics.getAccumulator()->reset(); } -void Server::updateProcessingTimeStatisticConcept(const double &value, const anna::diameter::CommandId &cid) throw() { +void Server::updateProcessingTimeStatisticConcept(const double &value, const anna::diameter::CommandId &cid) { a_messageStatistics.process(MessageStatistics::ConceptType::SentRequestProcessingTime, cid, value); LOGDEBUG(anna::Logger::debug(a_messageStatistics.getAccumulator()->asString(), ANNA_FILE_LOCATION)); } -void Server::updateReceivedMessageSizeStatisticConcept(const double &value, const anna::diameter::CommandId &cid) throw() { +void Server::updateReceivedMessageSizeStatisticConcept(const double &value, const anna::diameter::CommandId &cid) { a_messageStatistics.process(MessageStatistics::ConceptType::ReceivedMessageSize, cid, value); LOGDEBUG(anna::Logger::debug(a_messageStatistics.getAccumulator()->asString(), ANNA_FILE_LOCATION)); } -void Server::assertReady() throw(anna::RuntimeException) { +void Server::assertReady() noexcept(false) { if(a_clientSessions.size() != a_maxClientSessions) { std::string msg(asString()); msg += " | Non-configured server: you must add the remaining client-sessions before any operation (bind, send, etc.)"; @@ -75,7 +75,7 @@ void Server::assertReady() throw(anna::RuntimeException) { void Server::addClientSession(int socketId) -throw(anna::RuntimeException) { +noexcept(false) { if(a_clientSessions.size() == a_maxClientSessions) { LOGDEBUG ( @@ -94,7 +94,7 @@ throw(anna::RuntimeException) { a_clientSessions.push_back(s); } -int Server::getOTARequests() const throw() { +int Server::getOTARequests() const { int result = 0; for(std::vector::const_iterator it = begin(); it != end(); it++) @@ -104,7 +104,7 @@ int Server::getOTARequests() const throw() { } -bool Server::send(const Message* message, int socketId) throw(anna::RuntimeException) { +bool Server::send(const Message* message, int socketId) noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::Server", "send", ANNA_FILE_LOCATION)); assertReady(); bool fixedSocket = (socketId != -1); @@ -143,7 +143,7 @@ bool Server::send(const Message* message, int socketId) throw(anna::RuntimeExcep } -bool Server::broadcast(const Message* message) throw(anna::RuntimeException) { +bool Server::broadcast(const Message* message) noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::Server", "broadcast", ANNA_FILE_LOCATION)); assertReady(); bool allok = true; @@ -161,7 +161,7 @@ bool Server::broadcast(const Message* message) throw(anna::RuntimeException) { } -bool Server::bind() throw(anna::RuntimeException) { +bool Server::bind() noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::Server", "bind", ANNA_FILE_LOCATION)); assertReady(); a_deliveryIterator = begin(); @@ -179,7 +179,7 @@ bool Server::bind() throw(anna::RuntimeException) { return result; } -void Server::raiseAutoRecovery(bool autoRecovery) throw(anna::RuntimeException) { +void Server::raiseAutoRecovery(bool autoRecovery) noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::Server", "raiseAutoRecovery", ANNA_FILE_LOCATION)); assertReady(); a_deliveryIterator = begin(); @@ -188,7 +188,7 @@ void Server::raiseAutoRecovery(bool autoRecovery) throw(anna::RuntimeException) (*it)->setAutoRecovery(autoRecovery); } -void Server::setClassCodeTimeout(const ClassCode::_v v, const anna::Millisecond & millisecond) throw() { +void Server::setClassCodeTimeout(const ClassCode::_v v, const anna::Millisecond & millisecond) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::Server", "setClassCodeTimeout", ANNA_FILE_LOCATION)); assertReady(); @@ -203,7 +203,7 @@ void Server::setClassCodeTimeout(const ClassCode::_v v, const anna::Millisecond // Private close/destroy method -void Server::close(bool destroy) throw(anna::RuntimeException) { +void Server::close(bool destroy) noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("diameter::comm::Server", "close", ANNA_FILE_LOCATION)); if(!a_engine) @@ -216,29 +216,29 @@ void Server::close(bool destroy) throw(anna::RuntimeException) { } -void Server::childIdle() const throw() { +void Server::childIdle() const { // Check father entity idleness: if(idle()) a_parent->childIdle(); } -void Server::hide() throw() { +void Server::hide() { for(std::vector::iterator it = begin(); it != end(); it++) (*it)->hide(); } -void Server::show() throw() { +void Server::show() { for(std::vector::iterator it = begin(); it != end(); it++) (*it)->show(); } -bool Server::hidden() const throw() { +bool Server::hidden() const { for(std::vector::const_iterator it = begin(); it != end(); it++) if((*it)->shown()) return false; return true; } -bool Server::shown() const throw() { +bool Server::shown() const { for(std::vector::const_iterator it = begin(); it != end(); it++) if((*it)->hidden()) return false; @@ -247,7 +247,7 @@ bool Server::shown() const throw() { -std::string Server::socketAsString() const throw() { +std::string Server::socketAsString() const { std::string result = getAddress(); result += ":"; result += anna::functions::asString(getPort()); @@ -255,7 +255,7 @@ std::string Server::socketAsString() const throw() { } -std::string Server::asString() const throw() { +std::string Server::asString() const { std::string result("diameter::comm::Server { "); result += " | Parent Entity: "; result += a_parent->getDescription(); @@ -287,7 +287,7 @@ std::string Server::asString() const throw() { return result; } -anna::xml::Node* Server::asXML(anna::xml::Node* parent) const throw() { +anna::xml::Node* Server::asXML(anna::xml::Node* parent) const { anna::xml::Node* result = parent->createChild("diameter.Server"); result->createAttribute("ParentEntity", a_parent->getDescription()); result->createAttribute("ServerAddress", a_socket.first); @@ -311,38 +311,38 @@ anna::xml::Node* Server::asXML(anna::xml::Node* parent) const throw() { } -void Server::eventPeerShutdown(const ClientSession *clientSession) throw() { +void Server::eventPeerShutdown(const ClientSession *clientSession) { // Inform father entity: a_parent->eventPeerShutdown(clientSession); } -void Server::eventRequestRetransmission(const ClientSession* clientSession, Message *request) throw() { +void Server::eventRequestRetransmission(const ClientSession* clientSession, Message *request) { // Inform father entity: a_parent->eventRequestRetransmission(clientSession, request); } -void Server::eventResponse(const Response& response) throw(anna::RuntimeException) { +void Server::eventResponse(const Response& response) noexcept(false) { // Inform father entity: a_parent->eventResponse(response); } -void Server::eventRequest(ClientSession *clientSession, const anna::DataBlock & request) throw(anna::RuntimeException) { +void Server::eventRequest(ClientSession *clientSession, const anna::DataBlock & request) noexcept(false) { // Inform father entity: a_parent->eventRequest(clientSession, request); } -void Server::eventUnknownResponse(ClientSession *clientSession, const anna::DataBlock & response) throw(anna::RuntimeException) { +void Server::eventUnknownResponse(ClientSession *clientSession, const anna::DataBlock & response) noexcept(false) { // Inform father entity: a_parent->eventUnknownResponse(clientSession, response); } -void Server::eventDPA(ClientSession *clientSession, const anna::DataBlock & response) throw(anna::RuntimeException) { +void Server::eventDPA(ClientSession *clientSession, const anna::DataBlock & response) noexcept(false) { // Inform father entity: a_parent->eventDPA(clientSession, response); } -void Server::availabilityLost() throw() { +void Server::availabilityLost() { a_available = false; std::string socket = anna::functions::socketLiteralAsString(a_socket.first, a_socket.second); LOGDEBUG( @@ -360,7 +360,7 @@ void Server::availabilityLost() throw() { } -void Server::availabilityRecovered() throw() { +void Server::availabilityRecovered() { a_available = true; std::string socket = anna::functions::socketLiteralAsString(a_socket.first, a_socket.second); LOGDEBUG( @@ -379,7 +379,7 @@ void Server::availabilityRecovered() throw() { -bool Server::refreshAvailability() throw() { +bool Server::refreshAvailability() { // Here available if(a_available) { // check not-bound state for all client-sessions: bool isolate = true; @@ -411,7 +411,7 @@ bool Server::refreshAvailability() throw() { //------------------------------------------------------------------------------ //---------------------------------------- Server::updateIncomingActivityTime() //------------------------------------------------------------------------------ -void Server::updateIncomingActivityTime() throw() { +void Server::updateIncomingActivityTime() { a_lastIncomingActivityTime = anna::functions::millisecond(); LOGDEBUG ( @@ -426,7 +426,7 @@ void Server::updateIncomingActivityTime() throw() { //------------------------------------------------------------------------------ //---------------------------------------- Server::updateOutgoingActivityTime() //------------------------------------------------------------------------------ -void Server::updateOutgoingActivityTime(void) throw() { +void Server::updateOutgoingActivityTime(void) { a_lastOutgoingActivityTime = anna::functions::millisecond(); LOGDEBUG ( diff --git a/source/diameter.comm/ServerSession.cpp b/source/diameter.comm/ServerSession.cpp index 4a146b8..b88da8d 100644 --- a/source/diameter.comm/ServerSession.cpp +++ b/source/diameter.comm/ServerSession.cpp @@ -58,7 +58,7 @@ ServerSession::ServerSession() : Session("diameter::comm::ServerSession", "Diame a_dwr(ClassCode::ApplicationMessage) // not actually needed; Message is application type by default { initialize(); } -void ServerSession::initialize() throw() { +void ServerSession::initialize() { Session::initialize(); a_parent = NULL; a_clientSocket = NULL; @@ -67,21 +67,21 @@ void ServerSession::initialize() throw() { //ServerSession::~ServerSession() {;} -void ServerSession::setClientSocket(anna::comm::ClientSocket *clientSocket) throw() { +void ServerSession::setClientSocket(anna::comm::ClientSocket *clientSocket) { a_clientSocket = clientSocket; a_clientSocket->setReceiverFactory(a_receiverFactory); } -const std::string& ServerSession::getAddress() const throw() { +const std::string& ServerSession::getAddress() const { return a_parent->getKey().first; } -int ServerSession::getPort() const throw() { +int ServerSession::getPort() const { return a_parent->getKey().second; } -const Response* ServerSession::send(const Message* message) throw(anna::RuntimeException) { +const Response* ServerSession::send(const Message* message) noexcept(false) { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "send", ANNA_FILE_LOCATION)); if(!message) @@ -260,7 +260,7 @@ const Response* ServerSession::send(const Message* message) throw(anna::RuntimeE -bool ServerSession::unbind(bool forceDisconnect) throw(anna::RuntimeException) { +bool ServerSession::unbind(bool forceDisconnect) noexcept(false) { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "unbind", ANNA_FILE_LOCATION)); if(a_state == State::Closed) @@ -307,12 +307,12 @@ bool ServerSession::unbind(bool forceDisconnect) throw(anna::RuntimeException) { return false; } -void ServerSession::eventPeerShutdown() throw() { +void ServerSession::eventPeerShutdown() { // Inform father server: a_parent->eventPeerShutdown(this); } -void ServerSession::eventRequestRetransmission(Message *request) throw() { +void ServerSession::eventRequestRetransmission(Message *request) { // OAM OamModule &oamModule = OamModule::instantiate(); @@ -323,22 +323,22 @@ void ServerSession::eventRequestRetransmission(Message *request) throw() { a_parent->eventRequestRetransmission(this, request); } -void ServerSession::eventResponse(const Response& response) throw(anna::RuntimeException) { +void ServerSession::eventResponse(const Response& response) noexcept(false) { // Inform father server: a_parent->eventResponse(response); } -void ServerSession::eventRequest(const anna::DataBlock &request) throw(anna::RuntimeException) { +void ServerSession::eventRequest(const anna::DataBlock &request) noexcept(false) { // Inform father server: a_parent->eventRequest(this, request); } -void ServerSession::eventUnknownResponse(const anna::DataBlock& response) throw(anna::RuntimeException) { +void ServerSession::eventUnknownResponse(const anna::DataBlock& response) noexcept(false) { // Inform father server: a_parent->eventUnknownResponse(this, response); } -void ServerSession::eventDPA(const anna::DataBlock& response) throw(anna::RuntimeException) { +void ServerSession::eventDPA(const anna::DataBlock& response) noexcept(false) { // Inform father server: a_parent->eventDPA(this, response); } @@ -347,7 +347,7 @@ void ServerSession::eventDPA(const anna::DataBlock& response) throw(anna::Runtim // Se invoca desde el diameter::comm::Receiver //------------------------------------------------------------------------------------------ void ServerSession::receive(const anna::comm::Message& message) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "receive", ANNA_FILE_LOCATION)); // Activity: updateIncomingActivityTime(); @@ -548,7 +548,7 @@ throw(anna::RuntimeException) { unbind(true /* always immediate */); } -void ServerSession::finalize() throw() { +void ServerSession::finalize() { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "finalize", ANNA_FILE_LOCATION)); // Configuration overiddings setOnDisconnect(OnDisconnect::IgnorePendings); @@ -585,7 +585,7 @@ void ServerSession::finalize() throw() { void ServerSession::sendCEA() -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "sendCEA", ANNA_FILE_LOCATION)); anna::DataBlock cea(true); a_engine->readCEA(cea, a_cer.getBody()); // Asume that CEA is valid ... @@ -636,7 +636,7 @@ throw(anna::RuntimeException) { } void ServerSession::sendDWA() -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "sendDWA", ANNA_FILE_LOCATION)); anna::DataBlock dwa(true); a_engine->readDWA(dwa, a_dwr.getBody()); // Asume that DWA is valid ... @@ -654,7 +654,7 @@ throw(anna::RuntimeException) { // Se invoca desde diameter::comm::Timer //------------------------------------------------------------------------- void ServerSession::expireResponse(diameter::comm::Response* response) -throw() { +{ LOGMETHOD(anna::TraceMethod traceMethod(a_className, "expireResponse", ANNA_FILE_LOCATION)); Session::expireResponse(response); // OAM @@ -667,7 +667,7 @@ throw() { } std::string ServerSession::asString() const -throw() { +{ string result = Session::asString(); result += " | Parent Local Server: "; result += anna::functions::socketLiteralAsString(getAddress(), getPort()); @@ -682,7 +682,7 @@ throw() { } anna::xml::Node* ServerSession::asXML(anna::xml::Node* parent) const -throw() { +{ anna::xml::Node* result = Session::asXML(parent); parent->createChild("diameter.comm.ServerSession"); result->createAttribute("ParentLocalServer", anna::functions::socketLiteralAsString(getAddress(), getPort())); @@ -697,7 +697,7 @@ throw() { //------------------------------------------------------------------------------ //------------------------------------------------------ ServerSession::expire() //------------------------------------------------------------------------------ -void ServerSession::expire(anna::timex::Engine *timeController) throw(anna::RuntimeException) { +void ServerSession::expire(anna::timex::Engine *timeController) noexcept(false) { LOGMETHOD(anna::TraceMethod traceMethod(a_className, "expire (inactivity check timer)", ANNA_FILE_LOCATION)); LOGWARNING(anna::Logger::warning("Detecting anomaly (too inactivity time) over server session. Resetting", ANNA_FILE_LOCATION)); // OAM @@ -716,14 +716,14 @@ void ServerSession::expire(anna::timex::Engine *timeController) throw(anna::Runt unbind(true /* always immediate */); // no delegamos en un planning o similar } -void ServerSession::setAllowedInactivityTime(const anna::Millisecond & allowedInactivityTime) throw() { +void ServerSession::setAllowedInactivityTime(const anna::Millisecond & allowedInactivityTime) { setTimeout(allowedInactivityTime); } //------------------------------------------------------------------------------ //---------------------------------- ServerSession::updateIncomingActivityTime() //------------------------------------------------------------------------------ -void ServerSession::updateIncomingActivityTime() throw() { +void ServerSession::updateIncomingActivityTime() { Session::updateIncomingActivityTime(); a_parent->updateIncomingActivityTime(); } @@ -732,7 +732,7 @@ void ServerSession::updateIncomingActivityTime() throw() { //------------------------------------------------------------------------------ //---------------------------------- ServerSession::updateOutgoingActivityTime() //------------------------------------------------------------------------------ -void ServerSession::updateOutgoingActivityTime(void) throw() { +void ServerSession::updateOutgoingActivityTime(void) { Session::updateOutgoingActivityTime(); a_parent->updateOutgoingActivityTime(); } @@ -741,7 +741,7 @@ void ServerSession::updateOutgoingActivityTime(void) throw() { //------------------------------------------------------------------------------ //----------------------------------------------- ServerSession::countSendings() //------------------------------------------------------------------------------ -void ServerSession::countSendings(const diameter::CommandId & cid, unsigned int aid, bool ok)throw() { +void ServerSession::countSendings(const diameter::CommandId & cid, unsigned int aid, bool ok){ OamModule &oamModule = OamModule::instantiate(); ApplicationMessageOamModule &appMsgOamModule = ApplicationMessageOamModule::instantiate(); diff --git a/source/diameter.comm/ServerSessionReceiver.cpp b/source/diameter.comm/ServerSessionReceiver.cpp index a4fac54..58cb833 100644 --- a/source/diameter.comm/ServerSessionReceiver.cpp +++ b/source/diameter.comm/ServerSessionReceiver.cpp @@ -24,13 +24,13 @@ using namespace anna::diameter::comm; void ServerSessionReceiver::apply(anna::comm::ClientSocket& clientSocket, const anna::comm::Message& message) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod tm("diameter::comm::ServerSessionReceiver", "apply", ANNA_FILE_LOCATION)); a_session->receive(message); } void ServerSessionReceiver::eventBreakLocalConnection(const anna::comm::ClientSocket& clientSocket) -throw() { +{ LOGMETHOD(anna::TraceMethod tm("diameter::comm::ServerSessionReceiver", "eventBreakLocalConnection", ANNA_FILE_LOCATION)); //if (!a_session) return; // caso de los Engine::closeServerSession a_session->finalize(); diff --git a/source/diameter.comm/ServerSocket.cpp b/source/diameter.comm/ServerSocket.cpp index 1d7620c..b968686 100644 --- a/source/diameter.comm/ServerSocket.cpp +++ b/source/diameter.comm/ServerSocket.cpp @@ -30,7 +30,7 @@ ServerSocket::ServerSocket(const anna::comm::INetAddress &localAddress, LocalSer a_localServer(localServer) {;} -bool ServerSocket::eventAcceptConnection(const anna::comm::ClientSocket &clientSocket) throw(anna::RuntimeException) { +bool ServerSocket::eventAcceptConnection(const anna::comm::ClientSocket &clientSocket) noexcept(false) { LOGMETHOD(anna::TraceMethod tttm("anna::diameter::comm::ServerSocket", "eventAcceptConnection", ANNA_FILE_LOCATION)); a_localServer->createServerSession(clientSocket); // // Aprovecho para hacer el purgado de idle() + deprecated, y así me evito un temporizador de purgado: diff --git a/source/diameter.comm/Session.cpp b/source/diameter.comm/Session.cpp index 736635c..4fb5ab4 100644 --- a/source/diameter.comm/Session.cpp +++ b/source/diameter.comm/Session.cpp @@ -60,7 +60,7 @@ Session::Session(const char *className, const char *timerName) : anna::timex::Ti initialize(); } -void Session::initialize() throw() { +void Session::initialize() { a_state = State::Closed; a_socketId = 0; a_lastIncomingActivityTime = (anna::Millisecond)0; @@ -74,7 +74,7 @@ void Session::initialize() throw() { //Session::~Session() {;} -void Session::initializeSequences() throw() { +void Session::initializeSequences() { // Sequences // // Hop-by-Hop Identifier @@ -115,7 +115,7 @@ void Session::initializeSequences() throw() { } void Session::sendDPA() -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod traceMethod("anna::diameter::comm::Session", "sendDPA", ANNA_FILE_LOCATION)); anna::DataBlock dpa(true); a_engine->readDPA(dpa, a_dpr.getBody()); // Asume that DPA is valid ... @@ -138,7 +138,7 @@ throw(anna::RuntimeException) { activateActionTimer(anna::diameter::comm::Timer::Type::SessionUnbind); } -void Session::setState(State::_v state) throw() { +void Session::setState(State::_v state) { LOGDEBUG( if(state != a_state) { @@ -153,7 +153,7 @@ void Session::setState(State::_v state) throw() { } -void Session::activateActionTimer(const anna::diameter::comm::Timer::Type::_v type) throw() { +void Session::activateActionTimer(const anna::diameter::comm::Timer::Type::_v type) { LOGMETHOD(anna::TraceMethod traceMethod("anna::diameter::comm::Session", "activateActionTimer", ANNA_FILE_LOCATION)); cancelTimer(); // Session timer @@ -169,7 +169,7 @@ void Session::activateActionTimer(const anna::diameter::comm::Timer::Type::_v ty } -void Session::cancelActionTimer() throw() { +void Session::cancelActionTimer() { LOGMETHOD(anna::TraceMethod traceMethod("anna::diameter::comm::Session", "cancelActionTimer", ANNA_FILE_LOCATION)); if(a_actionTimer) { @@ -188,7 +188,7 @@ void Session::cancelActionTimer() throw() { } -void Session::activateTimer() throw() { +void Session::activateTimer() { LOGMETHOD(anna::TraceMethod traceMethod("anna::diameter::comm::Session", "activateTimer", ANNA_FILE_LOCATION)); cancelActionTimer(); @@ -209,7 +209,7 @@ void Session::activateTimer() throw() { } -void Session::cancelTimer() throw() { +void Session::cancelTimer() { LOGMETHOD(anna::TraceMethod traceMethod("anna::diameter::comm::Session", "cancelTimer", ANNA_FILE_LOCATION)); if(isActive()) { @@ -235,7 +235,7 @@ void Session::cancelTimer() throw() { // Se invoca desde diameter::comm::Timer //------------------------------------------------------------------------- void Session::expireResponse(diameter::comm::Response* response) -throw() { +{ LOGMETHOD(anna::TraceMethod traceMethod("anna::diameter::comm::Session", "expireResponse", ANNA_FILE_LOCATION)); bool doUnbind = false; bool doRetransmission = false; @@ -290,7 +290,7 @@ throw() { if(doUnbind) unbind(); } -void Session::finalize() throw() { +void Session::finalize() { LOGMETHOD(anna::TraceMethod traceMethod("anna::diameter::comm::Session", "finalize", ANNA_FILE_LOCATION)); setState(State::Closed); cancelTimer(); // Session timer @@ -353,7 +353,7 @@ void Session::finalize() throw() { } void Session::response_add(Response* response) -throw() { +{ a_responses.add(response); response->setSession(this); @@ -365,7 +365,7 @@ throw() { } void Session::response_erase(Response* response) -throw() { +{ a_responses.erase(response); Response::release(response); @@ -377,7 +377,7 @@ throw() { } Response* Session::response_find(const HopByHop hopByHop) -throw(anna::RuntimeException) { +noexcept(false) { diameter::comm::Response* result = a_responses.find(hopByHop); // if (result == NULL) { // string msg(asString()); @@ -389,7 +389,7 @@ throw(anna::RuntimeException) { } std::string Session::asString() const -throw() { +{ string result(a_className); result += " { "; result += anna::timex::Timer::asString(); @@ -420,7 +420,7 @@ throw() { } anna::xml::Node* Session::asXML(anna::xml::Node* parent) const -throw() { +{ //parent = anna::timex::Timer::asXML(parent); anna::xml::Node* result = parent->createChild("diameter.comm.Session"); result->createAttribute("SocketId", anna::functions::asString(a_socketId)); @@ -450,13 +450,13 @@ throw() { } const char* Session::asText(const State::_v state) -throw() { +{ static const char* text [] = { "Closed", "WaitingBind", "Bound", "Failover", "Suspect", "WaitingDPA", "Disconnecting", "Closing" }; return text [state]; } const char* Session::asText(const OnDisconnect::_v onDisconnect) -throw() { +{ static const char* text [] = { "IgnorePendings", "WaitPendings" }; return text [onDisconnect]; } @@ -464,7 +464,7 @@ throw() { HopByHop Session::SortById::value(const Response* response) -throw() { +{ return response->getHopByHop(); } @@ -472,7 +472,7 @@ throw() { //------------------------------------------------------------------------------ //---------------------------------------- Session::updateIncomingActivityTime() //------------------------------------------------------------------------------ -void Session::updateIncomingActivityTime() throw() { +void Session::updateIncomingActivityTime() { a_lastIncomingActivityTime = anna::functions::millisecond(); LOGDEBUG ( @@ -486,7 +486,7 @@ void Session::updateIncomingActivityTime() throw() { //------------------------------------------------------------------------------ //---------------------------------------- Session::updateOutgoingActivityTime() //------------------------------------------------------------------------------ -void Session::updateOutgoingActivityTime(void) throw() { +void Session::updateOutgoingActivityTime(void) { a_lastOutgoingActivityTime = anna::functions::millisecond(); LOGDEBUG ( diff --git a/source/diameter.comm/Timer.cpp b/source/diameter.comm/Timer.cpp index e113d24..355666d 100644 --- a/source/diameter.comm/Timer.cpp +++ b/source/diameter.comm/Timer.cpp @@ -19,7 +19,7 @@ using namespace std; using namespace anna; void diameter::comm::Timer::expire(anna::timex::Engine*) -throw(anna::RuntimeException) { +noexcept(false) { Response* response = NULL; Session* session = NULL; LocalServer* localServer = NULL; @@ -93,13 +93,13 @@ throw(anna::RuntimeException) { } const char* diameter::comm::Timer::asText(const Type::_v type) -throw() { +{ static const char* text [] = { "ResponseExpiration", "SessionUnbind", "SessionRecover", "LocalServerAttach" }; return text [type]; } string diameter::comm::Timer::asString() const -throw() { +{ string result("anna::diameter::comm::Timer { "); result += anna::timex::Transaction::asString(); result += " Type: "; diff --git a/source/diameter.comm/TimerManager.cpp b/source/diameter.comm/TimerManager.cpp index c98e5d6..c17b511 100644 --- a/source/diameter.comm/TimerManager.cpp +++ b/source/diameter.comm/TimerManager.cpp @@ -30,7 +30,7 @@ TimerManager::TimerManager() : // seccion critica, lo que evita interbloqueos. //------------------------------------------------------------------------------------------------------- Timer* TimerManager::createTimer(Session* session, const anna::diameter::comm::Timer::Type::_v type) -throw(anna::RuntimeException) { +noexcept(false) { Timer* result(NULL); if(a_timeController == NULL) @@ -57,7 +57,7 @@ throw(anna::RuntimeException) { Timer* TimerManager::createTimer(Response* response) -throw(anna::RuntimeException) { +noexcept(false) { Timer* result(NULL); if(a_timeController == NULL) @@ -84,7 +84,7 @@ throw(anna::RuntimeException) { Timer* TimerManager::createTimer(LocalServer* localServer) -throw(anna::RuntimeException) { +noexcept(false) { Timer* result(NULL); if(a_timeController == NULL) @@ -108,7 +108,7 @@ throw(anna::RuntimeException) { void TimerManager::cancelTimer(Timer* timer) -throw() { +{ if(timer == NULL) return; @@ -132,7 +132,7 @@ throw() { // Se invoca automaticamente desde anna::timex::Engine //------------------------------------------------------------------------------------------ void TimerManager::release(anna::timex::TimeEvent* timeEvent) -throw() { +{ Timer* timer = static_cast (timeEvent); timer->setContext(NULL); a_timers.release(timer); diff --git a/source/diameter.comm/Transport.cpp b/source/diameter.comm/Transport.cpp index eda7e6e..b85ad8b 100644 --- a/source/diameter.comm/Transport.cpp +++ b/source/diameter.comm/Transport.cpp @@ -34,7 +34,7 @@ Transport::~Transport() { * La longitud se calcula con los primeros 4 bytes (el primer byte se ignora, pues es la version diameter) */ int Transport::calculeSize(const anna::DataBlock& dataBlock) -throw(anna::RuntimeException) { +noexcept(false) { const int size = dataBlock.getSize(); if(size < 4) @@ -48,7 +48,7 @@ throw(anna::RuntimeException) { } const anna::DataBlock& Transport::code(anna::comm::Message& message) -throw(anna::RuntimeException) { +noexcept(false) { LOGMETHOD(anna::TraceMethod ttmm(anna::Logger::Local7, "anna::diameter::comm::Transport", "code", ANNA_FILE_LOCATION)); a_forCode = message.code(); return a_forCode; @@ -59,7 +59,7 @@ throw(anna::RuntimeException) { // Cada ClientSocket tiene su anna::diameter::comm::Transport asociado //-------------------------------------------------------------------------------- const anna::comm::Message* Transport::decode(const anna::DataBlock& input) -throw(anna::RuntimeException) { +noexcept(false) { anna::comm::Message* inputMessage = static_cast (getInputMessage()); inputMessage->setBody(input); return inputMessage; diff --git a/source/diameter.comm/internal/sccs.cpp b/source/diameter.comm/internal/sccs.cpp index 53afbac..a19abcc 100644 --- a/source/diameter.comm/internal/sccs.cpp +++ b/source/diameter.comm/internal/sccs.cpp @@ -14,7 +14,7 @@ anna_define_sccs_tag_ex(diameter_comm, diameter.comm, 0) void anna::diameter::comm::sccs::activate() -throw() { +{ //anna::sccs::activate(); //anna::comm::sccs::activate(); anna::ModuleManager::instantiate().insert(anna_use_sccs_tag(diameter_comm), 0); diff --git a/source/diameter/app/dcca/Message.cpp b/source/diameter/app/dcca/Message.cpp index 529a39e..1539731 100644 --- a/source/diameter/app/dcca/Message.cpp +++ b/source/diameter/app/dcca/Message.cpp @@ -13,7 +13,7 @@ using namespace anna::diameter::app::dcca; -const qosProfile_t & Message::decode3GPPGPRSNegQoSProfile() throw(anna::RuntimeException) { +const qosProfile_t & Message::decode3GPPGPRSNegQoSProfile() noexcept(false) { a_qosProfile.reset(); //const std::string & utf8 = get3GPPGPRSNegQoSProfile()->getValue(); // TODO: decode here ... diff --git a/source/diameter/codec/Avp.cpp b/source/diameter/codec/Avp.cpp index 2338111..14d5aa7 100644 --- a/source/diameter/codec/Avp.cpp +++ b/source/diameter/codec/Avp.cpp @@ -77,7 +77,7 @@ Avp::~Avp() { //------------------------------------------------------------------------------ //------------------------------------------------------------- Avp::setEngine() //------------------------------------------------------------------------------ -void Avp::setEngine(Engine *engine) throw() { +void Avp::setEngine(Engine *engine) { if (a_engine && engine != a_engine) { LOGWARNING(anna::Logger::warning("Ignored: it is not a good practice to change the codec engine once assigned. Clear the avp first to set the engine again.", ANNA_FILE_LOCATION)); return; @@ -89,7 +89,7 @@ void Avp::setEngine(Engine *engine) throw() { //------------------------------------------------------------------------------ //------------------------------------------------------------- Avp::getEngine() //------------------------------------------------------------------------------ -Engine * Avp::getEngine() const throw(anna::RuntimeException) { +Engine * Avp::getEngine() const noexcept(false) { if(!a_engine) throw anna::RuntimeException("Invalid codec engine reference (NULL). Use setEngine() to set the corresponding codec engine", ANNA_FILE_LOCATION); @@ -100,7 +100,7 @@ Engine * Avp::getEngine() const throw(anna::RuntimeException) { //------------------------------------------------------------------------------ //------------------------------------------------------------ Avp::initialize() //------------------------------------------------------------------------------ -void Avp::initialize() throw() { +void Avp::initialize() { a_id = helpers::AVPID__AVP; // (0,0) a_flags = 0x00; a_insertionPositionForChilds = 0; @@ -132,7 +132,7 @@ void Avp::initialize() throw() { //------------------------------------------------------------------------------ //----------------------------------------------------------------- Avp::clear() //------------------------------------------------------------------------------ -void Avp::clear() throw(anna::RuntimeException) { +void Avp::clear() noexcept(false) { delete a_OctetString; delete a_Integer32; delete a_Integer64; @@ -167,7 +167,7 @@ void Avp::clear() throw(anna::RuntimeException) { //------------------------------------------------------------------------------ //-------------------------------------------------------------- Avp::avp_find() //------------------------------------------------------------------------------ -avp_iterator Avp::avp_find(avp_container &avps, AvpId id, unsigned int position) throw() { +avp_iterator Avp::avp_find(avp_container &avps, AvpId id, unsigned int position) { int match = 0; Avp *aux; @@ -188,7 +188,7 @@ avp_iterator Avp::avp_find(avp_container &avps, AvpId id, unsigned int position) //------------------------------------------------------------------------------ //---------------------------------------------------------------- Avp::addAvp() //------------------------------------------------------------------------------ -Avp * Avp::addAvp(avp_container &avps, int &insertionPositionForChilds, AvpId id, Engine *engine) throw() { +Avp * Avp::addAvp(avp_container &avps, int &insertionPositionForChilds, AvpId id, Engine *engine) { Avp * result = engine->createAvp(NULL); result->setId(id); addChild(avps, insertionPositionForChilds, result); @@ -199,7 +199,7 @@ Avp * Avp::addAvp(avp_container &avps, int &insertionPositionForChilds, AvpId id //------------------------------------------------------------------------------ //---------------------------------------------------------------- Avp::addAvp() //------------------------------------------------------------------------------ -Avp * Avp::addAvp(Avp * avp) throw(anna::RuntimeException) { +Avp * Avp::addAvp(Avp * avp) noexcept(false) { if(!avp) return NULL; if (avp->getEngine() != getEngine()) return NULL; addChild(avp); @@ -210,7 +210,7 @@ Avp * Avp::addAvp(Avp * avp) throw(anna::RuntimeException) { //------------------------------------------------------------------------------ //------------------------------------------------------------- Avp::removeAvp() //------------------------------------------------------------------------------ -bool Avp::removeAvp(avp_container &avps, find_container &finds, AvpId id, int ocurrence, Engine *engine) throw() { +bool Avp::removeAvp(avp_container &avps, find_container &finds, AvpId id, int ocurrence, Engine *engine) { bool removed = false; bool do_remove = true; int position = ocurrence; @@ -263,7 +263,7 @@ bool Avp::removeAvp(avp_container &avps, find_container &finds, AvpId id, int oc //------------------------------------------------------------------------------ //-------------------------------------------------------------- Avp::countAvp() //------------------------------------------------------------------------------ -int Avp::countAvp(const avp_container &avps, AvpId id) throw() { +int Avp::countAvp(const avp_container &avps, AvpId id) { int result = 0; const_avp_iterator it; @@ -276,7 +276,7 @@ int Avp::countAvp(const avp_container &avps, AvpId id) throw() { //------------------------------------------------------------------------------ //-------------------------------------------------------------- Avp::firstAvp() //------------------------------------------------------------------------------ -const Avp* Avp::firstAvp(const avp_container &avps, AvpId id) throw() { +const Avp* Avp::firstAvp(const avp_container &avps, AvpId id) { const_avp_iterator it = avp_find(avps, id, 1); if(it != avps.end()) @@ -289,7 +289,7 @@ const Avp* Avp::firstAvp(const avp_container &avps, AvpId id) throw() { //------------------------------------------------------------------------------ //----------------------------------------------------------- Avp::countChilds() //------------------------------------------------------------------------------ -int Avp::countChilds(const avp_container &avps) throw() { +int Avp::countChilds(const avp_container &avps) { return avps.size(); } @@ -297,7 +297,7 @@ int Avp::countChilds(const avp_container &avps) throw() { //------------------------------------------------------------------------------ //---------------------------------------------------------------- Avp::getAvp() //------------------------------------------------------------------------------ -const Avp *Avp::getAvp(const avp_container &avps, find_container &finds, AvpId id, int ocurrence, Engine *engine, anna::Exception::Mode::_v emode) throw(anna::RuntimeException) { +const Avp *Avp::getAvp(const avp_container &avps, find_container &finds, AvpId id, int ocurrence, Engine *engine, anna::Exception::Mode::_v emode) noexcept(false) { if(ocurrence == 0) { LOGDEBUG(anna::Logger::debug("Ocurrence number zero has no sense. NULL returned.", ANNA_FILE_LOCATION)); return NULL; @@ -386,7 +386,7 @@ const Avp *Avp::getAvp(const avp_container &avps, find_container &finds, AvpId i //------------------------------------------------------------------------------ //--------------------------------------------------------------- Avp::_getAvp() //------------------------------------------------------------------------------ -const Avp *Avp::_getAvp(AvpId id, int ocurrence, anna::Exception::Mode::_v emode) const throw(anna::RuntimeException) { +const Avp *Avp::_getAvp(AvpId id, int ocurrence, anna::Exception::Mode::_v emode) const noexcept(false) { // Dictionary stack avp and format (this): const stack::Avp *stackAvp = getStackAvp(); const stack::Format *stackFormat = stackAvp ? (stackAvp->getFormat()) : NULL /*Unknown*/; @@ -401,7 +401,7 @@ const Avp *Avp::_getAvp(AvpId id, int ocurrence, anna::Exception::Mode::_v emode //------------------------------------------------------------------------------ //---------------------------------------------------------- Avp::assertFormat() //------------------------------------------------------------------------------ -void Avp::assertFormat(const std::string &name) const throw(anna::RuntimeException) { +void Avp::assertFormat(const std::string &name) const noexcept(false) { // Dictionary stack avp and format: const stack::Avp *stackAvp = getStackAvp(); const stack::Format *stackFormat = stackAvp ? (stackAvp->getFormat()) : NULL /*Unknown*/; @@ -423,7 +423,7 @@ void Avp::assertFormat(const std::string &name) const throw(anna::RuntimeExcepti //------------------------------------------------------------------------------ //--------------------------------------------------------------- Avp::flagsOK() //------------------------------------------------------------------------------ -bool Avp::flagsOK() const throw() { +bool Avp::flagsOK() const { // Dictionary stack avp: const stack::Avp *stackAvp = getStackAvp(); @@ -495,7 +495,7 @@ bool Avp::flagsOK() const throw() { //------------------------------------------------------------------------------ //----------------------------------------------------------------- Avp::setId() //------------------------------------------------------------------------------ -void Avp::setId(AvpId id) throw(anna::RuntimeException) { +void Avp::setId(AvpId id) noexcept(false) { // Generic AVP assignment has no sense if(id == helpers::AVPID__AVP) return; @@ -557,7 +557,7 @@ void Avp::setId(AvpId id) throw(anna::RuntimeException) { //------------------------------------------------------------------------------ //----------------------------------------------------------------- Avp::setId() //------------------------------------------------------------------------------ -void Avp::setId(const char *name) throw(anna::RuntimeException) { +void Avp::setId(const char *name) noexcept(false) { setId(getEngine()->avpIdForName(name)); } @@ -565,7 +565,7 @@ void Avp::setId(const char *name) throw(anna::RuntimeException) { //------------------------------------------------------------------------------ //---------------------------------------------------------------- Avp::addAvp() //------------------------------------------------------------------------------ -Avp * Avp::addAvp(const char *name) throw(anna::RuntimeException) { +Avp * Avp::addAvp(const char *name) noexcept(false) { return addAvp(getEngine()->avpIdForName(name)); } @@ -573,7 +573,7 @@ Avp * Avp::addAvp(const char *name) throw(anna::RuntimeException) { //------------------------------------------------------------------------------ //------------------------------------------------------------- Avp::removeAvp() //------------------------------------------------------------------------------ -bool Avp::removeAvp(const char *name, int ocurrence) throw(anna::RuntimeException) { +bool Avp::removeAvp(const char *name, int ocurrence) noexcept(false) { return removeAvp(getEngine()->avpIdForName(name), ocurrence); } @@ -581,7 +581,7 @@ bool Avp::removeAvp(const char *name, int ocurrence) throw(anna::RuntimeExceptio //------------------------------------------------------------------------------ //--------------------------------------------------------------- Avp::_getAvp() //------------------------------------------------------------------------------ -const Avp *Avp::_getAvp(const char *name, int ocurrence, anna::Exception::Mode::_v emode) const throw(anna::RuntimeException) { +const Avp *Avp::_getAvp(const char *name, int ocurrence, anna::Exception::Mode::_v emode) const noexcept(false) { return getAvp(getEngine()->avpIdForName(name), ocurrence, emode); } @@ -589,14 +589,14 @@ const Avp *Avp::_getAvp(const char *name, int ocurrence, anna::Exception::Mode:: //------------------------------------------------------------------------------ //-------------------------------------------------------------- Avp::countAvp() //------------------------------------------------------------------------------ -int Avp::countAvp(const char *name) const throw(anna::RuntimeException) { +int Avp::countAvp(const char *name) const noexcept(false) { return countAvp(getEngine()->avpIdForName(name)); } //------------------------------------------------------------------------------ //------------------------------------------------------------- Avp::getLength() //------------------------------------------------------------------------------ -U24 Avp::getLength() const throw() { +U24 Avp::getLength() const { U24 result; // Avp format: const stack::Avp *stackAvp = getStackAvp(); @@ -637,7 +637,7 @@ U24 Avp::getLength() const throw() { //------------------------------------------------------------------------------ //-------------------------------------------- Avp::unknownAvpWithMandatoryBit() //------------------------------------------------------------------------------ -void Avp::unknownAvpWithMandatoryBit() const throw(anna::RuntimeException) { +void Avp::unknownAvpWithMandatoryBit() const noexcept(false) { OamModule &oamModule = OamModule::instantiate(); const char *c_aid = STRING_WITH_QUOTATION_MARKS__C_STR(anna::diameter::functions::avpIdAsPairString(a_id)); oamModule.activateAlarm(OamModule::Alarm::AvpDecode__UnknownAvp__s__WithMandatoryBit, c_aid); @@ -651,7 +651,7 @@ void Avp::unknownAvpWithMandatoryBit() const throw(anna::RuntimeException) { //------------------------------------------------------------------------------ //-------------------------------------------------------- Avp::decodeDataPart() //------------------------------------------------------------------------------ -void Avp::decodeDataPart(const char * buffer, int size, const parent_t & parent, Message *answer) throw(anna::RuntimeException) { +void Avp::decodeDataPart(const char * buffer, int size, const parent_t & parent, Message *answer) noexcept(false) { // OAM OamModule &oamModule = OamModule::instantiate(); // Dictionary stack avp and format: @@ -726,7 +726,7 @@ void Avp::decodeDataPart(const char * buffer, int size, const parent_t & parent, //------------------------------------------------------------------------------ //---------------------------------------------------------------- Avp::decode() //------------------------------------------------------------------------------ -void Avp::decode(const anna::DataBlock &db, const parent_t & parent, Message *answer) throw(anna::RuntimeException) { +void Avp::decode(const anna::DataBlock &db, const parent_t & parent, Message *answer) noexcept(false) { // OAM OamModule &oamModule = OamModule::instantiate(); @@ -835,7 +835,7 @@ void Avp::decode(const anna::DataBlock &db, const parent_t & parent, Message *an //------------------------------------------------------------------------------ //----------------------------------------------------------- Avp::getStackAvp() //------------------------------------------------------------------------------ -const anna::diameter::stack::Avp *Avp::getStackAvp(AvpId id, Engine *engine) throw() { +const anna::diameter::stack::Avp *Avp::getStackAvp(AvpId id, Engine *engine) { const stack::Dictionary * dictionary = engine->getDictionary(); return (dictionary ? (dictionary->getAvp(id)) : NULL); } @@ -844,7 +844,7 @@ const anna::diameter::stack::Avp *Avp::getStackAvp(AvpId id, Engine *engine) thr //------------------------------------------------------------------------------ //------------------------------------------------------------------- Avp::fix() //------------------------------------------------------------------------------ -void Avp::fix(avp_container &avps, find_container &finds, int &insertionPositionForChilds, anna::diameter::stack::const_avprule_iterator ruleBegin, anna::diameter::stack::const_avprule_iterator ruleEnd) throw() { +void Avp::fix(avp_container &avps, find_container &finds, int &insertionPositionForChilds, anna::diameter::stack::const_avprule_iterator ruleBegin, anna::diameter::stack::const_avprule_iterator ruleEnd) { // Exit cases if(avps.size() == 0) return; // empty content, nothing to fix @@ -890,7 +890,7 @@ void Avp::fix(avp_container &avps, find_container &finds, int &insertionPosition //------------------------------------------------------------------------------ //------------------------------------------------------------------- Avp::fix() //------------------------------------------------------------------------------ -void Avp::fix() throw() { +void Avp::fix() { // Dictionary stack avp: const stack::Avp *stackAvp = getStackAvp(); const stack::Format *stackFormat = stackAvp ? (stackAvp->getFormat()) : NULL /*Unknown*/; @@ -912,7 +912,7 @@ void Avp::fix() throw() { //------------------------------------------------------------------------------ //------------------------------------------------------------ Avp::validLevel() //------------------------------------------------------------------------------ -bool Avp::validLevel(const avp_container &avps, anna::diameter::stack::const_avprule_iterator ruleBegin, anna::diameter::stack::const_avprule_iterator ruleEnd, Engine * engine, const parent_t & parent, Message *answer) throw(anna::RuntimeException) { +bool Avp::validLevel(const avp_container &avps, anna::diameter::stack::const_avprule_iterator ruleBegin, anna::diameter::stack::const_avprule_iterator ruleEnd, Engine * engine, const parent_t & parent, Message *answer) noexcept(false) { bool result = true; // OAM OamModule &oamModule = OamModule::instantiate(); @@ -1085,7 +1085,7 @@ bool Avp::validLevel(const avp_container &avps, anna::diameter::stack::const_avp //------------------------------------------------------------------------------ //----------------------------------------------------------------- Avp::valid() //------------------------------------------------------------------------------ -bool Avp::valid(const parent_t & parent, Message *answer) const throw(anna::RuntimeException) { +bool Avp::valid(const parent_t & parent, Message *answer) const noexcept(false) { // OAM OamModule &oamModule = OamModule::instantiate(); // Dictionary stack avp: @@ -1163,7 +1163,7 @@ bool Avp::valid(const parent_t & parent, Message *answer) const throw(anna::Runt //------------------------------------------------------------------------------ //------------------------------------------------------------------ Avp::code() //------------------------------------------------------------------------------ -void Avp::code(char* buffer, int &size) const throw(anna::RuntimeException) { +void Avp::code(char* buffer, int &size) const noexcept(false) { // Code buffer[0] = (S8)(a_id.first >> 24); buffer[1] = (S8)(a_id.first >> 16); @@ -1242,7 +1242,7 @@ void Avp::code(char* buffer, int &size) const throw(anna::RuntimeException) { //------------------------------------------------------------------------------ //------------------------------------------------------------ Avp::getXMLdata() //------------------------------------------------------------------------------ -std::string Avp::getXMLdata(bool & isHex, const stack::Format *stackFormat) const throw() { +std::string Avp::getXMLdata(bool & isHex, const stack::Format *stackFormat) const { std::string result = ""; isHex = false; // Unknown @@ -1329,7 +1329,7 @@ std::string Avp::getXMLdata(bool & isHex, const stack::Format *stackFormat) cons //------------------------------------------------------------------------------ //---------------------------------------------------------------- Avp::decode() //------------------------------------------------------------------------------ -void Avp::decode(const anna::DataBlock &db) throw(anna::RuntimeException) { +void Avp::decode(const anna::DataBlock &db) noexcept(false) { parent_t parent; parent.setMessage(CommandId(0, false), "No-Parent"); decode(db, parent, NULL); @@ -1339,7 +1339,7 @@ void Avp::decode(const anna::DataBlock &db) throw(anna::RuntimeException) { //------------------------------------------------------------------------------ //--------------------------------------------------------------- Avp::fromXML() //------------------------------------------------------------------------------ -void Avp::fromXML(const anna::xml::Node* avpNode) throw(anna::RuntimeException) { +void Avp::fromXML(const anna::xml::Node* avpNode) noexcept(false) { // const anna::xml::Attribute *name, *code, *vendorCode, *flags, *data, *hexData; name = avpNode->getAttribute("name", false /* no exception */); @@ -1599,7 +1599,7 @@ void Avp::fromXML(const anna::xml::Node* avpNode) throw(anna::RuntimeException) //------------------------------------------------------------------------------ //----------------------------------------------------------------- Avp::asXML() //------------------------------------------------------------------------------ -anna::xml::Node* Avp::asXML(anna::xml::Node* parent) const throw() { +anna::xml::Node* Avp::asXML(anna::xml::Node* parent) const { // anna::xml::Node* result = parent->createChild("avp"); // Dictionary stack avp and format: @@ -1648,7 +1648,7 @@ anna::xml::Node* Avp::asXML(anna::xml::Node* parent) const throw() { //------------------------------------------------------------------------------ //----------------------------------------------------------- Avp::asXMLString() //------------------------------------------------------------------------------ -std::string Avp::asXMLString(bool normalize) const throw() { +std::string Avp::asXMLString(bool normalize) const { anna::xml::Node root("root"); anna::xml::Compiler::Mode::_v mode = normalize ? anna::xml::Compiler::Mode::Sort : anna::xml::Compiler::Mode::Visual; @@ -1664,7 +1664,7 @@ std::string Avp::asXMLString(bool normalize) const throw() { //------------------------------------------------------------------------------ //---------------------------------------------------------------- Avp::isLike() //------------------------------------------------------------------------------ -bool Avp::isLike(const std::string &pattern) const throw() { +bool Avp::isLike(const std::string &pattern) const { anna::RegularExpression re(pattern); return re.isLike(asXMLString(true /* normalize by mean sorting attribute names and removing new lines */)); } diff --git a/source/diameter/codec/EngineImpl.cpp b/source/diameter/codec/EngineImpl.cpp index 50b8134..9d06706 100644 --- a/source/diameter/codec/EngineImpl.cpp +++ b/source/diameter/codec/EngineImpl.cpp @@ -45,7 +45,7 @@ EngineImpl::EngineImpl(const char* className, const stack::Dictionary * dictiona //------------------------------------------------------------------------------ //------------------------------------------------------ EngineImpl::createAvp() //------------------------------------------------------------------------------ -Avp* EngineImpl::createAvp(const AvpId *id) throw(anna::RuntimeException) { +Avp* EngineImpl::createAvp(const AvpId *id) noexcept(false) { Avp *result(NULL); anna::Guard guard(this, "diameter::codec::EngineImpl::createAvp"); @@ -65,7 +65,7 @@ Avp* EngineImpl::createAvp(const AvpId *id) throw(anna::RuntimeException) { //------------------------------------------------------------------------------ //-------------------------------------------------- EngineImpl::createMessage() //------------------------------------------------------------------------------ -Message* EngineImpl::createMessage(const CommandId *id) throw(anna::RuntimeException) { +Message* EngineImpl::createMessage(const CommandId *id) noexcept(false) { Message *result(NULL); anna::Guard guard(this, "diameter::codec::EngineImpl::createMessage"); @@ -85,7 +85,7 @@ Message* EngineImpl::createMessage(const CommandId *id) throw(anna::RuntimeExcep //------------------------------------------------------------------------------ //-------------------------------------------------- EngineImpl::createMessage() //------------------------------------------------------------------------------ -Message *EngineImpl::createMessage(const std::string & xmlPathFile_or_string, bool pathfile_or_string) throw(anna::RuntimeException) { +Message *EngineImpl::createMessage(const std::string & xmlPathFile_or_string, bool pathfile_or_string) noexcept(false) { Message *result = createMessage(); if (pathfile_or_string) result->loadXMLFile(xmlPathFile_or_string); @@ -97,7 +97,7 @@ Message *EngineImpl::createMessage(const std::string & xmlPathFile_or_string, bo -std::string EngineImpl::asString(void) const throw() { +std::string EngineImpl::asString(void) const { std::string result = anna::Component::asString(); result += "\nValidationDepth: "; result += asText(a_validationDepth); @@ -118,7 +118,7 @@ std::string EngineImpl::asString(void) const throw() { //---------------------------------------------------------- EngineImpl::asXML() //------------------------------------------------------------------------------ anna::xml::Node* EngineImpl::asXML(anna::xml::Node* parent) const -throw() { +{ parent = anna::Component::asXML(parent); anna::xml::Node* result = parent->createChild("diameter.codec.EngineImpl"); result->createAttribute("ValidationDepth", asText(a_validationDepth)); @@ -137,7 +137,7 @@ throw() { //--------------------------------------------------------- EngineImpl::asText() //------------------------------------------------------------------------------ const char* EngineImpl::asText(const ValidationDepth::_v vd) -throw() { +{ static const char* text [] = { "Complete", "FirstError" }; return text [vd]; } @@ -146,7 +146,7 @@ throw() { //--------------------------------------------------------- EngineImpl::asText() //------------------------------------------------------------------------------ const char* EngineImpl::asText(const ValidationMode::_v vm) -throw() { +{ static const char* text [] = { "BeforeEncoding", "AfterDecoding", "Always", "Never" }; return text [vm]; } @@ -155,7 +155,7 @@ throw() { //--------------------------------------------------------- EngineImpl::asText() //------------------------------------------------------------------------------ const char* EngineImpl::asText(const FixMode::_v fm) -throw() { +{ static const char* text [] = { "BeforeEncoding", "AfterDecoding", "Always", "Never" }; return text [fm]; } @@ -163,7 +163,7 @@ throw() { //------------------------------------------------------------------------------ //---------------------------------------------- EngineImpl::validationAnomaly() //------------------------------------------------------------------------------ -void EngineImpl::validationAnomaly(const std::string & description) const throw(anna::RuntimeException) { +void EngineImpl::validationAnomaly(const std::string & description) const noexcept(false) { std::string msg = "Validation error: "; if(a_validationDepth == ValidationDepth::FirstError) @@ -176,7 +176,7 @@ void EngineImpl::validationAnomaly(const std::string & description) const throw( //------------------------------------------------------------------------------ //--------------------------------------------------- EngineImpl::avpIdForName() //------------------------------------------------------------------------------ -anna::diameter::AvpId EngineImpl::avpIdForName(const char * name) throw(anna::RuntimeException) { +anna::diameter::AvpId EngineImpl::avpIdForName(const char * name) noexcept(false) { if(!name) throw anna::RuntimeException("Provided NULL Avp Logical Name", ANNA_FILE_LOCATION); @@ -201,7 +201,7 @@ anna::diameter::AvpId EngineImpl::avpIdForName(const char * name) throw(anna::Ru //------------------------------------------------------------------------------ //----------------------------------------------- EngineImpl::commandIdForName() //------------------------------------------------------------------------------ -anna::diameter::CommandId EngineImpl::commandIdForName(const char * name) throw(anna::RuntimeException) { +anna::diameter::CommandId EngineImpl::commandIdForName(const char * name) noexcept(false) { if(!name) throw anna::RuntimeException("Provided NULL Command Logical Name", ANNA_FILE_LOCATION); diff --git a/source/diameter/codec/EngineManager.cpp b/source/diameter/codec/EngineManager.cpp index f3f505e..d45b069 100644 --- a/source/diameter/codec/EngineManager.cpp +++ b/source/diameter/codec/EngineManager.cpp @@ -17,7 +17,7 @@ using namespace anna::diameter::codec; -Engine *EngineManager::getCodecEngine(const ApplicationId &appid) const throw() { +Engine *EngineManager::getCodecEngine(const ApplicationId &appid) const { appid_codec_engines_it it = a_appid_codec_engines.find(appid); if (it != a_appid_codec_engines.end()) return it->second; @@ -26,13 +26,13 @@ Engine *EngineManager::getCodecEngine(const ApplicationId &appid) const throw() return getMonoStackCodecEngine(); } -void EngineManager::registerCodecEngine(const ApplicationId &appid, Engine* engine) throw() { +void EngineManager::registerCodecEngine(const ApplicationId &appid, Engine* engine) { if (!engine) return; // nothing done a_appid_codec_engines[appid] = engine; } anna::xml::Node* EngineManager::asXML(anna::xml::Node* parent) const -throw() { +{ anna::xml::Node* result = parent->createChild("EngineManager"); appid_codec_engines_it it_min(a_appid_codec_engines.begin()); appid_codec_engines_it it_max(a_appid_codec_engines.end()); diff --git a/source/diameter/codec/Message.cpp b/source/diameter/codec/Message.cpp index a686c71..a049e1b 100644 --- a/source/diameter/codec/Message.cpp +++ b/source/diameter/codec/Message.cpp @@ -82,7 +82,7 @@ Message::~Message() { //------------------------------------------------------------------------------ //--------------------------------------------------------- Message::setEngine() //------------------------------------------------------------------------------ -void Message::setEngine(Engine *engine) throw() { +void Message::setEngine(Engine *engine) { if (!engine) { LOGWARNING(anna::Logger::warning("Ignored: you must assign a valid codec engine. If you want to set NULL engine, clear the message", ANNA_FILE_LOCATION)); @@ -101,7 +101,7 @@ void Message::setEngine(Engine *engine) throw() { //------------------------------------------------------------------------------ //--------------------------------------------------------- Message::getEngine() //------------------------------------------------------------------------------ -Engine * Message::getEngine() const throw(anna::RuntimeException) { +Engine * Message::getEngine() const noexcept(false) { if(!a_engine) throw anna::RuntimeException("Invalid codec engine reference (NULL). Use setEngine() to set the corresponding codec engine", ANNA_FILE_LOCATION); @@ -113,7 +113,7 @@ Engine * Message::getEngine() const throw(anna::RuntimeException) { //------------------------------------------------------------------------------ //-------------------------------------------------------- Message::initialize() //------------------------------------------------------------------------------ -void Message::initialize() throw() { +void Message::initialize() { a_version = 1; a_id = CommandId(0, false); a_flags = 0x00; @@ -129,7 +129,7 @@ void Message::initialize() throw() { //------------------------------------------------------------------------------ //------------------------------------------------------------- Message::clear() //------------------------------------------------------------------------------ -void Message::clear(bool resetEngine) throw(anna::RuntimeException) { +void Message::clear(bool resetEngine) noexcept(false) { for(avp_iterator it = avp_begin(); it != avp_end(); it++) { /*avp(it)->clear(); */getEngine()->releaseAvp(Avp::avp(it)); } a_avps.clear(); @@ -145,7 +145,7 @@ void Message::clear(bool resetEngine) throw(anna::RuntimeException) { //------------------------------------------------------------------------------ //----------------------------------------------------------- Message::flagsOK() //------------------------------------------------------------------------------ -bool Message::flagsOK(int &rc) const throw() { +bool Message::flagsOK(int &rc) const { // Dictionary stack command: const stack::Command *stackCommand = getStackCommand(); @@ -205,7 +205,7 @@ bool Message::flagsOK(int &rc) const throw() { //------------------------------------------------------------------------------ //------------------------------------------------------------- Message::setId() //------------------------------------------------------------------------------ -void Message::setId(CommandId id) throw(anna::RuntimeException) { +void Message::setId(CommandId id) noexcept(false) { // Id assignment: a_id = id; @@ -224,7 +224,7 @@ void Message::setId(CommandId id) throw(anna::RuntimeException) { //------------------------------------------------------------------------------ //------------------------------------------------------------- Message::setId() //------------------------------------------------------------------------------ -void Message::setId(const char *name) throw(anna::RuntimeException) { +void Message::setId(const char *name) noexcept(false) { setId(getEngine()->commandIdForName(name)); } @@ -232,7 +232,7 @@ void Message::setId(const char *name) throw(anna::RuntimeException) { //------------------------------------------------------------------------------ //-------------------------------------------------- Message::setApplicationId() //------------------------------------------------------------------------------ -void Message::setApplicationId(U32 aid) throw(anna::RuntimeException) { +void Message::setApplicationId(U32 aid) noexcept(false) { a_applicationId = aid; // Automatic engine configuration: @@ -253,7 +253,7 @@ void Message::setApplicationId(U32 aid) throw(anna::RuntimeException) { //------------------------------------------------------------------------------ //------------------------------------------------------------ Message::addAvp() //------------------------------------------------------------------------------ -Avp * Message::addAvp(const char *name) throw(anna::RuntimeException) { +Avp * Message::addAvp(const char *name) noexcept(false) { return addAvp(getEngine()->avpIdForName(name)); } @@ -261,7 +261,7 @@ Avp * Message::addAvp(const char *name) throw(anna::RuntimeException) { //------------------------------------------------------------------------------ //------------------------------------------------------------ Message::addAvp() //------------------------------------------------------------------------------ -Avp * Message::addAvp(Avp * avp) throw() { +Avp * Message::addAvp(Avp * avp) { if(!avp) return NULL; if (avp->getEngine() != getEngine()) return NULL; addChild(avp); @@ -272,7 +272,7 @@ Avp * Message::addAvp(Avp * avp) throw() { //------------------------------------------------------------------------------ //--------------------------------------------------------- Message::removeAvp() //------------------------------------------------------------------------------ -bool Message::removeAvp(const char *name, int ocurrence) throw(anna::RuntimeException) { +bool Message::removeAvp(const char *name, int ocurrence) noexcept(false) { return removeAvp(getEngine()->avpIdForName(name), ocurrence); } @@ -280,7 +280,7 @@ bool Message::removeAvp(const char *name, int ocurrence) throw(anna::RuntimeExce //------------------------------------------------------------------------------ //----------------------------------------------------------- Message::_getAvp() //------------------------------------------------------------------------------ -const Avp * Message::_getAvp(const char *name, int ocurrence, anna::Exception::Mode::_v emode) const throw(anna::RuntimeException) { +const Avp * Message::_getAvp(const char *name, int ocurrence, anna::Exception::Mode::_v emode) const noexcept(false) { return getAvp(getEngine()->avpIdForName(name), ocurrence, emode); } @@ -288,7 +288,7 @@ const Avp * Message::_getAvp(const char *name, int ocurrence, anna::Exception::M //------------------------------------------------------------------------------ //---------------------------------------------------------- Message::countAvp() //------------------------------------------------------------------------------ -int Message::countAvp(const char *name) const throw(anna::RuntimeException) { +int Message::countAvp(const char *name) const noexcept(false) { return countAvp(getEngine()->avpIdForName(name)); } @@ -296,7 +296,7 @@ int Message::countAvp(const char *name) const throw(anna::RuntimeException) { //------------------------------------------------------------------------------ //--------------------------------------------------------- Message::getLength() //------------------------------------------------------------------------------ -U24 Message::getLength() const throw() { +U24 Message::getLength() const { U24 result; // Header length: result = HeaderLength; @@ -310,7 +310,7 @@ U24 Message::getLength() const throw() { //------------------------------------------------------------------------------ //------------------------------------------------------------ Message::decode() //------------------------------------------------------------------------------ -void Message::decode(const anna::DataBlock &db, Message *ptrAnswer) throw(anna::RuntimeException) { +void Message::decode(const anna::DataBlock &db, Message *ptrAnswer) noexcept(false) { // Trace LOGDEBUG( anna::xml::Node root("Message::decode"); @@ -450,7 +450,7 @@ void Message::decode(const anna::DataBlock &db, Message *ptrAnswer) throw(anna:: //------------------------------------------------------------------------------ //--------------------------------------------------- Message::getStackCommand() //------------------------------------------------------------------------------ -const anna::diameter::stack::Command *Message::getStackCommand(CommandId id) const throw(anna::RuntimeException) { +const anna::diameter::stack::Command *Message::getStackCommand(CommandId id) const noexcept(false) { const stack::Dictionary * dictionary = getEngine()->getDictionary(); return (dictionary ? (dictionary->getCommand(id)) : NULL); } @@ -459,7 +459,7 @@ const anna::diameter::stack::Command *Message::getStackCommand(CommandId id) con //------------------------------------------------------------------------------ //----------------------------------------------------- Message::setResultCode() //------------------------------------------------------------------------------ -void Message::setResultCode(int rc) throw(anna::RuntimeException) { +void Message::setResultCode(int rc) noexcept(false) { if(isRequest()) return; // Add Result-Code if not yet added. Even if validation depth is set to 'Complete', @@ -479,7 +479,7 @@ void Message::setResultCode(int rc) throw(anna::RuntimeException) { //------------------------------------------------------------------------------ //----------------------------------------------------- Message::getResultCode() //------------------------------------------------------------------------------ -int Message::getResultCode() const throw() { +int Message::getResultCode() const { if(isAnswer()) { const Avp *resultCodeAvp = getAvp(helpers::base::AVPID__Result_Code, 1, anna::Exception::Mode::Ignore); @@ -494,7 +494,7 @@ int Message::getResultCode() const throw() { //------------------------------------------------------------------------------ //------------------------------------------------------ Message::setFailedAvp() //------------------------------------------------------------------------------ -void Message::setFailedAvp(const parent_t &parent, AvpId wrong, const char *wrongName) throw(anna::RuntimeException) { +void Message::setFailedAvp(const parent_t &parent, AvpId wrong, const char *wrongName) noexcept(false) { if(isRequest()) return; @@ -549,7 +549,7 @@ void Message::setFailedAvp(const parent_t &parent, AvpId wrong, const char *wron //------------------------------------------------------------------------------ //----------------------------------------------- Message::setStandardToAnswer() //------------------------------------------------------------------------------ -void Message::setStandardToAnswer(const Message &request, const std::string &originHost, const std::string &originRealm, int resultCode) throw(anna::RuntimeException) { +void Message::setStandardToAnswer(const Message &request, const std::string &originHost, const std::string &originRealm, int resultCode) noexcept(false) { if(!request.getId().second) return; // Message header: @@ -590,7 +590,7 @@ void Message::setStandardToAnswer(const Message &request, const std::string &ori //------------------------------------------------------------------------------ //--------------------------------------------------------------- Message::fix() //------------------------------------------------------------------------------ -void Message::fix() throw() { +void Message::fix() { // Dictionary stack command: const stack::Command *stackCommand = getStackCommand(); @@ -619,7 +619,7 @@ void Message::fix() throw() { //------------------------------------------------------------------------------ //------------------------------------------------------------- Message::valid() //------------------------------------------------------------------------------ -bool Message::valid(Message *ptrAnswer) const throw(anna::RuntimeException) { +bool Message::valid(Message *ptrAnswer) const noexcept(false) { // OAM OamModule &oamModule = OamModule::instantiate(); // Dictionary stack command: @@ -679,7 +679,7 @@ bool Message::valid(Message *ptrAnswer) const throw(anna::RuntimeException) { //------------------------------------------------------------------------------ //-------------------------------------------------------------- Message::code() //------------------------------------------------------------------------------ -const anna::DataBlock & Message::code() throw(anna::RuntimeException) { +const anna::DataBlock & Message::code() noexcept(false) { // Pre-Validation Engine::ValidationMode::_v vmode = getEngine()->getValidationMode(); @@ -763,7 +763,7 @@ const anna::DataBlock & Message::code() throw(anna::RuntimeException) { //------------------------------------------------------------------------------ //------------------------------------------------------- Message::loadXMLFile() //------------------------------------------------------------------------------ -void Message::loadXMLFile(const std::string &xmlPathFile) throw(anna::RuntimeException) { +void Message::loadXMLFile(const std::string &xmlPathFile) noexcept(false) { anna::xml::DocumentFile xmlDocument; anna::diameter::codec::functions::messageXmlDocumentFromXmlFile(xmlDocument, xmlPathFile); @@ -773,7 +773,7 @@ void Message::loadXMLFile(const std::string &xmlPathFile) throw(anna::RuntimeExc //------------------------------------------------------------------------------ //----------------------------------------------------- Message::loadXMLString() //------------------------------------------------------------------------------ -void Message::loadXMLString(const std::string &xmlString) throw(anna::RuntimeException) { +void Message::loadXMLString(const std::string &xmlString) noexcept(false) { anna::xml::DocumentMemory xmlDocument; anna::diameter::codec::functions::messageXmlDocumentFromXmlString(xmlDocument, xmlString); @@ -783,7 +783,7 @@ void Message::loadXMLString(const std::string &xmlString) throw(anna::RuntimeExc //------------------------------------------------------------------------------ //----------------------------------------------------------- Message::fromXML() //------------------------------------------------------------------------------ -void Message::fromXML(const anna::xml::Node* messageNode) throw(anna::RuntimeException) { +void Message::fromXML(const anna::xml::Node* messageNode) noexcept(false) { // const anna::xml::Attribute *version, *name, *code, *flags, *pbit, *ebit, *tbit, *appid, *hbh, *ete; version = messageNode->getAttribute("version", false /* no exception */); @@ -961,7 +961,7 @@ void Message::fromXML(const anna::xml::Node* messageNode) throw(anna::RuntimeExc //------------------------------------------------------------------------------ //------------------------------------------------------------- Message::asXML() //------------------------------------------------------------------------------ -anna::xml::Node* Message::asXML(anna::xml::Node* parent) const throw() { +anna::xml::Node* Message::asXML(anna::xml::Node* parent) const { // anna::xml::Node* result = parent->createChild("message"); // Dictionary stack command: @@ -998,7 +998,7 @@ anna::xml::Node* Message::asXML(anna::xml::Node* parent) const throw() { //------------------------------------------------------------------------------ //------------------------------------------------------- Message::asXMLString() //------------------------------------------------------------------------------ -std::string Message::asXMLString(bool normalize) const throw() { +std::string Message::asXMLString(bool normalize) const { anna::xml::Node root("root"); anna::xml::Compiler::Mode::_v mode = normalize ? anna::xml::Compiler::Mode::Sort : anna::xml::Compiler::Mode::Visual; @@ -1014,7 +1014,7 @@ std::string Message::asXMLString(bool normalize) const throw() { //------------------------------------------------------------------------------ //------------------------------------------------------------ Message::isLike() //------------------------------------------------------------------------------ -bool Message::isLike(const std::string &pattern) const throw() { +bool Message::isLike(const std::string &pattern) const { anna::RegularExpression re(pattern); return re.isLike(asXMLString(true /* normalize by mean sorting attribute names and removing new lines */)); } diff --git a/source/diameter/codec/MessagesDeque.cpp b/source/diameter/codec/MessagesDeque.cpp index 96f526a..c20e62c 100644 --- a/source/diameter/codec/MessagesDeque.cpp +++ b/source/diameter/codec/MessagesDeque.cpp @@ -21,7 +21,7 @@ using namespace anna::diameter::codec; -void MessagesDeque::clear() throw () { +void MessagesDeque::clear() { try { anna::diameter::codec::EngineManager &em = anna::diameter::codec::EngineManager::instantiate(); anna::diameter::codec::Engine *engine; @@ -44,7 +44,7 @@ void MessagesDeque::clear() throw () { } } -void MessagesDeque::dump(const char *filenamePrefix) throw () { +void MessagesDeque::dump(const char *filenamePrefix) { std::string outfilename, xmlString; for (messages_const_iterator it = a_deques.begin(); it != a_deques.end(); it++) { @@ -66,7 +66,7 @@ void MessagesDeque::dump(const char *filenamePrefix) throw () { } } -void MessagesDeque::addMessage(int code, anna::diameter::codec::Message *message) throw () { +void MessagesDeque::addMessage(int code, anna::diameter::codec::Message *message) { if (!message) return; // just in case @@ -80,7 +80,7 @@ void MessagesDeque::addMessage(int code, anna::diameter::codec::Message *message } } -anna::diameter::codec::Message* MessagesDeque::getMessage(int code) const throw () { //get the front message (begin()), returns NULL if deque is empty +anna::diameter::codec::Message* MessagesDeque::getMessage(int code) const { //get the front message (begin()), returns NULL if deque is empty anna::diameter::codec::Message *result = NULL; messages_const_iterator it = a_deques.find(code); if (it != a_deques.end()) { @@ -90,7 +90,7 @@ anna::diameter::codec::Message* MessagesDeque::getMessage(int code) const throw return result; } -void MessagesDeque::nextMessage(int code) throw () { //pops the deque and release the message (when deque is not empty: deque::empty) +void MessagesDeque::nextMessage(int code) { //pops the deque and release the message (when deque is not empty: deque::empty) anna::diameter::codec::Engine *engine; try { @@ -119,7 +119,7 @@ void MessagesDeque::nextMessage(int code) throw () { //pops the deque and releas } } -std::string MessagesDeque::asString(const char *queueName) const throw () { +std::string MessagesDeque::asString(const char *queueName) const { std::string result = ""; std::string aux = "FIFO QUEUE '"; aux += queueName; diff --git a/source/diameter/codec/basetypes/Address.cpp b/source/diameter/codec/basetypes/Address.cpp index b58a6fd..f0e5c14 100644 --- a/source/diameter/codec/basetypes/Address.cpp +++ b/source/diameter/codec/basetypes/Address.cpp @@ -18,7 +18,7 @@ //------------------------------------------------------------------------------ //------------------------------------------------------- Address::updateBasic() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Address::updateBasic() throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::Address::updateBasic() noexcept(false) { std::string result; // address version result.push_back((S8)(a_address.Version >> 8)); @@ -114,7 +114,7 @@ void anna::diameter::codec::basetypes::Address::updateBasic() throw(anna::Runtim //------------------------------------------------------------------------------ //------------------------------------------------ Address::setPrintableString() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Address::setPrintableString(const char * printableString) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::Address::setPrintableString(const char * printableString) noexcept(false) { // First: User will update child class members // Auxiliary iana_address_t address; @@ -153,7 +153,7 @@ void anna::diameter::codec::basetypes::Address::setPrintableString(const char * //------------------------------------------------------------------------------ //------------------------------------------------ Address::setPrintableString() //------------------------------------------------------------------------------ -std::string anna::diameter::codec::basetypes::Address::asPrintableString() throw(anna::RuntimeException) { +std::string anna::diameter::codec::basetypes::Address::asPrintableString() noexcept(false) { bool knownPrintablePresentation = (a_address.isIPv4() || a_address.isIPv6() || a_address.isE164()); if(!knownPrintablePresentation) @@ -166,7 +166,7 @@ std::string anna::diameter::codec::basetypes::Address::asPrintableString() throw //------------------------------------------------------------------------------ //------------------------------------------------------------ Address::decode() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Address::decode(const char* buffer, const int size) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::Address::decode(const char* buffer, const int size) noexcept(false) { if(!buffer) throw anna::RuntimeException("Address::decode | Null Buffer provided", ANNA_FILE_LOCATION); diff --git a/source/diameter/codec/basetypes/DiameterIdentity.cpp b/source/diameter/codec/basetypes/DiameterIdentity.cpp index 2122fa5..e1638fe 100644 --- a/source/diameter/codec/basetypes/DiameterIdentity.cpp +++ b/source/diameter/codec/basetypes/DiameterIdentity.cpp @@ -13,7 +13,7 @@ //------------------------------------------------------------------------------ //---------------------------------------------- DiameterIdentity::updateBasic() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::DiameterIdentity::updateBasic() throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::DiameterIdentity::updateBasic() noexcept(false) { assertPrintable(); } @@ -21,7 +21,7 @@ void anna::diameter::codec::basetypes::DiameterIdentity::updateBasic() throw(ann //------------------------------------------------------------------------------ //--------------------------------------------------- DiameterIdentity::decode() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::DiameterIdentity::decode(const char* buffer, const int size) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::DiameterIdentity::decode(const char* buffer, const int size) noexcept(false) { /*std::string dummy =*/ AvpData::assertPrintable(buffer, size); // Base class decode() diff --git a/source/diameter/codec/basetypes/DiameterURI.cpp b/source/diameter/codec/basetypes/DiameterURI.cpp index abf9436..20145d5 100644 --- a/source/diameter/codec/basetypes/DiameterURI.cpp +++ b/source/diameter/codec/basetypes/DiameterURI.cpp @@ -13,7 +13,7 @@ //------------------------------------------------------------------------------ //--------------------------------------------------- DiameterURI::updateBasic() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::DiameterURI::updateBasic() throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::DiameterURI::updateBasic() noexcept(false) { assertPrintable(); } @@ -21,7 +21,7 @@ void anna::diameter::codec::basetypes::DiameterURI::updateBasic() throw(anna::Ru //------------------------------------------------------------------------------ //-------------------------------------------------------- DiameterURI::decode() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::DiameterURI::decode(const char* buffer, const int size) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::DiameterURI::decode(const char* buffer, const int size) noexcept(false) { /*std::string dummy =*/ AvpData::assertPrintable(buffer, size); // Base class decode() diff --git a/source/diameter/codec/basetypes/Float32.cpp b/source/diameter/codec/basetypes/Float32.cpp index 63a9a29..eb40e1f 100644 --- a/source/diameter/codec/basetypes/Float32.cpp +++ b/source/diameter/codec/basetypes/Float32.cpp @@ -13,7 +13,7 @@ //------------------------------------------------------------------------------ //--------------------------------------------------------- Float32::codeBasic() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Float32::codeBasic(char* buffer, int &size) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::Float32::codeBasic(char* buffer, int &size) noexcept(false) { /*buffer=*/ anna::comm::functions::codeFloat(buffer, a_value); size = getSize(); @@ -23,7 +23,7 @@ void anna::diameter::codec::basetypes::Float32::codeBasic(char* buffer, int &siz //------------------------------------------------------------------------------ //------------------------------------------------ Float32::setPrintableString() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Float32::setPrintableString(const char * printableString) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::Float32::setPrintableString(const char * printableString) noexcept(false) { setValue(atof(printableString)); } @@ -31,7 +31,7 @@ void anna::diameter::codec::basetypes::Float32::setPrintableString(const char * //------------------------------------------------------------------------------ //------------------------------------------------------------ Float32::decode() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Float32::decode(const char* buffer, const int size) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::Float32::decode(const char* buffer, const int size) noexcept(false) { if(!buffer) throw anna::RuntimeException("Float32::decode | Null Buffer provided", ANNA_FILE_LOCATION); diff --git a/source/diameter/codec/basetypes/Float64.cpp b/source/diameter/codec/basetypes/Float64.cpp index 0693e35..2baf209 100644 --- a/source/diameter/codec/basetypes/Float64.cpp +++ b/source/diameter/codec/basetypes/Float64.cpp @@ -13,7 +13,7 @@ //------------------------------------------------------------------------------ //--------------------------------------------------------- Float64::codeBasic() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Float64::codeBasic(char* buffer, int &size) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::Float64::codeBasic(char* buffer, int &size) noexcept(false) { /*buffer=*/ anna::comm::functions::codeDouble(buffer, a_value); size = getSize(); @@ -23,7 +23,7 @@ void anna::diameter::codec::basetypes::Float64::codeBasic(char* buffer, int &siz //------------------------------------------------------------------------------ //------------------------------------------------ Float64::setPrintableString() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Float64::setPrintableString(const char * printableString) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::Float64::setPrintableString(const char * printableString) noexcept(false) { setValue(atof/*strtod*/(printableString)); } @@ -31,7 +31,7 @@ void anna::diameter::codec::basetypes::Float64::setPrintableString(const char * //------------------------------------------------------------------------------ //------------------------------------------------------------ Float64::decode() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Float64::decode(const char* buffer, const int size) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::Float64::decode(const char* buffer, const int size) noexcept(false) { if(!buffer) throw anna::RuntimeException("Float64::decode | Null Buffer provided", ANNA_FILE_LOCATION); diff --git a/source/diameter/codec/basetypes/IPFilterRule.cpp b/source/diameter/codec/basetypes/IPFilterRule.cpp index 106ff85..3194472 100644 --- a/source/diameter/codec/basetypes/IPFilterRule.cpp +++ b/source/diameter/codec/basetypes/IPFilterRule.cpp @@ -13,7 +13,7 @@ //------------------------------------------------------------------------------ //-------------------------------------------------- IPFilterRule::updateBasic() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::IPFilterRule::updateBasic() throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::IPFilterRule::updateBasic() noexcept(false) { assertPrintable(); } @@ -21,7 +21,7 @@ void anna::diameter::codec::basetypes::IPFilterRule::updateBasic() throw(anna::R //------------------------------------------------------------------------------ //------------------------------------------------------- IPFilterRule::decode() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::IPFilterRule::decode(const char* buffer, const int size) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::IPFilterRule::decode(const char* buffer, const int size) noexcept(false) { /*std::string dummy =*/ AvpData::assertPrintable(buffer, size); // Base class decode() diff --git a/source/diameter/codec/basetypes/Integer32.cpp b/source/diameter/codec/basetypes/Integer32.cpp index 62bae07..87518a5 100644 --- a/source/diameter/codec/basetypes/Integer32.cpp +++ b/source/diameter/codec/basetypes/Integer32.cpp @@ -13,7 +13,7 @@ //------------------------------------------------------------------------------ //------------------------------------------------------- Integer32::codeBasic() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Integer32::codeBasic(char* buffer, int &size) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::Integer32::codeBasic(char* buffer, int &size) noexcept(false) { buffer[0] = (char)(a_value >> 24); buffer[1] = (char)(a_value >> 16); buffer[2] = (char)(a_value >> 8); @@ -25,7 +25,7 @@ void anna::diameter::codec::basetypes::Integer32::codeBasic(char* buffer, int &s //------------------------------------------------------------------------------ //---------------------------------------------- Integer32::setPrintableString() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Integer32::setPrintableString(const char * printableString) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::Integer32::setPrintableString(const char * printableString) noexcept(false) { setValue(atoi(printableString)); } @@ -33,7 +33,7 @@ void anna::diameter::codec::basetypes::Integer32::setPrintableString(const char //------------------------------------------------------------------------------ //---------------------------------------------------------- Integer32::decode() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Integer32::decode(const char* buffer, const int size) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::Integer32::decode(const char* buffer, const int size) noexcept(false) { if(!buffer) throw anna::RuntimeException("Integer32::decode | Null Buffer provided", ANNA_FILE_LOCATION); diff --git a/source/diameter/codec/basetypes/Integer64.cpp b/source/diameter/codec/basetypes/Integer64.cpp index e3dd604..4f4a6a2 100644 --- a/source/diameter/codec/basetypes/Integer64.cpp +++ b/source/diameter/codec/basetypes/Integer64.cpp @@ -13,7 +13,7 @@ //------------------------------------------------------------------------------ //------------------------------------------------------- Integer64::codeBasic() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Integer64::codeBasic(char* buffer, int &size) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::Integer64::codeBasic(char* buffer, int &size) noexcept(false) { buffer[0] = (char)(a_value >> 56); buffer[1] = (char)(a_value >> 48); buffer[2] = (char)(a_value >> 40); @@ -29,7 +29,7 @@ void anna::diameter::codec::basetypes::Integer64::codeBasic(char* buffer, int &s //------------------------------------------------------------------------------ //---------------------------------------------- Integer64::setPrintableString() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Integer64::setPrintableString(const char * printableString) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::Integer64::setPrintableString(const char * printableString) noexcept(false) { setValue(atoll(printableString)); } @@ -37,7 +37,7 @@ void anna::diameter::codec::basetypes::Integer64::setPrintableString(const char //------------------------------------------------------------------------------ //---------------------------------------------------------- Integer64::decode() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Integer64::decode(const char* buffer, const int size) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::Integer64::decode(const char* buffer, const int size) noexcept(false) { if(!buffer) throw anna::RuntimeException("Integer64::decode | Null Buffer provided", ANNA_FILE_LOCATION); diff --git a/source/diameter/codec/basetypes/OctetString.cpp b/source/diameter/codec/basetypes/OctetString.cpp index dd2d230..9789cc9 100644 --- a/source/diameter/codec/basetypes/OctetString.cpp +++ b/source/diameter/codec/basetypes/OctetString.cpp @@ -16,14 +16,14 @@ //------------------------------------------------------------------------------ //----------------------------------------------------- OctetString::codeBasic() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::OctetString::codeBasic(char* buffer, int &size) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::OctetString::codeBasic(char* buffer, int &size) noexcept(false) { memcpy(buffer, a_value.c_str(), size = getSize()); } //------------------------------------------------------------------------------ //-------------------------------------------- OctetString::setPrintableString() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::OctetString::setPrintableString(const char * printableString) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::OctetString::setPrintableString(const char * printableString) noexcept(false) { setValue(printableString); } @@ -31,7 +31,7 @@ void anna::diameter::codec::basetypes::OctetString::setPrintableString(const cha //------------------------------------------------------------------------------ //----------------------------------------------- OctetString::assertPrintable() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::OctetString::assertPrintable() const throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::OctetString::assertPrintable() const noexcept(false) { /*std::string dummy =*/ AvpData::assertPrintable(a_value.c_str(), a_value.size()); } @@ -40,7 +40,7 @@ void anna::diameter::codec::basetypes::OctetString::assertPrintable() const thro //------------------------------------------------------------------------------ //-------------------------------------------------------- OctetString::decode() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::OctetString::decode(const char* buffer, const int size) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::OctetString::decode(const char* buffer, const int size) noexcept(false) { if(!buffer) { std::string msg = getFormatName(); // Unknown format inherit from OctetString msg += "::decode | Null Buffer provided"; diff --git a/source/diameter/codec/basetypes/QoSFilterRule.cpp b/source/diameter/codec/basetypes/QoSFilterRule.cpp index 724f573..6d89f27 100644 --- a/source/diameter/codec/basetypes/QoSFilterRule.cpp +++ b/source/diameter/codec/basetypes/QoSFilterRule.cpp @@ -13,7 +13,7 @@ //------------------------------------------------------------------------------ //------------------------------------------------- QoSFilterRule::updateBasic() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::QoSFilterRule::updateBasic() throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::QoSFilterRule::updateBasic() noexcept(false) { assertPrintable(); } @@ -21,7 +21,7 @@ void anna::diameter::codec::basetypes::QoSFilterRule::updateBasic() throw(anna:: //------------------------------------------------------------------------------ //------------------------------------------------------ QoSFilterRule::decode() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::QoSFilterRule::decode(const char* buffer, const int size) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::QoSFilterRule::decode(const char* buffer, const int size) noexcept(false) { /*std::string dummy =*/ AvpData::assertPrintable(buffer, size); // Base class decode() diff --git a/source/diameter/codec/basetypes/Time.cpp b/source/diameter/codec/basetypes/Time.cpp index 85b0d8b..16fbcc6 100644 --- a/source/diameter/codec/basetypes/Time.cpp +++ b/source/diameter/codec/basetypes/Time.cpp @@ -15,7 +15,7 @@ //------------------------------------------------------------------------------ //---------------------------------------------------------- Time::updateBasic() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Time::updateBasic() throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::Time::updateBasic() noexcept(false) { std::string result; result += (char)(a_ntpTimestamp >> 24); result += (char)(a_ntpTimestamp >> 16); @@ -28,7 +28,7 @@ void anna::diameter::codec::basetypes::Time::updateBasic() throw(anna::RuntimeEx //------------------------------------------------------------------------------ //--------------------------------------------------- Time::setPrintableString() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Time::setPrintableString(const char * printableString) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::Time::setPrintableString(const char * printableString) noexcept(false) { setTimestamp(atoi(printableString)); } @@ -36,7 +36,7 @@ void anna::diameter::codec::basetypes::Time::setPrintableString(const char * pri //------------------------------------------------------------------------------ //------------------------------------------------------------- Time::asString() //------------------------------------------------------------------------------ -std::string anna::diameter::codec::basetypes::Time::asString() throw(anna::RuntimeException) { +std::string anna::diameter::codec::basetypes::Time::asString() noexcept(false) { std::string result = asPrintableString(); anna::time::Date date; date.storeNtp(a_ntpTimestamp); @@ -48,7 +48,7 @@ std::string anna::diameter::codec::basetypes::Time::asString() throw(anna::Runti //------------------------------------------------------------------------------ //--------------------------------------------------------------- Time::decode() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Time::decode(const char* buffer, const int size) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::Time::decode(const char* buffer, const int size) noexcept(false) { if(!buffer) throw anna::RuntimeException("Time::decode | Null Buffer provided", ANNA_FILE_LOCATION); @@ -67,7 +67,7 @@ void anna::diameter::codec::basetypes::Time::decode(const char* buffer, const in //------------------------------------------------------------------------------ //--------------------------------------------------------- Time::getTimestamp() //------------------------------------------------------------------------------ -anna::U32 anna::diameter::codec::basetypes::Time::getTimestamp(Timestamp::_v timestampType) const throw() { +anna::U32 anna::diameter::codec::basetypes::Time::getTimestamp(Timestamp::_v timestampType) const { return ((timestampType == Timestamp::NTP) ? a_ntpTimestamp : (a_ntpTimestamp - TIMESTAMP_OFFSET_NTP1900_OVER_UNIX1970)); } @@ -75,7 +75,7 @@ anna::U32 anna::diameter::codec::basetypes::Time::getTimestamp(Timestamp::_v tim //------------------------------------------------------------------------------ //--------------------------------------------------------- Time::setTimestamp() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Time::setTimestamp(const U32& timestamp, Timestamp::_v timestampType) throw() { +void anna::diameter::codec::basetypes::Time::setTimestamp(const U32& timestamp, Timestamp::_v timestampType) { a_ntpTimestamp = (timestampType == Timestamp::NTP) ? timestamp : (timestamp + TIMESTAMP_OFFSET_NTP1900_OVER_UNIX1970); updateBasic(); } diff --git a/source/diameter/codec/basetypes/UTF8String.cpp b/source/diameter/codec/basetypes/UTF8String.cpp index 63794fa..12b69ea 100644 --- a/source/diameter/codec/basetypes/UTF8String.cpp +++ b/source/diameter/codec/basetypes/UTF8String.cpp @@ -13,7 +13,7 @@ //------------------------------------------------------------------------------ //---------------------------------------------------- UTF8String::updateBasic() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::UTF8String::updateBasic() throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::UTF8String::updateBasic() noexcept(false) { assertPrintable(); } @@ -21,7 +21,7 @@ void anna::diameter::codec::basetypes::UTF8String::updateBasic() throw(anna::Run //------------------------------------------------------------------------------ //--------------------------------------------------------- UTF8String::decode() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::UTF8String::decode(const char* buffer, const int size) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::UTF8String::decode(const char* buffer, const int size) noexcept(false) { /*std::string dummy =*/ AvpData::assertPrintable(buffer, size); // Base class decode() diff --git a/source/diameter/codec/basetypes/Unsigned32.cpp b/source/diameter/codec/basetypes/Unsigned32.cpp index 168a9c9..54e7259 100644 --- a/source/diameter/codec/basetypes/Unsigned32.cpp +++ b/source/diameter/codec/basetypes/Unsigned32.cpp @@ -13,7 +13,7 @@ //------------------------------------------------------------------------------ //------------------------------------------------------ Unsigned32::codeBasic() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Unsigned32::codeBasic(char* buffer, int &size) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::Unsigned32::codeBasic(char* buffer, int &size) noexcept(false) { buffer[0] = (char)(a_value >> 24); buffer[1] = (char)(a_value >> 16); buffer[2] = (char)(a_value >> 8); @@ -25,7 +25,7 @@ void anna::diameter::codec::basetypes::Unsigned32::codeBasic(char* buffer, int & //------------------------------------------------------------------------------ //--------------------------------------------- Unsigned32::setPrintableString() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Unsigned32::setPrintableString(const char * printableString) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::Unsigned32::setPrintableString(const char * printableString) noexcept(false) { setValue(atoi(printableString)); } @@ -33,7 +33,7 @@ void anna::diameter::codec::basetypes::Unsigned32::setPrintableString(const char //------------------------------------------------------------------------------ //--------------------------------------------------------- Unsigned32::decode() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Unsigned32::decode(const char* buffer, const int size) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::Unsigned32::decode(const char* buffer, const int size) noexcept(false) { if(!buffer) throw anna::RuntimeException("Unsigned32::decode | Null Buffer provided", ANNA_FILE_LOCATION); diff --git a/source/diameter/codec/basetypes/Unsigned64.cpp b/source/diameter/codec/basetypes/Unsigned64.cpp index 0d5083b..9cd205b 100644 --- a/source/diameter/codec/basetypes/Unsigned64.cpp +++ b/source/diameter/codec/basetypes/Unsigned64.cpp @@ -13,7 +13,7 @@ //------------------------------------------------------------------------------ //------------------------------------------------------ Unsigned64::codeBasic() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Unsigned64::codeBasic(char* buffer, int &size) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::Unsigned64::codeBasic(char* buffer, int &size) noexcept(false) { buffer[0] = (char)(a_value >> 56); buffer[1] = (char)(a_value >> 48); buffer[2] = (char)(a_value >> 40); @@ -29,7 +29,7 @@ void anna::diameter::codec::basetypes::Unsigned64::codeBasic(char* buffer, int & //------------------------------------------------------------------------------ //--------------------------------------------- Unsigned64::setPrintableString() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Unsigned64::setPrintableString(const char * printableString) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::Unsigned64::setPrintableString(const char * printableString) noexcept(false) { setValue(atoll(printableString)); } @@ -37,7 +37,7 @@ void anna::diameter::codec::basetypes::Unsigned64::setPrintableString(const char //------------------------------------------------------------------------------ //--------------------------------------------------------- Unsigned64::decode() //------------------------------------------------------------------------------ -void anna::diameter::codec::basetypes::Unsigned64::decode(const char* buffer, const int size) throw(anna::RuntimeException) { +void anna::diameter::codec::basetypes::Unsigned64::decode(const char* buffer, const int size) noexcept(false) { if(!buffer) throw anna::RuntimeException("Unsigned64::decode | Null Buffer provided", ANNA_FILE_LOCATION); diff --git a/source/diameter/codec/functions.cpp b/source/diameter/codec/functions.cpp index fe0ee03..f7a0060 100644 --- a/source/diameter/codec/functions.cpp +++ b/source/diameter/codec/functions.cpp @@ -34,7 +34,7 @@ anna::xml::DTDMemory MessageDTDMemory(MessageDTD); // Parent struct helper ///////////////////////////////////////////////////////////////////////////// -void anna::diameter::codec::parent::setMessage(const anna::diameter::CommandId & mid, const char *mname) throw() { +void anna::diameter::codec::parent::setMessage(const anna::diameter::CommandId & mid, const char *mname) { MessageId = mid; if (mname) { MessageName = mname; @@ -45,7 +45,7 @@ void anna::diameter::codec::parent::setMessage(const anna::diameter::CommandId & } } -void anna::diameter::codec::parent::addAvp(const anna::diameter::AvpId & aid, const char *aname) throw() { +void anna::diameter::codec::parent::addAvp(const anna::diameter::AvpId & aid, const char *aname) { AvpsId.push_back(aid); std::string name; if (aname) { @@ -58,7 +58,7 @@ void anna::diameter::codec::parent::addAvp(const anna::diameter::AvpId & aid, co AvpsName.push_back(name); } -std::string anna::diameter::codec::parent::asString() const throw() { // "->->...->" +std::string anna::diameter::codec::parent::asString() const { // "->->...->" std::string result = MessageName; for (std::vector::const_iterator it = AvpsName.begin(); it != AvpsName.end(); it++) { result += "->"; @@ -71,7 +71,7 @@ std::string anna::diameter::codec::parent::asString() const throw() { // "getName() == "ISDNNumber") a_ISDNNumber = new ISDNNumber(); else if(stackFormat->getName() == "ISDNAddress") a_ISDNAddress = new ISDNAddress(); else if(stackFormat->getName() == "Unsigned16") a_Unsigned16 = new Unsigned16(); @@ -72,7 +72,7 @@ void Avp::allocationByFormat(const stack::Format *stackFormat) throw() { //------------------------------------------------------------------------------ //----------------------------------------------------- Avp::getLengthByFormat() //------------------------------------------------------------------------------ -U24 Avp::getLengthByFormat(const stack::Format *stackFormat) const throw() { +U24 Avp::getLengthByFormat(const stack::Format *stackFormat) const { U24 result = 0; if(stackFormat->getName() == "ISDNNumber") result += a_ISDNNumber->getSize(); @@ -86,7 +86,7 @@ U24 Avp::getLengthByFormat(const stack::Format *stackFormat) const throw() { //------------------------------------------------------------------------------ //------------------------------------------------ Avp::decodeDataPartByFormat() //------------------------------------------------------------------------------ -void Avp::decodeDataPartByFormat(const char * buffer, int size, const stack::Format *stackFormat) throw(anna::RuntimeException) { +void Avp::decodeDataPartByFormat(const char * buffer, int size, const stack::Format *stackFormat) noexcept(false) { if(stackFormat->getName() == "ISDNNumber") a_ISDNNumber->decode(buffer, size); else if(stackFormat->getName() == "ISDNAddress") a_ISDNAddress->decode(buffer, size); else if(stackFormat->getName() == "Unsigned16") a_Unsigned16->decode(buffer, size); @@ -96,7 +96,7 @@ void Avp::decodeDataPartByFormat(const char * buffer, int size, const stack::For //------------------------------------------------------------------------------ //---------------------------------------------------------- Avp::codeByFormat() //------------------------------------------------------------------------------ -void Avp::codeByFormat(char* dataPart, const stack::Format *stackFormat) const throw(anna::RuntimeException) { +void Avp::codeByFormat(char* dataPart, const stack::Format *stackFormat) const noexcept(false) { int dataBytes; if(stackFormat->getName() == "ISDNNumber") a_ISDNNumber->code(dataPart, dataBytes); @@ -108,7 +108,7 @@ void Avp::codeByFormat(char* dataPart, const stack::Format *stackFormat) const t //------------------------------------------------------------------------------ //---------------------------------------------------- Avp::getXMLdataByFormat() //------------------------------------------------------------------------------ -std::string Avp::getXMLdataByFormat(bool & isHex, const stack::Format *stackFormat) const throw() { +std::string Avp::getXMLdataByFormat(bool & isHex, const stack::Format *stackFormat) const { std::string result; if(stackFormat->getName() == "ISDNNumber") { @@ -126,7 +126,7 @@ std::string Avp::getXMLdataByFormat(bool & isHex, const stack::Format *stackForm //------------------------------------------------------------------------------ //------------------------------------------------------- Avp::fromXMLByFormat() //------------------------------------------------------------------------------ -void Avp::fromXMLByFormat(const anna::xml::Attribute* data, const anna::xml::Attribute* hexData, const stack::Format *stackFormat) throw(anna::RuntimeException) { +void Avp::fromXMLByFormat(const anna::xml::Attribute* data, const anna::xml::Attribute* hexData, const stack::Format *stackFormat) noexcept(false) { if(stackFormat->getName() == "ISDNNumber") { if(data) a_ISDNNumber->fromPrintableString(data->getValue().c_str()); else if(hexData) a_ISDNNumber->fromHexString(hexData->getValue()); diff --git a/source/diameter/codec/tme/Message.cpp b/source/diameter/codec/tme/Message.cpp index 69872cd..1e3fa0c 100644 --- a/source/diameter/codec/tme/Message.cpp +++ b/source/diameter/codec/tme/Message.cpp @@ -18,7 +18,7 @@ using namespace anna::diameter::codec::tme; ////------------------------------------------------------------------------------ ////--------------------------------------------------------- Message::getEngine() ////------------------------------------------------------------------------------ -//anna::diameter::codec::Engine * Message::getEngine() const throw(anna::RuntimeException) { +//anna::diameter::codec::Engine * Message::getEngine() const noexcept(false) { // if(!a_engine) // throw anna::RuntimeException("Invalid codec engine reference (NULL)", ANNA_FILE_LOCATION); // @@ -29,7 +29,7 @@ using namespace anna::diameter::codec::tme; //------------------------------------------------------------------------------ //-------------------------------------------------------- Message::initialize() //------------------------------------------------------------------------------ -void Message::initialize() throw() { +void Message::initialize() { // Base class method: anna::diameter::codec::Message::initialize(); } diff --git a/source/diameter/core/functions.cpp b/source/diameter/core/functions.cpp index 811c5cb..3a2e968 100644 --- a/source/diameter/core/functions.cpp +++ b/source/diameter/core/functions.cpp @@ -14,7 +14,7 @@ using namespace anna::diameter; -std::string functions::avpIdAsPairString(const AvpId & avpId) throw() { +std::string functions::avpIdAsPairString(const AvpId & avpId) { std::string result; result = "("; result += anna::functions::asString(avpId.first); @@ -25,7 +25,7 @@ std::string functions::avpIdAsPairString(const AvpId & avpId) throw() { } -std::string functions::commandIdAsPairString(const CommandId & commandId) throw() { +std::string functions::commandIdAsPairString(const CommandId & commandId) { std::string result; result = "("; result += anna::functions::asString(commandId.first); diff --git a/source/diameter/helpers/base/functions.cpp b/source/diameter/helpers/base/functions.cpp index 2036053..51a0370 100644 --- a/source/diameter/helpers/base/functions.cpp +++ b/source/diameter/helpers/base/functions.cpp @@ -26,7 +26,7 @@ using namespace anna::diameter::codec; using namespace anna::diameter::helpers::base; // getters -U32 anna::diameter::helpers::base::functions::getResultCode(const anna::DataBlock & db) throw(anna::RuntimeException) { +U32 anna::diameter::helpers::base::functions::getResultCode(const anna::DataBlock & db) noexcept(false) { if(db.getSize() < Message::HeaderLength) throw anna::RuntimeException("Not enough bytes to cover command header length", ANNA_FILE_LOCATION); @@ -54,7 +54,7 @@ U32 anna::diameter::helpers::base::functions::getResultCode(const anna::DataBloc void anna::diameter::helpers::base::functions::decodeSessionId(const std::string &sessionId, - std::string &diameterIdentity, U32 &high, U32 &low, std::string &optional) throw(anna::RuntimeException) { + std::string &diameterIdentity, U32 &high, U32 &low, std::string &optional) noexcept(false) { // RFC 3588: // // 8.8. Session-Id AVP @@ -125,7 +125,7 @@ void anna::diameter::helpers::base::functions::decodeSessionId(const std::string std::string anna::diameter::helpers::base::functions::getSessionId(const anna::DataBlock & db, - std::string &diameterIdentity, U32 &high, U32 &low, std::string &optional) throw(anna::RuntimeException) { + std::string &diameterIdentity, U32 &high, U32 &low, std::string &optional) noexcept(false) { if(db.getSize() < Message::HeaderLength) throw anna::RuntimeException("Not enough bytes to cover command header length", ANNA_FILE_LOCATION); @@ -151,7 +151,7 @@ std::string anna::diameter::helpers::base::functions::getSessionId(const anna::D } -std::string anna::diameter::helpers::base::functions::getOriginHost(const anna::DataBlock & db) throw(anna::RuntimeException) { +std::string anna::diameter::helpers::base::functions::getOriginHost(const anna::DataBlock & db) noexcept(false) { if(db.getSize() < Message::HeaderLength) throw anna::RuntimeException("Not enough bytes to cover command header length", ANNA_FILE_LOCATION); diff --git a/source/diameter/helpers/dcca/functions.cpp b/source/diameter/helpers/dcca/functions.cpp index ccb1d80..3e5f20a 100644 --- a/source/diameter/helpers/dcca/functions.cpp +++ b/source/diameter/helpers/dcca/functions.cpp @@ -35,7 +35,7 @@ const char anna::diameter::helpers::dcca::ChargingContextAndDomainSuffix::MMS[] // getters -std::string anna::diameter::helpers::dcca::functions::getSubscriptionIdData(const anna::DataBlock & db, int subscriptionIdType) throw(anna::RuntimeException) { +std::string anna::diameter::helpers::dcca::functions::getSubscriptionIdData(const anna::DataBlock & db, int subscriptionIdType) noexcept(false) { if(db.getSize() < Message::HeaderLength) throw anna::RuntimeException("Not enough bytes to cover command header length", ANNA_FILE_LOCATION); @@ -87,7 +87,7 @@ std::string anna::diameter::helpers::dcca::functions::getSubscriptionIdData(cons } -std::string anna::diameter::helpers::dcca::functions::getServiceContextId(const anna::DataBlock & db, ChargingContext::_v &chargingContext) throw(anna::RuntimeException) { +std::string anna::diameter::helpers::dcca::functions::getServiceContextId(const anna::DataBlock & db, ChargingContext::_v &chargingContext) noexcept(false) { if(db.getSize() < Message::HeaderLength) throw anna::RuntimeException("Not enough bytes to cover command header length", ANNA_FILE_LOCATION); diff --git a/source/diameter/helpers/ericsson/functions.cpp b/source/diameter/helpers/ericsson/functions.cpp index 9c65681..363d445 100644 --- a/source/diameter/helpers/ericsson/functions.cpp +++ b/source/diameter/helpers/ericsson/functions.cpp @@ -25,7 +25,7 @@ using namespace anna::diameter::helpers::ericsson; // getters -std::string anna::diameter::helpers::ericsson::functions::getSCAPSubscriptionIdData(const anna::DataBlock & db, int scapSubscriptionIdType) throw(anna::RuntimeException) { +std::string anna::diameter::helpers::ericsson::functions::getSCAPSubscriptionIdData(const anna::DataBlock & db, int scapSubscriptionIdType) noexcept(false) { if(db.getSize() < Message::HeaderLength) throw anna::RuntimeException("Not enough bytes to cover command header length", ANNA_FILE_LOCATION); diff --git a/source/diameter/helpers/tme/codectypes/ISDNAddress.cpp b/source/diameter/helpers/tme/codectypes/ISDNAddress.cpp index 5a46a28..18f64e9 100644 --- a/source/diameter/helpers/tme/codectypes/ISDNAddress.cpp +++ b/source/diameter/helpers/tme/codectypes/ISDNAddress.cpp @@ -13,7 +13,7 @@ //------------------------------------------------------------------------------ //---------------------------------------------------- ISDNAddress::updateBasic() //------------------------------------------------------------------------------ -void anna::diameter::helpers::tme::codectypes::ISDNAddress::updateBasic() throw(anna::RuntimeException) { +void anna::diameter::helpers::tme::codectypes::ISDNAddress::updateBasic() noexcept(false) { std::string result; anna::functions::codeIsupNumber(a_isupNumber, true /* called party number */, result); OctetString::setValue(result); @@ -23,7 +23,7 @@ void anna::diameter::helpers::tme::codectypes::ISDNAddress::updateBasic() throw( //------------------------------------------------------------------------------ //--------------------------------------------------------- ISDNAddress::decode() //------------------------------------------------------------------------------ -void anna::diameter::helpers::tme::codectypes::ISDNAddress::decode(const char* buffer, const int size) throw(anna::RuntimeException) { +void anna::diameter::helpers::tme::codectypes::ISDNAddress::decode(const char* buffer, const int size) noexcept(false) { if(!buffer) throw anna::RuntimeException("ISDNAddress::decode | Null Buffer provided", ANNA_FILE_LOCATION); diff --git a/source/diameter/helpers/tme/codectypes/ISDNNumber.cpp b/source/diameter/helpers/tme/codectypes/ISDNNumber.cpp index cd4efe4..a138899 100644 --- a/source/diameter/helpers/tme/codectypes/ISDNNumber.cpp +++ b/source/diameter/helpers/tme/codectypes/ISDNNumber.cpp @@ -13,7 +13,7 @@ //------------------------------------------------------------------------------ //---------------------------------------------------- ISDNNumber::updateBasic() //------------------------------------------------------------------------------ -void anna::diameter::helpers::tme::codectypes::ISDNNumber::updateBasic() throw(anna::RuntimeException) { +void anna::diameter::helpers::tme::codectypes::ISDNNumber::updateBasic() noexcept(false) { std::string result; anna::functions::codeIsupNumber(a_isupNumber, false /* calling party number */, result); OctetString::setValue(result); @@ -23,7 +23,7 @@ void anna::diameter::helpers::tme::codectypes::ISDNNumber::updateBasic() throw(a //------------------------------------------------------------------------------ //--------------------------------------------------------- ISDNNumber::decode() //------------------------------------------------------------------------------ -void anna::diameter::helpers::tme::codectypes::ISDNNumber::decode(const char* buffer, const int size) throw(anna::RuntimeException) { +void anna::diameter::helpers::tme::codectypes::ISDNNumber::decode(const char* buffer, const int size) noexcept(false) { if(!buffer) throw anna::RuntimeException("ISDNNumber::decode | Null Buffer provided", ANNA_FILE_LOCATION); diff --git a/source/diameter/helpers/tme/codectypes/Unsigned16.cpp b/source/diameter/helpers/tme/codectypes/Unsigned16.cpp index 29a2142..2c676e8 100644 --- a/source/diameter/helpers/tme/codectypes/Unsigned16.cpp +++ b/source/diameter/helpers/tme/codectypes/Unsigned16.cpp @@ -13,7 +13,7 @@ //------------------------------------------------------------------------------ //---------------------------------------------------- Unsigned16::updateBasic() //------------------------------------------------------------------------------ -void anna::diameter::helpers::tme::codectypes::Unsigned16::updateBasic() throw(anna::RuntimeException) { +void anna::diameter::helpers::tme::codectypes::Unsigned16::updateBasic() noexcept(false) { std::string result; result += (char)(a_value >> 8); result += (char)a_value; @@ -24,7 +24,7 @@ void anna::diameter::helpers::tme::codectypes::Unsigned16::updateBasic() throw(a //------------------------------------------------------------------------------ //--------------------------------------------- Unsigned16::setPrintableString() //------------------------------------------------------------------------------ -void anna::diameter::helpers::tme::codectypes::Unsigned16::setPrintableString(const char * printableString) throw(anna::RuntimeException) { +void anna::diameter::helpers::tme::codectypes::Unsigned16::setPrintableString(const char * printableString) noexcept(false) { setValue(atoi(printableString)); } @@ -32,7 +32,7 @@ void anna::diameter::helpers::tme::codectypes::Unsigned16::setPrintableString(co //------------------------------------------------------------------------------ //--------------------------------------------------------- Unsigned16::decode() //------------------------------------------------------------------------------ -void anna::diameter::helpers::tme::codectypes::Unsigned16::decode(const char* buffer, const int size) throw(anna::RuntimeException) { +void anna::diameter::helpers::tme::codectypes::Unsigned16::decode(const char* buffer, const int size) noexcept(false) { if(!buffer) throw anna::RuntimeException("Unsigned16::decode | Null Buffer provided", ANNA_FILE_LOCATION); diff --git a/source/diameter/internal/sccs.cpp b/source/diameter/internal/sccs.cpp index 27dbf89..1ff7f1f 100644 --- a/source/diameter/internal/sccs.cpp +++ b/source/diameter/internal/sccs.cpp @@ -15,7 +15,7 @@ anna_define_sccs_tag(diameter, 1) void anna::diameter::sccs::activate() -throw() { +{ //anna::sccs::activate(); //anna::comm::sccs::activate(); anna::ModuleManager::instantiate().insert(anna_use_sccs_tag(diameter), 0); diff --git a/source/diameter/stack/Avp.cpp b/source/diameter/stack/Avp.cpp index 0f29383..9bd2e24 100644 --- a/source/diameter/stack/Avp.cpp +++ b/source/diameter/stack/Avp.cpp @@ -37,7 +37,7 @@ anna::diameter::stack::Avp::~Avp(void) { //------------------------------------------------------------------------------ //--------------------------------------------------------------- Avp::isChild() //------------------------------------------------------------------------------ -bool anna::diameter::stack::Avp::isChild(const AvpId & avpId) const throw() { +bool anna::diameter::stack::Avp::isChild(const AvpId & avpId) const { const Format * format = getFormat(); if(!format->isGrouped()) return false; @@ -53,7 +53,7 @@ bool anna::diameter::stack::Avp::isChild(const AvpId & avpId) const throw() { //------------------------------------------------------------------------------ //--------------------------------------------------- Avp::getFlagsDescription() //------------------------------------------------------------------------------ -std::string anna::diameter::stack::Avp::getFlagsDescription(void) const throw() { +std::string anna::diameter::stack::Avp::getFlagsDescription(void) const { std::string trace; trace += "V: "; trace += Avp::FlagRule::asText(a_vBit); trace += ", M: "; trace += Avp::FlagRule::asText(a_mBit); @@ -65,7 +65,7 @@ std::string anna::diameter::stack::Avp::getFlagsDescription(void) const throw() //------------------------------------------------------------------------------ //----------------------------------------------- Avp::getFlagRulesDescription() //------------------------------------------------------------------------------ -std::string anna::diameter::stack::Avp::getFlagRulesDescription(void) const throw() { +std::string anna::diameter::stack::Avp::getFlagRulesDescription(void) const { std::string trace; // Flag Rules: std::string s_must, s_may, s_shouldnot, s_mustnot, s_mayEncypt; @@ -122,7 +122,7 @@ std::string anna::diameter::stack::Avp::getFlagRulesDescription(void) const thro //------------------------------------------------------------------------------ //------------------------------------------------------------- Avp::getFormat() //------------------------------------------------------------------------------ -const anna::diameter::stack::Format * anna::diameter::stack::Avp::getFormat() const throw() { +const anna::diameter::stack::Format * anna::diameter::stack::Avp::getFormat() const { return a_dictionary->getFormat(a_formatName); } @@ -130,7 +130,7 @@ const anna::diameter::stack::Format * anna::diameter::stack::Avp::getFormat() co //------------------------------------------------------------------------------ //-------------------------------------------------------------- Avp::asString() //------------------------------------------------------------------------------ -std::string anna::diameter::stack::Avp::asString() const throw() { +std::string anna::diameter::stack::Avp::asString() const { std::string trace; //trace = "Avp '"; trace = "'"; @@ -182,7 +182,7 @@ std::string anna::diameter::stack::Avp::asString() const throw() { //------------------------------------------------------------------------------ //-------------------------------------------------------------- Avp::addLabel() //------------------------------------------------------------------------------ -void anna::diameter::stack::Avp::addLabel(const std::string & data, const std::string & alias) throw(anna::RuntimeException) { +void anna::diameter::stack::Avp::addLabel(const std::string & data, const std::string & alias) noexcept(false) { const Format * format = getFormat(); if(format->isGrouped()) @@ -203,7 +203,7 @@ void anna::diameter::stack::Avp::addLabel(const std::string & data, const std:: //------------------------------------------------------------------------------ //------------------------------------------------------------ Avp::addAvpRule() //------------------------------------------------------------------------------ -void anna::diameter::stack::Avp::addAvpRule(const AvpRule & avpRule) throw(anna::RuntimeException) { +void anna::diameter::stack::Avp::addAvpRule(const AvpRule & avpRule) noexcept(false) { const Format * format = getFormat(); if(format->isGrouped()) { @@ -232,7 +232,7 @@ void anna::diameter::stack::Avp::addAvpRule(const AvpRule & avpRule) throw(anna: //------------------------------------------------------------------------------ //----------------------------------------------------------------- Avp::asXML() //------------------------------------------------------------------------------ -anna::xml::Node* anna::diameter::stack::Avp::asXML(anna::xml::Node* parent) const throw() { +anna::xml::Node* anna::diameter::stack::Avp::asXML(anna::xml::Node* parent) const { // // // diff --git a/source/diameter/stack/AvpRule.cpp b/source/diameter/stack/AvpRule.cpp index bec3ec9..5d13488 100644 --- a/source/diameter/stack/AvpRule.cpp +++ b/source/diameter/stack/AvpRule.cpp @@ -30,7 +30,7 @@ anna_assign_enum(anna::diameter::stack::AvpRule::Presence) = { "Fixed", "Mandato //------------------------------------------------------------------------------ //----------------------------------------------------------- AvpRule::setQual() //------------------------------------------------------------------------------ -void anna::diameter::stack::AvpRule::setQual(const std::string & q) throw(anna::RuntimeException) { +void anna::diameter::stack::AvpRule::setQual(const std::string & q) noexcept(false) { const char *asterisk = strstr(q.c_str(), "*"); if((q != "") && (asterisk == NULL)) @@ -43,7 +43,7 @@ void anna::diameter::stack::AvpRule::setQual(const std::string & q) throw(anna:: //------------------------------------------------------------------------------ //-------------------------------------------------------- AvpRule::getAvpName() //------------------------------------------------------------------------------ -std::string anna::diameter::stack::AvpRule::getAvpName(void) const throw() { +std::string anna::diameter::stack::AvpRule::getAvpName(void) const { const Avp * avp = a_dictionary->getAvp(a_avpId); return avp->getName(); } @@ -51,7 +51,7 @@ std::string anna::diameter::stack::AvpRule::getAvpName(void) const throw() { //------------------------------------------------------------------------------ //------------------------------------------------------------- AvpRule::isAny() //------------------------------------------------------------------------------ -bool anna::diameter::stack::AvpRule::isAny(void) const throw() { +bool anna::diameter::stack::AvpRule::isAny(void) const { const Avp * avp = a_dictionary->getAvp(a_avpId); const Format * format = a_dictionary->getFormat(avp->getFormatName()); return format->isAny(); @@ -61,7 +61,7 @@ bool anna::diameter::stack::AvpRule::isAny(void) const throw() { //------------------------------------------------------------------------------ //-------------------------------------------------------- AvpRule::getQualMin() //------------------------------------------------------------------------------ -int anna::diameter::stack::AvpRule::getQualMin(void) const throw() { +int anna::diameter::stack::AvpRule::getQualMin(void) const { if(a_qual == "") { if(isFixed() || isMandatory()) return 1; @@ -85,7 +85,7 @@ int anna::diameter::stack::AvpRule::getQualMin(void) const throw() { //------------------------------------------------------------------------------ //-------------------------------------------------------- AvpRule::getQualMax() //------------------------------------------------------------------------------ -int anna::diameter::stack::AvpRule::getQualMax(void) const throw() { +int anna::diameter::stack::AvpRule::getQualMax(void) const { if(a_qual == "") return 1; // Asterisk location @@ -104,7 +104,7 @@ int anna::diameter::stack::AvpRule::getQualMax(void) const throw() { //------------------------------------------------------------------------------ //---------------------------------------------------------- AvpRule::asString() //------------------------------------------------------------------------------ -std::string anna::diameter::stack::AvpRule::asString(bool showPair) const throw() { +std::string anna::diameter::stack::AvpRule::asString(bool showPair) const { std::string trace = "No Avp rule defined"; const Avp * avp = a_dictionary->getAvp(a_avpId); @@ -143,7 +143,7 @@ std::string anna::diameter::stack::AvpRule::asString(bool showPair) const throw( //------------------------------------------------------------------------------ //------------------------------------------------------------- AvpRule::asXML() //------------------------------------------------------------------------------ -anna::xml::Node* anna::diameter::stack::AvpRule::asXML(anna::xml::Node* parent) const throw() { +anna::xml::Node* anna::diameter::stack::AvpRule::asXML(anna::xml::Node* parent) const { // // anna::xml::Node* result = parent->createChild("avprule"); diff --git a/source/diameter/stack/Command.cpp b/source/diameter/stack/Command.cpp index 57a12f1..3fa3ac9 100644 --- a/source/diameter/stack/Command.cpp +++ b/source/diameter/stack/Command.cpp @@ -21,7 +21,7 @@ //------------------------------------------------------------------------------ //-------------------------------------------------------- Command::addAvpRule() //------------------------------------------------------------------------------ -void anna::diameter::stack::Command::addAvpRule(const AvpRule & avpRule) throw(anna::RuntimeException) { +void anna::diameter::stack::Command::addAvpRule(const AvpRule & avpRule) noexcept(false) { if(avpRule.isFixed()) { if(!a_allowFixedRule) { std::string s_ex = anna::functions::asString("Incorrect position for fixed avp rule '<%s>' within command '%s'", avpRule.getAvpName().c_str(), getName().c_str()); @@ -45,7 +45,7 @@ void anna::diameter::stack::Command::addAvpRule(const AvpRule & avpRule) throw(a //------------------------------------------------------------------------------ //----------------------------------------------------------- Command::isChild() //------------------------------------------------------------------------------ -bool anna::diameter::stack::Command::isChild(const AvpId & avpId) const throw() { +bool anna::diameter::stack::Command::isChild(const AvpId & avpId) const { for(const_avprule_iterator it = avprule_begin(); it != avprule_end(); it++) if(avpId == ((*it).second.getId())) return true; @@ -57,7 +57,7 @@ bool anna::diameter::stack::Command::isChild(const AvpId & avpId) const throw() //------------------------------------------------------------------------------ //---------------------------------------------------------- Command::asString() //------------------------------------------------------------------------------ -std::string anna::diameter::stack::Command::asString(void) const throw() { +std::string anna::diameter::stack::Command::asString(void) const { std::string trace; //trace = "Command '"; trace = "'"; @@ -89,7 +89,7 @@ std::string anna::diameter::stack::Command::asString(void) const throw() { //------------------------------------------------------------------------------ //------------------------------------------------------------- Command::asXML() //------------------------------------------------------------------------------ -anna::xml::Node* anna::diameter::stack::Command::asXML(anna::xml::Node* parent) const throw() { +anna::xml::Node* anna::diameter::stack::Command::asXML(anna::xml::Node* parent) const { // // anna::xml::Node* result = parent->createChild("command"); diff --git a/source/diameter/stack/Dictionary.cpp b/source/diameter/stack/Dictionary.cpp index 68f37c1..0f7826a 100644 --- a/source/diameter/stack/Dictionary.cpp +++ b/source/diameter/stack/Dictionary.cpp @@ -58,7 +58,7 @@ Dictionary::Dictionary(void) { //------------------------------------------------------------------------------ //----------------------------------------------------- Dictionary::initialize() //------------------------------------------------------------------------------ -void Dictionary::initialize() throw() { +void Dictionary::initialize() { a_formats.clear(); a_vendors.clear(); a_avps.clear(); @@ -124,7 +124,7 @@ void Dictionary::initialize() throw() { //------------------------------------------------------------------------------ //------------------------------------------------------ Dictionary::addFormat() //------------------------------------------------------------------------------ -void Dictionary::addFormat(const Format & format, bool reserved) throw(anna::RuntimeException) { +void Dictionary::addFormat(const Format & format, bool reserved) noexcept(false) { if(!reserved && format.isReserved()) { std::string s_ex = anna::functions::asString("Format type '%s' is reserved for internal use", format.getName().c_str()); throw anna::RuntimeException(s_ex, ANNA_FILE_LOCATION); @@ -157,7 +157,7 @@ void Dictionary::addFormat(const Format & format, bool reserved) throw(anna::Run //------------------------------------------------------------------------------ //------------------------------------------------------ Dictionary::addVendor() //------------------------------------------------------------------------------ -void Dictionary::addVendor(const Vendor & vendor) throw(anna::RuntimeException) { +void Dictionary::addVendor(const Vendor & vendor) noexcept(false) { const Vendor * found = getVendor(vendor.getId()); if(found) { @@ -189,7 +189,7 @@ void Dictionary::addVendor(const Vendor & vendor) throw(anna::RuntimeException) //------------------------------------------------------------------------------ //--------------------------------------------------------- Dictionary::addAvp() //------------------------------------------------------------------------------ -void Dictionary::addAvp(const Avp & avp) throw(anna::RuntimeException) { +void Dictionary::addAvp(const Avp & avp) noexcept(false) { const Avp * found = getAvp(avp.getId()); if (found) { @@ -220,7 +220,7 @@ void Dictionary::addAvp(const Avp & avp) throw(anna::RuntimeException) { //------------------------------------------------------------------------------ //----------------------------------------------------- Dictionary::addCommand() //------------------------------------------------------------------------------ -void Dictionary::addCommand(const Command & command) throw(anna::RuntimeException) { +void Dictionary::addCommand(const Command & command) noexcept(false) { const Command * found = getCommand(command.getId()); if(found) { @@ -255,7 +255,7 @@ void Dictionary::addCommand(const Command & command) throw(anna::RuntimeExceptio //------------------------------------------------------------------------------ //------------------------------------------------------ Dictionary::getFormat() //------------------------------------------------------------------------------ -const Format * Dictionary::getFormat(const std::string & formatName) const throw() { +const Format * Dictionary::getFormat(const std::string & formatName) const { const_format_iterator it = a_formats.find(formatName); if(it != format_end()) return ((const Format *) & ((*it).second)); @@ -267,7 +267,7 @@ const Format * Dictionary::getFormat(const std::string & formatName) const throw //------------------------------------------------------------------------------ //------------------------------------------------------ Dictionary::getVendor() //------------------------------------------------------------------------------ -const Vendor * Dictionary::getVendor(S32 vendorId) const throw() { +const Vendor * Dictionary::getVendor(S32 vendorId) const { const_vendor_iterator it = a_vendors.find(vendorId); if(it != vendor_end()) return ((const Vendor *) & ((*it).second)); @@ -279,7 +279,7 @@ const Vendor * Dictionary::getVendor(S32 vendorId) const throw() { //------------------------------------------------------------------------------ //------------------------------------------------------ Dictionary::getVendor() //------------------------------------------------------------------------------ -const Vendor * Dictionary::getVendor(const std::string & vendorName) const throw() { +const Vendor * Dictionary::getVendor(const std::string & vendorName) const { const_vendorNames_iterator v_it = a_vendorNames.find(vendorName); if(v_it != a_vendorNames.end()) return ((*v_it).second); @@ -291,7 +291,7 @@ const Vendor * Dictionary::getVendor(const std::string & vendorName) const throw //------------------------------------------------------------------------------ //--------------------------------------------------------- Dictionary::getAvp() //------------------------------------------------------------------------------ -const Avp * Dictionary::getAvp(const AvpId & avpId) const throw() { +const Avp * Dictionary::getAvp(const AvpId & avpId) const { const_avp_iterator it = a_avps.find(avpId); if(it != avp_end()) return ((const Avp *) & ((*it).second)); @@ -303,7 +303,7 @@ const Avp * Dictionary::getAvp(const AvpId & avpId) const throw() { //------------------------------------------------------------------------------ //--------------------------------------------------------- Dictionary::getAvp() //------------------------------------------------------------------------------ -const Avp * Dictionary::getAvp(const std::string & avpName) const throw() { +const Avp * Dictionary::getAvp(const std::string & avpName) const { const_avpNames_iterator a_it = a_avpNames.find(avpName); if(a_it != a_avpNames.end()) return ((*a_it).second); @@ -315,7 +315,7 @@ const Avp * Dictionary::getAvp(const std::string & avpName) const throw() { //------------------------------------------------------------------------------ //----------------------------------------------------- Dictionary::getCommand() //------------------------------------------------------------------------------ -const Command * Dictionary::getCommand(const CommandId & commandId) const throw() { +const Command * Dictionary::getCommand(const CommandId & commandId) const { const_command_iterator it = a_commands.find(commandId); if(it != command_end()) return ((const Command *) & ((*it).second)); @@ -327,7 +327,7 @@ const Command * Dictionary::getCommand(const CommandId & commandId) const throw( //------------------------------------------------------------------------------ //----------------------------------------------------- Dictionary::getCommand() //------------------------------------------------------------------------------ -const Command * Dictionary::getCommand(const std::string & commandName) const throw() { +const Command * Dictionary::getCommand(const std::string & commandName) const { const_commandNames_iterator c_it = a_commandNames.find(commandName); if(c_it != a_commandNames.end()) return ((*c_it).second); @@ -339,7 +339,7 @@ const Command * Dictionary::getCommand(const std::string & commandName) const th //------------------------------------------------------------------------------ //------------------------------------------------------- Dictionary::asString() //------------------------------------------------------------------------------ -std::string Dictionary::asString(void) const throw() { +std::string Dictionary::asString(void) const { std::string trace, title; trace += "\n"; anna::functions::TextHighlightMode::_v thm = anna::functions::TextHighlightMode::LeftAndRightline; @@ -413,7 +413,7 @@ std::string Dictionary::asString(void) const throw() { //------------------------------------------------------------------------------ //---------------------------------------------------------- Dictionary::asXML() //------------------------------------------------------------------------------ -anna::xml::Node* Dictionary::asXML(anna::xml::Node* parent) const throw() { +anna::xml::Node* Dictionary::asXML(anna::xml::Node* parent) const { // // anna::xml::Node* result = parent->createChild("dictionary"); @@ -451,7 +451,7 @@ anna::xml::Node* Dictionary::asXML(anna::xml::Node* parent) const throw() { //------------------------------------------------------------------------------ //---------------------------------------------------- Dictionary::asXMLString() //------------------------------------------------------------------------------ -std::string Dictionary::asXMLString() const throw() { +std::string Dictionary::asXMLString() const { anna::xml::Node root("root"); return anna::xml::Compiler().apply(asXML(&root)); } @@ -461,7 +461,7 @@ std::string Dictionary::asXMLString() const throw() { ////------------------------------------------------------------------------------ ////----------------------------------------- Dictionary::checkUniqueIdentifiers() ////------------------------------------------------------------------------------ -//void Dictionary::checkUniqueIdentifiers(const anna::xml::Node *rootNode) const throw(anna::RuntimeException) { +//void Dictionary::checkUniqueIdentifiers(const anna::xml::Node *rootNode) const noexcept(false) { // std::map < std::string/*xml ref*/, int/*dummy*/ > formats; // std::map < std::string/*xml ref*/, int/*dummy*/ > vendors; // std::map < std::string/*xml ref*/, int/*dummy*/ > avps; @@ -511,7 +511,7 @@ std::string Dictionary::asXMLString() const throw() { //------------------------------------------------------------------------------ //------------------------------------------------- Dictionary::extractFormats() //------------------------------------------------------------------------------ -void Dictionary::extractFormats(const anna::xml::Node *rootNode) throw(anna::RuntimeException) { +void Dictionary::extractFormats(const anna::xml::Node *rootNode) noexcept(false) { Format aux; for(anna::xml::Node::const_child_iterator it = rootNode->child_begin(); it != rootNode->child_end(); it++) { @@ -536,7 +536,7 @@ void Dictionary::extractFormats(const anna::xml::Node *rootNode) throw(anna::Run //------------------------------------------------------------------------------ //------------------------------------------------- Dictionary::extractVendors() //------------------------------------------------------------------------------ -void Dictionary::extractVendors(const anna::xml::Node *rootNode) throw(anna::RuntimeException) { +void Dictionary::extractVendors(const anna::xml::Node *rootNode) noexcept(false) { Vendor aux; for(anna::xml::Node::const_child_iterator it = rootNode->child_begin(); it != rootNode->child_end(); it++) { @@ -559,7 +559,7 @@ void Dictionary::extractVendors(const anna::xml::Node *rootNode) throw(anna::Run //------------------------------------------------------------------------------ //---------------------------------------------------- Dictionary::extractAvps() //------------------------------------------------------------------------------ -void Dictionary::extractAvps(const anna::xml::Node *rootNode) throw(anna::RuntimeException) { +void Dictionary::extractAvps(const anna::xml::Node *rootNode) noexcept(false) { Avp auxAvp; const anna::xml::Node *singleNode, *groupedNode; @@ -763,7 +763,7 @@ void Dictionary::extractAvps(const anna::xml::Node *rootNode) throw(anna::Runtim //------------------------------------------------------------------------------ //------------------------------------------------ Dictionary::extractCommands() //------------------------------------------------------------------------------ -void Dictionary::extractCommands(const anna::xml::Node *rootNode) throw(anna::RuntimeException) { +void Dictionary::extractCommands(const anna::xml::Node *rootNode) noexcept(false) { Command auxCommand; // (*) Avp rules adding: @@ -812,7 +812,7 @@ void Dictionary::extractCommands(const anna::xml::Node *rootNode) throw(anna::Ru //------------------------------------------------------------------------------ //----------------------------------------------------------- Dictionary::load() //------------------------------------------------------------------------------ -void Dictionary::load(const std::string & pathFile) throw(anna::RuntimeException) { +void Dictionary::load(const std::string & pathFile) noexcept(false) { if(pathFile == "") throw anna::RuntimeException("Empty xml path file provided", ANNA_FILE_LOCATION); diff --git a/source/diameter/stack/Engine.cpp b/source/diameter/stack/Engine.cpp index 0acb5e1..e8c77a3 100644 --- a/source/diameter/stack/Engine.cpp +++ b/source/diameter/stack/Engine.cpp @@ -130,7 +130,7 @@ anna::diameter::stack::Engine::Engine(void) { //------------------------------------------------------------------------------ //------------------------------------------------------ Engine::getDictionary() //------------------------------------------------------------------------------ -const anna::diameter::stack::Dictionary * anna::diameter::stack::Engine::getDictionary(unsigned int stackId) const throw() { +const anna::diameter::stack::Dictionary * anna::diameter::stack::Engine::getDictionary(unsigned int stackId) const { const Dictionary * result = NULL; const_stack_iterator it = a_stacks.find(stackId); @@ -143,7 +143,7 @@ const anna::diameter::stack::Dictionary * anna::diameter::stack::Engine::getDict //------------------------------------------------------------------------------ //----------------------------------------------------------- Engine::asString() //------------------------------------------------------------------------------ -std::string anna::diameter::stack::Engine::asString(bool all) const throw() { +std::string anna::diameter::stack::Engine::asString(bool all) const { std::string trace; if(isEmpty()) { @@ -176,7 +176,7 @@ std::string anna::diameter::stack::Engine::asString(bool all) const throw() { //------------------------------------------------------------------------------ //------------------------------------------------- Engine::registerDictionary() //------------------------------------------------------------------------------ -anna::diameter::stack::Dictionary * anna::diameter::stack::Engine::registerDictionary(unsigned int stackId, Dictionary *dictionary) throw(anna::RuntimeException) { +anna::diameter::stack::Dictionary * anna::diameter::stack::Engine::registerDictionary(unsigned int stackId, Dictionary *dictionary) noexcept(false) { Dictionary * result = const_cast(getDictionary(stackId)); if(!dictionary) @@ -197,7 +197,7 @@ anna::diameter::stack::Dictionary * anna::diameter::stack::Engine::registerDicti //------------------------------------------------------------------------------ //--------------------------------------------------- Engine::createDictionary() //------------------------------------------------------------------------------ -anna::diameter::stack::Dictionary * anna::diameter::stack::Engine::createDictionary(unsigned int stackId, const std::string & xmlPathFile) throw(anna::RuntimeException) { +anna::diameter::stack::Dictionary * anna::diameter::stack::Engine::createDictionary(unsigned int stackId, const std::string & xmlPathFile) noexcept(false) { Dictionary * result = const_cast(getDictionary(stackId)); if(result) // if exists, launch exception @@ -219,7 +219,7 @@ anna::diameter::stack::Dictionary * anna::diameter::stack::Engine::createDictio } -void anna::diameter::stack::Engine::loadDictionary(const std::vector & stacks, const std::string & xmlPathFile) throw(anna::RuntimeException) { +void anna::diameter::stack::Engine::loadDictionary(const std::vector & stacks, const std::string & xmlPathFile) noexcept(false) { std::vector::const_iterator it; Dictionary *d; @@ -243,7 +243,7 @@ void anna::diameter::stack::Engine::loadDictionary(const std::vectorgetFormat(a_parentName)->getBasicType(); if(isReserved()) @@ -31,7 +31,7 @@ anna::diameter::codec::Format::_v anna::diameter::stack::Format::getBasicType(vo //------------------------------------------------------------------------------ //------------------------------------------------------ Format::setParentName() //------------------------------------------------------------------------------ -void anna::diameter::stack::Format::setParentName(const std::string & parentName) throw(anna::RuntimeException) { +void anna::diameter::stack::Format::setParentName(const std::string & parentName) noexcept(false) { const Format * parent = a_dictionary->getFormat(parentName); //if (parent && parent->isDerived()) // actually dtd-verified: @@ -45,7 +45,7 @@ void anna::diameter::stack::Format::setParentName(const std::string & parentName //------------------------------------------------------------------------------ //----------------------------------------------------------- Format::asString() //------------------------------------------------------------------------------ -std::string anna::diameter::stack::Format::asString(void) const throw() { +std::string anna::diameter::stack::Format::asString(void) const { std::string trace; //trace = "Format '"; trace = "'"; @@ -65,7 +65,7 @@ std::string anna::diameter::stack::Format::asString(void) const throw() { //------------------------------------------------------------------------------ //-------------------------------------------------------------- Format::asXML() //------------------------------------------------------------------------------ -anna::xml::Node* anna::diameter::stack::Format::asXML(anna::xml::Node* parent) const throw() { +anna::xml::Node* anna::diameter::stack::Format::asXML(anna::xml::Node* parent) const { // // anna::xml::Node* result = parent->createChild("format"); diff --git a/source/diameter/stack/Vendor.cpp b/source/diameter/stack/Vendor.cpp index ad708f8..b4e4bd6 100644 --- a/source/diameter/stack/Vendor.cpp +++ b/source/diameter/stack/Vendor.cpp @@ -19,7 +19,7 @@ anna_assign_enum(anna::diameter::stack::Vendor::Code) = { "Ietf", "Nokia", "Eric //------------------------------------------------------------------------------ //----------------------------------------------------------- Vendor::asString() //------------------------------------------------------------------------------ -std::string anna::diameter::stack::Vendor::asString(void) const throw() { +std::string anna::diameter::stack::Vendor::asString(void) const { std::string trace; //trace = "Vendor '"; trace = "'"; @@ -34,7 +34,7 @@ std::string anna::diameter::stack::Vendor::asString(void) const throw() { //------------------------------------------------------------------------------ //-------------------------------------------------------------- Vendor::asXML() //------------------------------------------------------------------------------ -anna::xml::Node* anna::diameter::stack::Vendor::asXML(anna::xml::Node* parent) const throw() { +anna::xml::Node* anna::diameter::stack::Vendor::asXML(anna::xml::Node* parent) const { // // anna::xml::Node* result = parent->createChild("vendor"); diff --git a/source/html/DocumentFile.cpp b/source/html/DocumentFile.cpp index d14c1f2..c530921 100644 --- a/source/html/DocumentFile.cpp +++ b/source/html/DocumentFile.cpp @@ -21,7 +21,7 @@ using namespace std; using namespace anna; _xmlDoc* html::DocumentFile::do_initialize(const char* filename) -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tf("anna::html::DocumentFile", "do_initialize", ANNA_FILE_LOCATION)); _xmlDoc* result = NULL; a_filename = filename; @@ -47,7 +47,7 @@ throw(RuntimeException) { } _xmlDoc* html::DocumentFile::do_initialize(const anna::DataBlock&) -throw(RuntimeException) { +noexcept(false) { throw RuntimeException("html::DocumentFile::do_initialize | Not implemented", ANNA_FILE_LOCATION); return NULL; } diff --git a/source/html/DocumentMemory.cpp b/source/html/DocumentMemory.cpp index 779e53f..2807600 100644 --- a/source/html/DocumentMemory.cpp +++ b/source/html/DocumentMemory.cpp @@ -19,7 +19,7 @@ using namespace std; using namespace anna; _xmlDoc* html::DocumentMemory::do_initialize(const char* content) -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tf("html::DocumentMemory", "do_initialize", ANNA_FILE_LOCATION)); setContent(content); _xmlDoc* result = NULL; @@ -37,7 +37,7 @@ throw(RuntimeException) { } _xmlDoc* html::DocumentMemory::do_initialize(const anna::DataBlock& contain) -throw(RuntimeException) { +noexcept(false) { throw RuntimeException("html::DocumentMemory::do_initialize | Not implemented", ANNA_FILE_LOCATION); return NULL; } diff --git a/source/html/Parser.cpp b/source/html/Parser.cpp index 430b55f..61428fb 100644 --- a/source/html/Parser.cpp +++ b/source/html/Parser.cpp @@ -12,7 +12,7 @@ using namespace std; using namespace anna; const html::Node* html::Parser::getHead() -throw(RuntimeException) { +noexcept(false) { if(a_head != NULL) return a_head; @@ -25,7 +25,7 @@ throw(RuntimeException) { } const html::Node* html::Parser::getBody() -throw(RuntimeException) { +noexcept(false) { if(a_body != NULL) return a_body; diff --git a/source/html/functions.cpp b/source/html/functions.cpp index 7bd2eed..b01a290 100644 --- a/source/html/functions.cpp +++ b/source/html/functions.cpp @@ -12,7 +12,7 @@ #include void anna::html::functions::initialize() -throw() { +{ html::sccs::activate(); xml::functions::initialize(); } diff --git a/source/html/internal/sccs.cpp b/source/html/internal/sccs.cpp index 78478c3..5eb60cd 100644 --- a/source/html/internal/sccs.cpp +++ b/source/html/internal/sccs.cpp @@ -15,7 +15,7 @@ anna_define_sccs_tag(html, 0); void anna::html::sccs::activate() -throw() { +{ anna::sccs::activate(); anna::xml::sccs::activate(); ModuleManager::instantiate().insert(anna_use_sccs_tag(html), "00"); diff --git a/source/http/Handler.cpp b/source/http/Handler.cpp index 677c702..44231c2 100644 --- a/source/http/Handler.cpp +++ b/source/http/Handler.cpp @@ -29,7 +29,7 @@ http::Handler::~Handler() { // (1) Si ha llegado hasta aqui deberia ser porque el mensaje recibido es del protocolo HTTP. //------------------------------------------------------------------------------------------------ void http::Handler::apply(comm::ClientSocket& clientSocket, const comm::Message& message) -throw(RuntimeException) { +noexcept(false) { if(clientSocket.support(http::Transport::className()) == false) { LOGWARNING( string msg("anna::http::Handler::apply | Incoming ClientSocket has no support for HTTP | Message: "); @@ -69,7 +69,7 @@ throw(RuntimeException) { } http::Response* http::Handler::allocateResponse() -throw() { +{ return (a_response == NULL) ? (a_response = new Response) : a_response; } diff --git a/source/http/Header.cpp b/source/http/Header.cpp index 6352433..cd41c93 100644 --- a/source/http/Header.cpp +++ b/source/http/Header.cpp @@ -30,7 +30,7 @@ const char* http::Header::st_names [http::Header::Type::End] = { }; http::Header* http::Header::initialize(const Type::_v type) -throw(RuntimeException) { +noexcept(false) { if(type == Type::None || type >= Type::Unknown) { string msg(asString()); msg += " | Type: "; @@ -58,7 +58,7 @@ throw(RuntimeException) { } http::Header* http::Header::initialize(const string& name) -throw(RuntimeException) { +noexcept(false) { if(a_extensionName == NULL) a_extensionName = new string(name); else @@ -70,12 +70,12 @@ throw(RuntimeException) { } const int http::Header::getIntegerValue() const -throw() { +{ return atoi(a_value.c_str()); } void http::Header::setValue(const http::Token* token) -throw() { +{ if(token == NULL) a_value.clear(); else @@ -83,12 +83,12 @@ throw() { } void http::Header::setValue(const int value) -throw() { +{ a_value = anna::functions::asString(value); } http::Header& http::Header::operator = (const Header & other) -throw() { +{ if(this == &other) return *this; @@ -109,7 +109,7 @@ throw() { } int http::Header::compare(const char* str, const int flags) const -throw() { +{ const char* p = a_value.c_str(); char* dup(NULL); int result; @@ -140,7 +140,7 @@ throw() { } std::string http::Header::asString() const -throw() { +{ string result("http::Header { Type: "); result += asLiteral(a_type); @@ -160,7 +160,7 @@ throw() { } string http::Header::code() const -throw() { +{ string result; if(a_category == Category::Extension) @@ -177,7 +177,7 @@ throw() { } http::Header::Type::_v http::Header::asType(const http::Token* token) -throw() { +{ for(int i = Type::Begin; token != NULL && i != Type::End; i ++) { if(token->match(st_names [i]) == true) return (Type::_v) i; @@ -187,7 +187,7 @@ throw() { } const char* http::Header::asLiteral(const http::Header::Type::_v type) -throw() { +{ return (type < Type::End) ? st_names [type] : "Extension"; } diff --git a/source/http/Message.cpp b/source/http/Message.cpp index e521264..a98e3b7 100644 --- a/source/http/Message.cpp +++ b/source/http/Message.cpp @@ -19,7 +19,7 @@ using namespace std; using namespace anna; comm::Message* http::Message::setBody(const xml::Node* node) -throw(RuntimeException) { +noexcept(false) { comm::Message::setBody(node); http::Header* contentType = find(http::Header::Type::ContentType); @@ -31,7 +31,7 @@ throw(RuntimeException) { } http::Header* http::Message::find(const http::Header::Type::_v type) -throw() { +{ http::Header* result = NULL; for(header_iterator ii = header_begin(), maxii = header_end(); ii != maxii; ii ++) { @@ -45,7 +45,7 @@ throw() { } http::Header* http::Message::find(const char* name) -throw() { +{ Header* result = NULL; Header* w; const string* s; @@ -75,7 +75,7 @@ throw() { // valor de la longitud real de 'body'. //----------------------------------------------------------------------------------------------- const DataBlock& http::Message::code() -throw(RuntimeException) { +noexcept(false) { Header* contentLength = const_cast (find(Header::Type::ContentLength)); const DataBlock& body = getBody(); @@ -109,7 +109,7 @@ throw(RuntimeException) { } void http::Message::codeLine(const std::string& line) -throw(RuntimeException) { +noexcept(false) { a_codeBuffer->append(line.c_str(), line.length()); a_codeBuffer->append(endOfLine, sizeEndOfLine); } diff --git a/source/http/MessageFactory.cpp b/source/http/MessageFactory.cpp index 17195a5..05d039a 100644 --- a/source/http/MessageFactory.cpp +++ b/source/http/MessageFactory.cpp @@ -11,7 +11,7 @@ using namespace anna; http::Message* http::MessageFactory::create(const http::Message::Type::_v type) -throw(RuntimeException) { +noexcept(false) { if(type == Message::Type::Request) return a_requests.create(); else @@ -19,7 +19,7 @@ throw(RuntimeException) { } void http::MessageFactory::release(http::Message* message) -throw() { +{ if(message == NULL) return; diff --git a/source/http/Method.cpp b/source/http/Method.cpp index 7d4c751..3a15675 100644 --- a/source/http/Method.cpp +++ b/source/http/Method.cpp @@ -17,7 +17,7 @@ anna_assign_enum(http::Method::Type) = { }; http::Method::Type::_v http::Method::asType(const http::Token* token) -throw() { +{ for(int ii = 0; anna_item_enum(http::Method::Type, ii) != NULL; ii ++) { if(token->match(anna_item_enum(http::Method::Type, ii)) == true) return (Type::_v) ii; @@ -27,7 +27,7 @@ throw() { } string http::Method::asString(const http::Method::Type::_v type) -throw() { +{ string result("http::Method { Name: "); result += Type::asCString(type); return result += " }"; diff --git a/source/http/Request.cpp b/source/http/Request.cpp index 259b253..b403dcf 100644 --- a/source/http/Request.cpp +++ b/source/http/Request.cpp @@ -14,7 +14,7 @@ using namespace std; using namespace anna; string http::Request::codeStartLine() const -throw(RuntimeException) { +noexcept(false) { if(a_uri == "") throw RuntimeException("URI must have a value", ANNA_FILE_LOCATION); @@ -26,7 +26,7 @@ throw(RuntimeException) { } string http::Request::asString() const -throw() { +{ string result("http::Request { "); result += Method::asString(a_method); result += " | URI: "; diff --git a/source/http/Response.cpp b/source/http/Response.cpp index 1029dc5..fecdf61 100644 --- a/source/http/Response.cpp +++ b/source/http/Response.cpp @@ -14,7 +14,7 @@ using namespace std; using namespace anna; void http::Response::setStatusCode(const int statusCode) -throw() { +{ static struct { int statusCode; const char* reasonPhrase; } reasons [] = { 100, "Continue", 101, "Switching Protocols", @@ -78,7 +78,7 @@ throw() { } string http::Response::codeStartLine() const -throw(RuntimeException) { +noexcept(false) { string result(getVersion()); result += ' '; result += functions::asString(a_statusCode); @@ -87,7 +87,7 @@ throw(RuntimeException) { } string http::Response::asString() const -throw() { +{ string result("http::Response { Version: "); result += getVersion(); result += " | StatusCode: "; diff --git a/source/http/Transport.cpp b/source/http/Transport.cpp index 3a0b89c..0b78c08 100644 --- a/source/http/Transport.cpp +++ b/source/http/Transport.cpp @@ -47,7 +47,7 @@ http::Transport::Transport() : // importantes del mensaje HTTP recibido. //---------------------------------------------------------------------------------------------- void http::Transport::clear() -throw() { +{ comm::Transport::clear(); if(a_inputMessage != NULL) { @@ -67,7 +67,7 @@ throw() { } http::Message* http::Transport::getInputMessage() -throw(RuntimeException) { +noexcept(false) { if(a_inputMessage == NULL) throw RuntimeException("getInputMessage | HTTP message was not extracted", ANNA_FILE_LOCATION); @@ -75,7 +75,7 @@ throw(RuntimeException) { } void http::Transport::setParserState(const parser::Abstract* parser) -throw(RuntimeException) { +noexcept(false) { if(a_parser == parser) return; @@ -90,7 +90,7 @@ throw(RuntimeException) { } http::Message* http::Transport::allocateInputMessage(const http::Message::Type::_v type) -throw(RuntimeException) { +noexcept(false) { if(a_inputMessage != NULL) throw RuntimeException("http::Transport::allocateInputMessage | Former HTTP message was not released", ANNA_FILE_LOCATION); @@ -98,19 +98,19 @@ throw(RuntimeException) { } const http::Tokenizer& http::Transport::split(const http::Token& token) -throw(RuntimeException) { +noexcept(false) { a_lineScope.apply(token); return a_lineScope; } const http::Tokenizer& http::Transport::split(const http::Token& token, const char* separator) -throw(RuntimeException) { +noexcept(false) { a_lineScope.apply(token, separator); return a_lineScope; } const http::Tokenizer& http::Transport::split(const http::Token& token, const char separator) -throw(RuntimeException) { +noexcept(false) { a_lineScope.apply(token, separator); return a_lineScope; } @@ -119,7 +119,7 @@ throw(RuntimeException) { * El segundo bloque se crea con el tamaño calculado al analizar el mensaje */ const http::Message* http::Transport::externalDecode(const char* buffer, const int size) -throw(RuntimeException) { +noexcept(false) { DataBlock dataBlock(buffer, size, false); clear(); int httpSize; @@ -156,7 +156,7 @@ throw(RuntimeException) { // (2) Si estamos analizando un Transfer-Encoding: chunked. //---------------------------------------------------------------------------------------------- int http::Transport::calculeSize(const DataBlock& dataBlock) -throw(RuntimeException) { +noexcept(false) { Tokenizer::iterator ii; Tokenizer::iterator maxii; int result = -1; @@ -214,7 +214,7 @@ throw(RuntimeException) { // para comenzar con el analisis de un un nuevo mensaje. //---------------------------------------------------------------------------------------------- const comm::Message* http::Transport::decode(const DataBlock& dataBlock) -throw(RuntimeException) { +noexcept(false) { const bool isEncoded = (a_encodedBlock == NULL) ? false : a_encodedBlock->isValid(); if(isEncoded == true) { @@ -263,12 +263,12 @@ throw(RuntimeException) { // Toda la complejidad de la codificacion la soporta el http::Message. //----------------------------------------------------------------------------------------------------- const DataBlock& http::Transport::code(comm::Message& message) -throw(RuntimeException) { +noexcept(false) { return message.code(); } http::EncodedBlock* http::Transport::getEncodedBlock() -throw() { +{ if(a_encodedBlock == NULL) a_encodedBlock = new EncodedBlock; diff --git a/source/http/functions.cpp b/source/http/functions.cpp index 7b5f558..220e31a 100644 --- a/source/http/functions.cpp +++ b/source/http/functions.cpp @@ -14,12 +14,12 @@ using namespace anna; void http::functions::initialize() -throw() { +{ http::sccs::activate(); } int http::functions::find(const void* _data, const int size, const char* searched) -throw() { +{ int result(-1); const char* data = (const char*) _data; int i, matchBegin, matchLen; diff --git a/source/http/internal/EncodedBlock.cpp b/source/http/internal/EncodedBlock.cpp index f749454..5aca707 100644 --- a/source/http/internal/EncodedBlock.cpp +++ b/source/http/internal/EncodedBlock.cpp @@ -23,7 +23,7 @@ using namespace anna; * en que considera que el Bloque está comnpleto, y entonces lo pasa al bloque principal. */ http::EncodedBlock::State::_v http::EncodedBlock::append(const DataBlock& chunk) -throw() { +{ const int left = a_expectedSize - a_chunk.getSize(); State::_v result(State::Incomplete); diff --git a/source/http/internal/Token.cpp b/source/http/internal/Token.cpp index 1bdd366..98ff925 100644 --- a/source/http/internal/Token.cpp +++ b/source/http/internal/Token.cpp @@ -18,7 +18,7 @@ using namespace std; using namespace anna; const string& http::Token::getStringValue() const -throw() { +{ if(contains(0) == false) const_cast (this)->a_aux.assign(DataBlock::getData(), DataBlock::getSize()); else @@ -28,7 +28,7 @@ throw() { } int http::Token::getIntegerValue() const -throw() { +{ if(contains(0) == false) { const_cast (this)->a_aux.assign(DataBlock::getData(), DataBlock::getSize()); return atoi(a_aux.c_str()); @@ -38,7 +38,7 @@ throw() { } bool http::Token::contains(const char byte) const -throw() { +{ const char* p; const char* maxp; @@ -51,7 +51,7 @@ throw() { } int http::Token::calculeOffset(const DataBlock& base) const -throw(RuntimeException) { +noexcept(false) { const int result = getData() - base.getData(); if(result < 0) { @@ -64,7 +64,7 @@ throw(RuntimeException) { } bool http::Token::match(const char* str) const -throw() { +{ const char* pp = DataBlock::getData(); int size = DataBlock::getSize(); diff --git a/source/http/internal/Tokenizer.cpp b/source/http/internal/Tokenizer.cpp index 3df6c48..d4fe17c 100644 --- a/source/http/internal/Tokenizer.cpp +++ b/source/http/internal/Tokenizer.cpp @@ -21,7 +21,7 @@ using namespace anna; // Extrae los datos del bloque de memoria separando por espacios en blancos, tabs, etc, etc //-------------------------------------------------------------------------------------------- void http::Tokenizer::apply(const DataBlock& data) -throw(RuntimeException) { +noexcept(false) { const char* p = data.getData(); const char* maxp = p + data.getSize(); bool searchingInit = true; @@ -52,7 +52,7 @@ throw(RuntimeException) { } void http::Tokenizer::apply(const DataBlock& data, const char* separator) -throw(RuntimeException) { +noexcept(false) { const char* p = data.getData(); int size = data.getSize(); const char* maxp = p + size; @@ -74,7 +74,7 @@ throw(RuntimeException) { } void http::Tokenizer::apply(const DataBlock& data, const char separator) -throw(RuntimeException) { +noexcept(false) { const char* p = data.getData(); int size = data.getSize(); const char* maxp = p + size; @@ -95,7 +95,7 @@ throw(RuntimeException) { } const http::Token* http::Tokenizer::operator [](int index) const -throw() { +{ const_iterator ii = begin(); const_iterator maxii = end(); @@ -108,7 +108,7 @@ throw() { } int http::Tokenizer::find(const char* data, const int size, const char searched) -throw() { +{ for(int i = 0; i < size; i ++, data ++) { if(*data == searched) return i; @@ -118,7 +118,7 @@ throw() { } int http::Tokenizer::find(const char* data, const int size, const char* searched) -throw() { +{ static const int EndOfLineLen = 2; int result(-1); const char* w(data); diff --git a/source/http/internal/sccs.cpp b/source/http/internal/sccs.cpp index ac6caa0..595fef2 100644 --- a/source/http/internal/sccs.cpp +++ b/source/http/internal/sccs.cpp @@ -16,7 +16,7 @@ anna_define_sccs_tag(http, 0); void anna::http::sccs::activate() -throw() { +{ anna::sccs::activate(); anna::comm::sccs::activate(); anna::xml::sccs::activate(); diff --git a/source/http/parser/Abstract.cpp b/source/http/parser/Abstract.cpp index 04aab1e..7b1420b 100644 --- a/source/http/parser/Abstract.cpp +++ b/source/http/parser/Abstract.cpp @@ -42,7 +42,7 @@ anna_assign_enum(parser::Abstract::ClassType) = { } string http::parser::Abstract::asString() const -throw() { +{ string result("http::parser::Abstract { "); result += ClassType::asCString(a_classType); return result += " }"; @@ -51,7 +51,7 @@ throw() { /*static*/ void http::parser::Abstract::setState(http::Transport& transport, const http::parser::Abstract::ClassType::_v classType) -throw() { +{ /* * Se repite el Wait-Message para llenar el hueco de ClassType::None */ @@ -64,7 +64,7 @@ throw() { /*static*/ void http::parser::Abstract::appendExtraParameter(http::Message* message, const std::string& extraParameter) -throw() { +{ message->appendExtraParameter(extraParameter); } @@ -77,14 +77,14 @@ throw() { */ /*static*/ void http::parser::Abstract::setLastChunkedByte(http::Transport& transport, const int lastChunkedByte) -throw() { +{ transport.a_lastChunkedByte += lastChunkedByte; } // Sólo se puede usar en caso de Mensajes Transfer-encoding: chunked /*static*/ const DataBlock& http::parser::Abstract::getFullMessage(http::Transport& transport) -throw() { +{ return *transport.a_fullMessage; } diff --git a/source/http/parser/ReadChunkData.cpp b/source/http/parser/ReadChunkData.cpp index 4b944c8..aa97efe 100644 --- a/source/http/parser/ReadChunkData.cpp +++ b/source/http/parser/ReadChunkData.cpp @@ -47,7 +47,7 @@ using namespace anna; 656: 2d 3e 0a 0d 0a 30 0d 0a 0d 0a ->...0.... */ int http::parser::ReadChunkData::processLine(http::Transport& transport, const DataBlock& slice, const http::Token& line) const -throw(RuntimeException) { +noexcept(false) { EncodedBlock* encodedBlock = transport.getEncodedBlock(); if(encodedBlock->append(line) == EncodedBlock::State::Completed) diff --git a/source/http/parser/ReadChunkSize.cpp b/source/http/parser/ReadChunkSize.cpp index 6fec1ef..a361249 100644 --- a/source/http/parser/ReadChunkSize.cpp +++ b/source/http/parser/ReadChunkSize.cpp @@ -64,7 +64,7 @@ using namespace anna; Después del tamamño del chunk puede venir un "; y parámetros extras". */ int http::parser::ReadChunkSize::processLine(http::Transport& transport, const DataBlock& dataBlock, const http::Token& line) const -throw(RuntimeException) { +noexcept(false) { int chunkSize = 0; EncodedBlock* encodedBlock = transport.getEncodedBlock(); diff --git a/source/http/parser/ReadChunkTrailers.cpp b/source/http/parser/ReadChunkTrailers.cpp index 205e9dd..33cdb18 100644 --- a/source/http/parser/ReadChunkTrailers.cpp +++ b/source/http/parser/ReadChunkTrailers.cpp @@ -57,7 +57,7 @@ using namespace anna; obtengamos el cuerpo del mensaje HTTP que progresaremos hacia el exterior. */ int http::parser::ReadChunkTrailers::processLine(http::Transport& transport, const DataBlock& slice, const http::Token& line) const -throw(RuntimeException) { +noexcept(false) { if(line.getSize() == 0) { // (1) setState(transport, ClassType::WaitMessage); return line.calculeOffset(parser::Abstract::getFullMessage(transport)) + sizeEndOfLine; diff --git a/source/http/parser/ReadHeader.cpp b/source/http/parser/ReadHeader.cpp index 9394ebd..acd172c 100644 --- a/source/http/parser/ReadHeader.cpp +++ b/source/http/parser/ReadHeader.cpp @@ -42,7 +42,7 @@ using namespace anna; //---------------------------------------------------------------------------------------------------- /*virtual*/ int http::parser::ReadHeader::processLine(http::Transport& transport, const DataBlock& dataBlock, const http::Token& line) const -throw(RuntimeException) { +noexcept(false) { if(line.getSize() == 0) { // (3) const int size = line.calculeOffset(dataBlock) + sizeEndOfLine; setState(transport, ClassType::WaitMessage); diff --git a/source/http/parser/WaitChunkSize.cpp b/source/http/parser/WaitChunkSize.cpp index 2fa8b57..c82ec7c 100644 --- a/source/http/parser/WaitChunkSize.cpp +++ b/source/http/parser/WaitChunkSize.cpp @@ -44,7 +44,7 @@ using namespace anna; 656: 2d 3e 0a 0d 0a 30 0d 0a 0d 0a ->...0.... */ int http::parser::WaitChunkSize::processLine(http::Transport& transport, const DataBlock& dataBlock, const http::Token& line) const -throw(RuntimeException) { +noexcept(false) { if(line.getSize() == 0) { setState(transport, ClassType::ReadChunkSize); return -1; diff --git a/source/http/parser/WaitEndOfHeader.cpp b/source/http/parser/WaitEndOfHeader.cpp index ee508ad..e5ce8d1 100644 --- a/source/http/parser/WaitEndOfHeader.cpp +++ b/source/http/parser/WaitEndOfHeader.cpp @@ -19,7 +19,7 @@ using namespace anna; // Recordar que sólo se llega a este estado en caso de haber encontrado el 'Content-Length'. //---------------------------------------------------------------------------------------------------- int http::parser::WaitEndOfHeader::processLine(http::Transport& transport, const DataBlock& dataBlock, const http::Token& line) const -throw(RuntimeException) { +noexcept(false) { /* * Cuando en cuenta la última línea del mensaje calcula el tamaño total del mensaje. * El Content-Length sólo informa sobre la longitud del bloque de datos, pero diff --git a/source/http/parser/WaitMessage.cpp b/source/http/parser/WaitMessage.cpp index 8482cea..a5a1467 100644 --- a/source/http/parser/WaitMessage.cpp +++ b/source/http/parser/WaitMessage.cpp @@ -34,7 +34,7 @@ using namespace anna; // (4) Si estamos recibiendo un Response //---------------------------------------------------------------------------------------------------- int http::parser::WaitMessage::processLine(http::Transport& transport, const DataBlock&, const http::Token& line) const -throw(RuntimeException) { +noexcept(false) { if(line.getSize() == 0) // (1) return -1; @@ -61,7 +61,7 @@ throw(RuntimeException) { //---------------------------------------------------------------------------------------------------- /*static*/ bool http::parser::WaitMessage::setupRequest(http::Transport& transport, const http::Tokenizer& tokenizer) -throw() { +{ bool result = true; const Token* token; Tokenizer::const_iterator ii = tokenizer.begin(); @@ -101,7 +101,7 @@ throw() { //---------------------------------------------------------------------------------------------------- /*static*/ void http::parser::WaitMessage::setupResponse(http::Transport& transport, const http::Tokenizer& tokenizer) -throw() { +{ const Token* token; Tokenizer::const_iterator ii = tokenizer.begin(); diff --git a/source/http/wims20/Abstract.cpp b/source/http/wims20/Abstract.cpp index 49f0fea..b2a214e 100644 --- a/source/http/wims20/Abstract.cpp +++ b/source/http/wims20/Abstract.cpp @@ -40,7 +40,7 @@ http::wims20::Abstract::~Abstract() { /* Calcula la parte fija de la URI, se invoca desde el constructor. */ const string& http::wims20::Abstract::calculeFixedPart() -throw(RuntimeException) { +noexcept(false) { if(a_serviceID.empty() == true) { string msg(asString()); msg += " | ServiceID can not be NULL"; @@ -63,7 +63,7 @@ throw(RuntimeException) { } const string& http::wims20::Abstract::calculeShortFixedPart() -throw(RuntimeException) { +noexcept(false) { string::size_type pos = a_domain.find("http://"); if(pos == string::npos) { @@ -87,7 +87,7 @@ throw(RuntimeException) { } void http::wims20::Abstract::other_level_add(const std::string& otherLevel) -throw(RuntimeException) { +noexcept(false) { if(a_otherLevels == NULL) a_otherLevels = new other_level_container; @@ -101,7 +101,7 @@ throw(RuntimeException) { /*virtual*/ void http::wims20::Abstract::clearOtherLevels() -throw() { +{ if(hasOtherLevels()) { for(other_level_iterator ii = other_level_begin(), maxii = other_level_end(); ii != maxii; ii ++) destroyString(otherLevel(ii)); @@ -111,7 +111,7 @@ throw() { } void http::wims20::Abstract::parameter_set(const std::string& name, const std::string& value) -throw(RuntimeException) { +noexcept(false) { bool exists = false; if(a_parameters == NULL) @@ -144,7 +144,7 @@ throw(RuntimeException) { } void http::wims20::Abstract::clearParameters() -throw() { +{ if(hasParameters()) { for(parameter_iterator ii = parameter_begin(), maxii = parameter_end(); ii != maxii; ii ++) { destroyString(parameter_name(ii)); @@ -156,7 +156,7 @@ throw() { } string http::wims20::Abstract::asString() const -throw() { +{ string result("http::wims20::"); result += a_whatis; result += " { Domain: "; @@ -194,7 +194,7 @@ throw() { /*static*/ void http::wims20::Abstract::appendWithSlash(std::string& target, const std::string& other) -throw() { +{ const char* str = target.c_str(); if(str [anna_strlen(str) - 1] != '/') diff --git a/source/http/wims20/ClientSide.cpp b/source/http/wims20/ClientSide.cpp index 2aef3ea..98f267a 100644 --- a/source/http/wims20/ClientSide.cpp +++ b/source/http/wims20/ClientSide.cpp @@ -20,7 +20,7 @@ using namespace anna; * cada vez que tengamos que calcular la URI. */ void http::wims20::ClientSide::addOtherLevel(const std::string& otherLevel) -throw(RuntimeException) { +noexcept(false) { if(a_strOtherLevels == NULL) a_strOtherLevels = Abstract::createString(otherLevel); else { @@ -44,7 +44,7 @@ throw(RuntimeException) { \li query_parameters: Lista de parámetros. Si hay más de un parámetro se separará con '&'. */ void http::wims20::ClientSide::codeOn(http::Request& request) -throw(RuntimeException) { +noexcept(false) { a_uri = Abstract::calculeFixedPart(); if(Abstract::hasOtherLevels()) diff --git a/source/http/wims20/ServerSide.cpp b/source/http/wims20/ServerSide.cpp index 64a6fbe..0e70bd8 100644 --- a/source/http/wims20/ServerSide.cpp +++ b/source/http/wims20/ServerSide.cpp @@ -22,7 +22,7 @@ using namespace anna; * expresión con la forma: http://xxx/zzzzAAAAAA, p.e. */ void http::wims20::ServerSide::decode(const http::Request& request) -throw(RuntimeException) { +noexcept(false) { Abstract::clear(); const string& uri = request.getURI(); // Calcula la parte corta que hemos definido para el servicio @@ -86,7 +86,7 @@ throw(RuntimeException) { } const string* http::wims20::ServerSide::getValue(const char* name, const Exception::Mode::_v mode) const -throw(RuntimeException) { +noexcept(false) { const string* result = NULL; if(hasParameters() == true) { @@ -116,13 +116,13 @@ throw(RuntimeException) { } const char* http::wims20::ServerSide::getCStringValue(const char* name, const Exception::Mode::_v mode) const -throw(RuntimeException) { +noexcept(false) { const string* temp = getValue(name, mode); return (temp == NULL) ? NULL : temp->c_str(); } int http::wims20::ServerSide::getIntegerValue(const char* name, const Exception::Mode::_v mode) const -throw(RuntimeException) { +noexcept(false) { const string* tmp = getValue(name, mode); if(tmp == NULL) @@ -135,7 +135,7 @@ throw(RuntimeException) { /* Nos ha debido llegar algo asi como: serviceID/guid {other_possible_levels} */ void http::wims20::ServerSide::decodeHierarchy(const std::string& hierarchy) -throw(RuntimeException) { +noexcept(false) { const Tokenizer& items = split(SplitCode::HierarchyItem, hierarchy); Abstract::setServiceID(items [0]); Abstract::setGUID(items [1]); @@ -153,7 +153,7 @@ throw(RuntimeException) { /* Nos ha debido llegar algo así como: name=value&*{nameN=valueN} */ void http::wims20::ServerSide::decodeParameters(const std::string& parameters) -throw(RuntimeException) { +noexcept(false) { const Tokenizer& tkparams = split(SplitCode::Parameters, parameters); for(Tokenizer::const_iterator ii = tkparams.begin(), maxii = tkparams.end(); ii != maxii; ii ++) { @@ -165,7 +165,7 @@ throw(RuntimeException) { } const Tokenizer& http::wims20::ServerSide::split(const SplitCode::_v splitZone, const std::string& str) -throw(RuntimeException) { +noexcept(false) { static const char* separator [] = { "?", "/", "&", "=", NULL }; a_tokenizer [splitZone].apply(str, separator [splitZone]); LOGDEBUG( diff --git a/source/io/AbstractReader.cpp b/source/io/AbstractReader.cpp index f26d2a5..5c7bdea 100644 --- a/source/io/AbstractReader.cpp +++ b/source/io/AbstractReader.cpp @@ -46,7 +46,7 @@ io::AbstractReader::~AbstractReader() { } void io::AbstractReader::close() -throw() { +{ delete a_ex; a_ex = NULL; @@ -57,7 +57,7 @@ throw() { } void io::AbstractReader::open(const std::string& filename) -throw(RuntimeException) { +noexcept(false) { close(); if((a_file = fopen(filename.c_str(), "r")) == NULL) @@ -65,7 +65,7 @@ throw(RuntimeException) { } void io::AbstractReader::verify() -throw(RuntimeException) { +noexcept(false) { if(a_ex != NULL) throw *a_ex; diff --git a/source/io/BinaryReader.cpp b/source/io/BinaryReader.cpp index b971159..f811509 100644 --- a/source/io/BinaryReader.cpp +++ b/source/io/BinaryReader.cpp @@ -42,7 +42,7 @@ io::BinaryReader::~BinaryReader() { } const DataBlock* io::BinaryReader::fetch() -throw(RuntimeException) { +noexcept(false) { verify(); allocate(a_blockSize); size_t blockSize = fread((char *) getData(), 1, a_blockSize, a_file); diff --git a/source/io/Directory.cpp b/source/io/Directory.cpp index 0a853cd..59f85da 100644 --- a/source/io/Directory.cpp +++ b/source/io/Directory.cpp @@ -28,7 +28,7 @@ io::Directory::Directory() : } void io::Directory::setPattern(const char* expression) -throw(RuntimeException) { +noexcept(false) { if(a_hasPattern == true) { regfree(&a_regex); a_hasPattern = false; @@ -57,7 +57,7 @@ throw(RuntimeException) { } void io::Directory:: read(const char* dirName, const Mode::_v mode) -throw(RuntimeException) { +noexcept(false) { DIR* handle; dirent* entry; string file; @@ -91,7 +91,7 @@ throw(RuntimeException) { } io::Directory::const_iterator io::Directory::find(const std::string& file) const -throw() { +{ return std::find(begin(), end(), file); } diff --git a/source/io/TextReader.cpp b/source/io/TextReader.cpp index 83d36c0..fc3f820 100644 --- a/source/io/TextReader.cpp +++ b/source/io/TextReader.cpp @@ -43,7 +43,7 @@ io::TextReader::~TextReader() { } const char* io::TextReader::fetch() -throw(RuntimeException) { +noexcept(false) { verify(); char* result = fgets(a_buffer, a_maxLength - 1, a_file); diff --git a/source/io/functions.cpp b/source/io/functions.cpp index 47700ff..590180a 100644 --- a/source/io/functions.cpp +++ b/source/io/functions.cpp @@ -21,7 +21,7 @@ using namespace std; using namespace anna; void io::functions::mkdir(const std::string& path) -throw(RuntimeException) { +noexcept(false) { Tokenizer tokenizer; string w; int r; @@ -41,7 +41,7 @@ throw(RuntimeException) { } bool io::functions::exists(const char* path) -throw(RuntimeException) { +noexcept(false) { struct stat data; int r; anna_signal_shield(r, stat(path, &data)); @@ -56,7 +56,7 @@ throw(RuntimeException) { } bool io::functions::isADirectory(const char* path) -throw(RuntimeException) { +noexcept(false) { struct stat data; int r; anna_signal_shield(r, stat(path, &data)); @@ -68,7 +68,7 @@ throw(RuntimeException) { } ino_t io::functions::getINode(const char* path) -throw(RuntimeException) { +noexcept(false) { struct stat data; int r; anna_signal_shield(r, stat(path, &data)); @@ -81,7 +81,7 @@ throw(RuntimeException) { /*static*/ bool io::functions::waitInput(const int fd, const Millisecond &timeout) -throw(RuntimeException) { +noexcept(false) { pollfd waiting; int r; waiting.fd = fd; diff --git a/source/io/internal/sccs.cpp b/source/io/internal/sccs.cpp index 883168f..d4276f1 100644 --- a/source/io/internal/sccs.cpp +++ b/source/io/internal/sccs.cpp @@ -14,7 +14,7 @@ anna_define_sccs_tag(io, 0); void anna::io::sccs::activate() -throw() { +{ anna::sccs::activate(); ModuleManager::instantiate().insert(anna_use_sccs_tag(io), "00"); } diff --git a/source/ldap/ClassCode.cpp b/source/ldap/ClassCode.cpp index 313b7b8..893ff56 100644 --- a/source/ldap/ClassCode.cpp +++ b/source/ldap/ClassCode.cpp @@ -12,7 +12,7 @@ using namespace std; using namespace anna; string ldap::ClassCode::asString(const ClassCode::_v v) -throw() { +{ static const char* text [] = { "Undefined", "Bind", "Search" }; string result("ClassCode: "); return result += (v >= Min && v < Max) ? text [v] : ""; diff --git a/source/ldap/Engine.cpp b/source/ldap/Engine.cpp index 42263ca..1d84045 100644 --- a/source/ldap/Engine.cpp +++ b/source/ldap/Engine.cpp @@ -33,7 +33,7 @@ Engine::Engine() : } Session* Engine::createSession(const char* url, const char* user, const char* password, const int category) -throw(RuntimeException) { +noexcept(false) { ldap::Session* result(NULL); Guard guard(this, "ldap::Engine::createSession"); url = completeURL(url); @@ -75,7 +75,7 @@ throw(RuntimeException) { } Session* Engine::createSession(const char* url, const int id, const char* user, const char* password, const int category) -throw(RuntimeException) { +noexcept(false) { ldap::Session* result(NULL); Guard guard(this, "ldap::Engine::createSession"); url = completeURL(url); @@ -125,7 +125,7 @@ throw(RuntimeException) { } Session* Engine::findSession(const char* url, const char* user, Exception::Mode::_v emode) -throw(RuntimeException) { +noexcept(false) { Guard guard(this, "ldap::Engine::findSession"); url = completeURL(url); session_iterator ii = session_find(url, user); @@ -151,7 +151,7 @@ throw(RuntimeException) { } Session* Engine::findSession(const char* url, const int id, Exception::Mode::_v emode) -throw(RuntimeException) { +noexcept(false) { Guard guard(this, "ldap::Engine::findSession (int)"); session_iterator ii = session_find(url, id); @@ -175,7 +175,7 @@ throw(RuntimeException) { } void Engine::closeSession(Session* session) -throw(RuntimeException) { +noexcept(false) { if(session == NULL) return; @@ -201,7 +201,7 @@ throw(RuntimeException) { } void Engine::do_stop() -throw() { +{ LOGMETHOD(TraceMethod tttm("anna::ldap::Engine", "do_stop", ANNA_FILE_LOCATION)); for(session_iterator ii = session_begin(), maxii = session_end(); ii != maxii; ii ++) @@ -209,7 +209,7 @@ throw() { } xml::Node* Engine::asXML(xml::Node* parent) const -throw() { +{ parent = app::Component::asXML(parent); xml::Node* result = parent->createChild("ldap.Engine"); const Session* session; @@ -224,13 +224,13 @@ throw() { } Engine::session_iterator Engine::session_find(const char* url, const int id) -throw() { +{ return a_sessions.find(session_key(url, anna::functions::asString(id))); } /*static*/ int Engine::setDebugLevel(const int level) -throw(RuntimeException) { +noexcept(false) { int result(-1); #ifdef LDAP_OPT_DEBUG_LEVEL int _level = htonl(level); @@ -249,7 +249,7 @@ throw(RuntimeException) { } const char* Engine::completeURL(const char* url) -throw() { +{ static const char* protocol = "ldap://"; if(anna_strstr(url, "://") == 0) { @@ -263,5 +263,5 @@ throw() { // static void Engine::alarmnCatcher(int) -throw() { +{ } diff --git a/source/ldap/Request.cpp b/source/ldap/Request.cpp index e7418c6..e3f4e8b 100644 --- a/source/ldap/Request.cpp +++ b/source/ldap/Request.cpp @@ -14,14 +14,14 @@ using namespace std; using namespace anna; string ldap::Request::asString() const -throw() { +{ string result("ldap::Request { "); result += ClassCode::asString(a_classCode); return result += " }"; } xml::Node* ldap::Request::asXML(xml::Node* parent) const -throw() { +{ xml::Node* result = parent->createChild("ldap.Request"); result->createAttribute("ClassCode", ClassCode::asString(a_classCode)); return result; diff --git a/source/ldap/Response.cpp b/source/ldap/Response.cpp index 861cc6c..2fdbdcf 100644 --- a/source/ldap/Response.cpp +++ b/source/ldap/Response.cpp @@ -22,7 +22,7 @@ ldap::Response::response_pool ldap::Response::st_responses; // Se invocan desde ldap::Session //---------------------------------------------------------------------------------------- ldap::Response* ldap::Response::instance(const ClassCode::_v classCode, const IdMessage idMessage) -throw(RuntimeException) { +noexcept(false) { ldap::Response* result = st_responses.create(); result->a_classCode = classCode; result->a_idMessage = idMessage; @@ -36,7 +36,7 @@ throw(RuntimeException) { } void ldap::Response::release(ldap::Response* response) -throw() { +{ try { st_responses.release(response); } catch(Exception& ex) { @@ -53,7 +53,7 @@ ldap::Response::Response() : } void ldap::Response::clear() -throw() { +{ a_session = NULL; a_resultCode.clear(); a_name.clear(); @@ -68,12 +68,12 @@ throw() { } void ldap::Response::activateTimer() -throw(RuntimeException) { +noexcept(false) { a_timer = TimerManager::instantiate().createTimer(this); } void ldap::Response::cancelTimer() -throw() { +{ if(a_timer != NULL) { try { TimerManager::instantiate().cancel(a_timer); @@ -86,14 +86,14 @@ throw() { } ldap::Attribute* ldap::Response::createAttribute(const string& name) -throw(RuntimeException) { +noexcept(false) { Attribute* result = a_attributes.create(); result->setName(name); return result; } string ldap::Response::asString() const -throw() { +{ string result("ldap::Response { "); result += ClassCode::asString(a_classCode); result += functions::asText(" | IdMessage: ", a_idMessage); diff --git a/source/ldap/ResultCode.cpp b/source/ldap/ResultCode.cpp index 9c25486..c1311e4 100644 --- a/source/ldap/ResultCode.cpp +++ b/source/ldap/ResultCode.cpp @@ -18,7 +18,7 @@ using namespace std; #define DoErrorCode(methodName,macroName) \ bool anna::ldap::ResultCode::methodName () const \ - throw () \ + \ { \ return a_value == (macroName); \ } @@ -41,7 +41,7 @@ DoErrorCode(isConnectError, LDAP_CONNECT_ERROR) #define DoErrorRange(methodName,rangeName) \ bool anna::ldap::ResultCode::methodName () const \ - throw () \ + \ { \ return rangeName (a_value) != 0; \ } @@ -68,7 +68,7 @@ anna::ldap::ResultCode::ResultCode(const int ldap_method_result) : * que el método invicado devuelva 0, pero indique el código de error el extraError. */ anna::ldap::ResultCode& anna::ldap::ResultCode::operator= (const int ldap_method_result) -throw() { +{ if((a_value = ldap_method_result) != LDAP_SUCCESS) { const char* text = ldap_err2string(ldap_method_result); a_text = (text == NULL) ? "" : text; @@ -78,7 +78,7 @@ throw() { } void anna::ldap::ResultCode::setValue(const int ldap_method_result, const int ldap_method_error) -throw() { +{ if(ldap_method_result != LDAP_SUCCESS) operator= (ldap_method_result); else @@ -86,7 +86,7 @@ throw() { } const string anna::ldap::ResultCode::asString() const -throw() { +{ string result(functions::asText("ldap::ResultCode { Value: ", a_value)); if(a_text.empty() == false) { @@ -98,7 +98,7 @@ throw() { } bool anna::ldap::ResultCode::extractResultCode(const Session* session) -throw() { +{ LDAP* handle = (LDAP*)((Session*) session)->getLDAP(); int result = -1; diff --git a/source/ldap/Search.cpp b/source/ldap/Search.cpp index 2f2e063..b068f70 100644 --- a/source/ldap/Search.cpp +++ b/source/ldap/Search.cpp @@ -24,7 +24,7 @@ using namespace anna::ldap; Search::attribute_pool Search::st_attributes; void Search::clear() -throw() { +{ a_base.clear(); a_scope = Scope::Base; clearFilter(); @@ -34,7 +34,7 @@ throw() { } void Search::clearAttributes() -throw() { +{ for(attribute_iterator ii = attribute_begin(), maxii = attribute_end(); ii != maxii; ii ++) st_attributes.release(&attribute(ii)); @@ -42,7 +42,7 @@ throw() { } IdMessage Search::send(Session& session) const -throw() { +{ IdMessage result(-1); LDAP* ldap = (LDAP*) session.getLDAP(); int scope = -1; @@ -90,7 +90,7 @@ throw() { } string Search::asString() const -throw() { +{ string result("ldap::Search { "); result += Request::asString(); result += " | Base: "; @@ -105,7 +105,7 @@ throw() { } xml::Node* Search::asXML(xml::Node* parent) const -throw() { +{ parent = Request::asXML(parent); parent->createAttribute("Base", a_base); parent->createAttribute("Scope", Scope::asText(a_scope)); diff --git a/source/ldap/Session.cpp b/source/ldap/Session.cpp index 8507218..1d73e84 100644 --- a/source/ldap/Session.cpp +++ b/source/ldap/Session.cpp @@ -56,7 +56,7 @@ Session::Session() : // Se invoca desde el ldap::Engine //--------------------------------------------------------------------------------- void Session::bind() -throw(RuntimeException) { +noexcept(false) { if(a_state != State::Closed) return; @@ -138,7 +138,7 @@ throw(RuntimeException) { } const Response* Session::send(const Request* request) -throw(RuntimeException) { +noexcept(false) { if(a_state == State::Closed) { string msg(asString()); msg += " | Session::bind must be called"; @@ -174,7 +174,7 @@ throw(RuntimeException) { } void Session::unbind() -throw(RuntimeException) { +noexcept(false) { if(a_state == State::Closed) return; @@ -189,7 +189,7 @@ throw(RuntimeException) { // a la ldap::Session //------------------------------------------------------------------------------------------ void Session::apply() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod traceMethod("ldap::Session", "apply", ANNA_FILE_LOCATION)); LDAP* handle = (LDAP*) a_ldap; LDAPMessage* hmessage(NULL); @@ -263,7 +263,7 @@ throw(RuntimeException) { * invocado por el comm::Communicator::detach. */ void Session::finalize() -throw() { +{ LDAP* handle = (LDAP*) a_ldap; a_state = State::Closed; @@ -298,7 +298,7 @@ throw() { } void Session::receiveBind(const IdMessage idMessage, Session::HandleMessage _hmessage) -throw(RuntimeException) { +noexcept(false) { LDAP* handle = (LDAP*) a_ldap; LDAPMessage* hmessage = (LDAPMessage*) _hmessage; @@ -358,7 +358,7 @@ throw(RuntimeException) { // (1) Necesario para detectar el final de los atributos //------------------------------------------------------------------------------------------------ void Session::receiveEntry(const IdMessage idMessage, Session::HandleMessage _hmessage) -throw(RuntimeException) { +noexcept(false) { LDAP* handle = (LDAP*) a_ldap; LDAPMessage* hmessage = (LDAPMessage*) _hmessage; BerElement *ber(NULL); @@ -418,7 +418,7 @@ throw(RuntimeException) { } void Session::receiveReference(const IdMessage idMessage, Session::HandleMessage _hmessage) -throw(RuntimeException) { +noexcept(false) { LDAP* handle = (LDAP*) a_ldap; LDAPMessage* hmessage = (LDAPMessage*) _hmessage; char **values(NULL); @@ -447,7 +447,7 @@ throw(RuntimeException) { } void Session::receiveResult(const IdMessage idMessage, Session::HandleMessage _hmessage) -throw(RuntimeException) { +noexcept(false) { LDAP* handle = (LDAP*) a_ldap; LDAPMessage* hmessage = (LDAPMessage*) _hmessage; Response* response = response_find(idMessage); @@ -498,7 +498,7 @@ throw(RuntimeException) { // Se invoca desde ldap::timer::Prototype::expire //------------------------------------------------------------------------- void Session::expireResponse(ldap::Response* response) -throw() { +{ LDAP* handle = (LDAP*) a_ldap; ResultCode resultCode; /* @@ -535,7 +535,7 @@ throw() { } void Session::response_add(Response* response) -throw() { +{ a_responses.add(response); response->setSession(this); @@ -547,13 +547,13 @@ throw() { } void Session::response_erase(Response* response) -throw() { +{ a_responses.erase(response); Response::release(response); } Response* Session::response_find(const IdMessage idMessage) -throw(RuntimeException) { +noexcept(false) { ldap::Response* result = a_responses.find(idMessage); if(result == NULL) { @@ -567,7 +567,7 @@ throw(RuntimeException) { } std::string Session::asString() const -throw() { +{ string result("ldap::Session { "); result += comm::Handler::asString(); result += " | State: "; @@ -590,7 +590,7 @@ throw() { } xml::Node* Session::asXML(xml::Node* parent) const -throw() { +{ parent = comm::Handler::asXML(parent); xml::Node* result = parent->createChild("ldap.Session"); result->createAttribute("State", asText(a_state)); @@ -616,7 +616,7 @@ throw() { } int Session::getDangerousFileDescriptor() const -throw(RuntimeException) { +noexcept(false) { ResultCode resultCode; int result = -1; resultCode = ldap_get_option((LDAP*) a_ldap, LDAP_OPT_DESC, &result); @@ -633,12 +633,12 @@ throw(RuntimeException) { } const char* Session::asText(const State::_v state) -throw() { +{ static const char* states [] = { "Closed", "WaitingBind", "Bound" }; return states [state]; } IdMessage Session::SortById::value(const Response* response) -throw() { +{ return response->getIdMessage(); } diff --git a/source/ldap/TimerManager.cpp b/source/ldap/TimerManager.cpp index e3cbd54..6bb6119 100644 --- a/source/ldap/TimerManager.cpp +++ b/source/ldap/TimerManager.cpp @@ -30,7 +30,7 @@ ldap::TimerManager::TimerManager() : // seccion critica, lo que evita interbloqueos. //------------------------------------------------------------------------------------------------------- ldap::Timer* ldap::TimerManager::createTimer(Response* response) -throw(RuntimeException) { +noexcept(false) { Timer* result(NULL); if(a_timeController == NULL) @@ -53,7 +53,7 @@ throw(RuntimeException) { } void ldap::TimerManager::cancel(ldap::Timer* timer) -throw() { +{ if(timer == NULL) return; @@ -77,7 +77,7 @@ throw() { // Se invoca automaticamente desde timex::Engine //------------------------------------------------------------------------------------------ void ldap::TimerManager::release(timex::TimeEvent* timeEvent) -throw() { +{ Timer* timer = static_cast (timeEvent); timer->setResponse(NULL); a_timers.release(timer); diff --git a/source/ldap/internal/Timer.cpp b/source/ldap/internal/Timer.cpp index 230e41e..c685d38 100644 --- a/source/ldap/internal/Timer.cpp +++ b/source/ldap/internal/Timer.cpp @@ -17,7 +17,7 @@ using namespace std; using namespace anna; void ldap::Timer::expire(timex::Engine*) -throw(RuntimeException) { +noexcept(false) { Response* response = getResponse(); Session* session = response->getSession(); Guard guard(session, "anna::ldap::Timer::expire"); @@ -30,7 +30,7 @@ throw(RuntimeException) { } string ldap::Timer::asString() const -throw() { +{ const Response* response = getResponse(); string result("anna::ldap::Timer { "); result += timex::Transaction::asString(); diff --git a/source/ldap/internal/sccs.cpp b/source/ldap/internal/sccs.cpp index 6388a18..246ae4b 100644 --- a/source/ldap/internal/sccs.cpp +++ b/source/ldap/internal/sccs.cpp @@ -15,7 +15,7 @@ anna_define_sccs_tag(ldap, 16) void anna::ldap::sccs::activate() -throw() { +{ anna::sccs::activate(); anna::timex::sccs::activate(); ModuleManager::instantiate().insert(anna_use_sccs_tag(ldap), "00"); diff --git a/source/statistics/Accumulator.cpp b/source/statistics/Accumulator.cpp index 255489c..75eb76c 100644 --- a/source/statistics/Accumulator.cpp +++ b/source/statistics/Accumulator.cpp @@ -38,7 +38,7 @@ using namespace anna::time; //------------------------------------------------------------------------------ //---------------------------------------------------- Accumulator::initialize() //------------------------------------------------------------------------------ -void Accumulator::initialize(const int & conceptId) throw() { +void Accumulator::initialize(const int & conceptId) { _concept_data_t conceptData; conceptData.reset(); a_concept_data_map[conceptId] = conceptData; @@ -48,7 +48,7 @@ void Accumulator::initialize(const int & conceptId) throw() { //------------------------------------------------------------------------------ //---------------------------------------------------- Accumulator::addConcept() //------------------------------------------------------------------------------ -int Accumulator::addConcept(const std::string & description, const std::string & unit, const bool & integerNatureSample, const char *conceptNameFormat) throw() { +int Accumulator::addConcept(const std::string & description, const std::string & unit, const bool & integerNatureSample, const char *conceptNameFormat) { std::string conceptName = anna::functions::asString(conceptNameFormat, description.c_str(), a_name.c_str()); return anna::statistics::Engine::instantiate().addConcept(conceptName, unit, integerNatureSample); } @@ -57,7 +57,7 @@ int Accumulator::addConcept(const std::string & description, const std::string & //------------------------------------------------------------------------------ //---------------------------------------------------- Accumulator::getConcept() //------------------------------------------------------------------------------ -_concept_data_t *Accumulator::getConcept(const int & conceptId) const throw(anna::RuntimeException) { +_concept_data_t *Accumulator::getConcept(const int & conceptId) const noexcept(false) { _concept_data_map_iter it = a_concept_data_map.find(conceptId); if(it == a_concept_data_map.end()) { // not found @@ -84,7 +84,7 @@ _concept_data_t *Accumulator::getConcept(const int & conceptId) const throw(anna //------------------------------------------------------------------------------ //--------------------------------------------------- Accumulator::floatFormat() //------------------------------------------------------------------------------ -std::string Accumulator::floatFormat(const int & numberOfDecimals) const throw() { +std::string Accumulator::floatFormat(const int & numberOfDecimals) const { std::string result = "%."; result += anna::functions::asString(numberOfDecimals); result += "f"; @@ -95,7 +95,7 @@ std::string Accumulator::floatFormat(const int & numberOfDecimals) const throw() //------------------------------------------------------------------------------ //------------------------------------------ Accumulator::getStandardDeviation() //------------------------------------------------------------------------------ -double Accumulator::getStandardDeviation(const _concept_data_t * conceptData) const throw(anna::RuntimeException) { +double Accumulator::getStandardDeviation(const _concept_data_t * conceptData) const noexcept(false) { // SD = sqrt (1/N SUM (xi^2) - X^2) = sqrt (SquareSum / N - Average^2) if(conceptData->Size == 0) throw anna::RuntimeException("Divide by zero: sample size = 0 for Standard Deviation !!", ANNA_FILE_LOCATION); @@ -107,7 +107,7 @@ double Accumulator::getStandardDeviation(const _concept_data_t * conceptData) co //------------------------------------------------------------------------------ //------------------------------------ Accumulator::getBesselStandardDeviation() //------------------------------------------------------------------------------ -double Accumulator::getBesselStandardDeviation(const _concept_data_t * conceptData) const throw(anna::RuntimeException) { +double Accumulator::getBesselStandardDeviation(const _concept_data_t * conceptData) const noexcept(false) { // BSD = sqrt (1/(N-1) SUM (xi^2) - N/(N-1) X^2) = sqrt (SquareSum / (N-1) - N/(N-1) Average^2) if(conceptData->Size == 1) throw anna::RuntimeException("Divide by zero: sample size = 1 for bessel's Standard Deviation !!", ANNA_FILE_LOCATION); @@ -124,7 +124,7 @@ double Accumulator::getBesselStandardDeviation(const _concept_data_t * conceptDa //------------------------------------------------------------------------------ //------------------------------------------------------- Accumulator::process() //------------------------------------------------------------------------------ -void Accumulator::process(const int & conceptId, const double & value) throw(anna::RuntimeException) { +void Accumulator::process(const int & conceptId, const double & value) noexcept(false) { // LOGMETHOD (TraceMethod tttm ("anna::statistics::Accumulator", "process", ANNA_FILE_LOCATION)); Engine& engine = Engine::instantiate(); @@ -195,7 +195,7 @@ const Accumulator & Accumulator::operator = (const Accumulator & accumulator) { //------------------------------------------------------------------------------ //--------------------------------------------------------- Accumulator::reset() //------------------------------------------------------------------------------ -void Accumulator::reset(void) throw() { +void Accumulator::reset(void) { // LOGMETHOD (TraceMethod tttm ("anna::statistics::Accumulator", "reset", ANNA_FILE_LOCATION)); _concept_data_map_iter it; _concept_data_map_iter it_min(a_concept_data_map.begin()); @@ -212,7 +212,7 @@ void Accumulator::reset(void) throw() { //------------------------------------------------------------------------------ //--------------------------------------------------------- Accumulator::reset() //------------------------------------------------------------------------------ -void Accumulator::reset(const int & conceptId) throw(anna::RuntimeException) { +void Accumulator::reset(const int & conceptId) noexcept(false) { // LOGMETHOD (TraceMethod tttm ("anna::statistics::Accumulator", "reset", ANNA_FILE_LOCATION)); _concept_data_t *ptr_auxConceptData = getConcept(conceptId); // will initialize if didn't associated to this accumulator, // exception if engine knows nothing about such concept id. @@ -227,7 +227,7 @@ void Accumulator::reset(const int & conceptId) throw(anna::RuntimeException) { //------------------------------------------------------------------------------ //---------------------------------------------------- Accumulator::sampleSize() //------------------------------------------------------------------------------ -unsigned long long int Accumulator::sampleSize(const int & conceptId) const throw(anna::RuntimeException) { +unsigned long long int Accumulator::sampleSize(const int & conceptId) const noexcept(false) { // LOGMETHOD (TraceMethod tttm ("anna::statistics::Accumulator", "sampleSize", ANNA_FILE_LOCATION)); _concept_data_t *ptr_auxConceptData = getConcept(conceptId); //if (ptr_auxConceptData == NULL) return 0; // Not possible: getConcept initializes it if not found. @@ -238,7 +238,7 @@ unsigned long long int Accumulator::sampleSize(const int & conceptId) const thro //------------------------------------------------------------------------------ //------------------------------------------------------ Accumulator::getValue() //------------------------------------------------------------------------------ -double Accumulator::getValue(const int & conceptId, const Operation::Type & operation) const throw(anna::RuntimeException) { +double Accumulator::getValue(const int & conceptId, const Operation::Type & operation) const noexcept(false) { // LOGMETHOD (TraceMethod tttm ("anna::statistics::Accumulator", "getValue", ANNA_FILE_LOCATION)); const _concept_data_t *ptr_auxConceptData = getConcept(conceptId); @@ -266,7 +266,7 @@ double Accumulator::getValue(const int & conceptId, const Operation::Type & oper //------------------------------------------------------------------------------ //------------------------------------------------------ Accumulator::asString() //------------------------------------------------------------------------------ -std::string Accumulator::asString(const int & numberOfDecimals) const throw() { +std::string Accumulator::asString(const int & numberOfDecimals) const { std::string trace; _concept_data_map_iter iter; _concept_data_map_iter iter_min(a_concept_data_map.begin()); @@ -360,7 +360,7 @@ std::string Accumulator::asString(const int & numberOfDecimals) const throw() { //------------------------------------------------------------------------------ //--------------------------------------------------------- Accumulator::asXML() //------------------------------------------------------------------------------ -anna::xml::Node* Accumulator::asXML(anna::xml::Node* parent, const int & numberOfDecimals) const throw() { +anna::xml::Node* Accumulator::asXML(anna::xml::Node* parent, const int & numberOfDecimals) const { anna::xml::Node* result = parent->createChild("anna.statistics.Accumulator"); result->createAttribute("Name", a_name); _concept_data_map_iter iter; diff --git a/source/statistics/Engine.cpp b/source/statistics/Engine.cpp index 622e58c..5417e4e 100644 --- a/source/statistics/Engine.cpp +++ b/source/statistics/Engine.cpp @@ -47,7 +47,7 @@ Engine::~Engine() { //------------------------------------------------------------------------------ //--------------------------------------------------------- Engine::addConcept() //------------------------------------------------------------------------------ -int Engine::addConcept(const std::string & description, const std::string & unit, const bool & integerNatureSample) throw() { +int Engine::addConcept(const std::string & description, const std::string & unit, const bool & integerNatureSample) { a_sequence_concept_id++; _concept_identification_t aux; aux.SampleFile = ""; // sample dump disabled by default for new concepts @@ -62,7 +62,7 @@ int Engine::addConcept(const std::string & description, const std::string & unit //------------------------------------------------------------------------------ //--------------------------------------------------------- Engine::getConcept() //------------------------------------------------------------------------------ -bool Engine::getConcept(const int & id, std::string & description, std::string & unit, bool & integerNatureSample) const throw() { +bool Engine::getConcept(const int & id, std::string & description, std::string & unit, bool & integerNatureSample) const { _concept_identification_map_iter it = a_concept_identification_map.find(id); if(it == a_concept_identification_map.end()) return false; @@ -77,7 +77,7 @@ bool Engine::getConcept(const int & id, std::string & description, std::string & //------------------------------------------------------------------------------ //---------------------------------------------------- Engine::enableSampleLog() //------------------------------------------------------------------------------ -bool Engine::enableSampleLog(const int & id, const char *sampleFileName) throw() { +bool Engine::enableSampleLog(const int & id, const char *sampleFileName) { _concept_identification_map_nc_iter it; std::string providedName = sampleFileName ? sampleFileName : "sample"; std::string *SampleFile_ptr; @@ -113,7 +113,7 @@ bool Engine::enableSampleLog(const int & id, const char *sampleFileName) throw() //------------------------------------------------------------------------------ //--------------------------------------------------- Engine::disableSampleLog() //------------------------------------------------------------------------------ -bool Engine::disableSampleLog(const int & id) throw() { +bool Engine::disableSampleLog(const int & id) { if(id != -1) { _concept_identification_map_nc_iter it = a_concept_identification_map.find(id); @@ -134,7 +134,7 @@ bool Engine::disableSampleLog(const int & id) throw() { //------------------------------------------------------------------------------ //--------------------------------------------------- Engine::disableSampleLog() //------------------------------------------------------------------------------ -bool Engine::logSample(const int & conceptId, const anna::Millisecond & unixTimestamp, const double & value) const throw() { +bool Engine::logSample(const int & conceptId, const anna::Millisecond & unixTimestamp, const double & value) const { anna::Guard guard(a_mutex); _concept_identification_map_iter it = a_concept_identification_map.find(conceptId); @@ -161,7 +161,7 @@ bool Engine::logSample(const int & conceptId, const anna::Millisecond & unixTime //------------------------------------------------------------------------------ //-------------------------------------------------- Engine::createAccumulator() //------------------------------------------------------------------------------ -Accumulator *Engine::createAccumulator(const std::string &name) throw(anna::RuntimeException) { +Accumulator *Engine::createAccumulator(const std::string &name) noexcept(false) { Accumulator *result = getAccumulator(name); if (result) @@ -172,7 +172,7 @@ Accumulator *Engine::createAccumulator(const std::string &name) throw(anna::Runt return result; } -Accumulator* Engine::getAccumulator(const std::string &name) throw() { +Accumulator* Engine::getAccumulator(const std::string &name) { Accumulator *result = NULL; _accumulator_map_nc_it it = a_accumulators.find(name); @@ -186,7 +186,7 @@ Accumulator* Engine::getAccumulator(const std::string &name) throw() { //------------------------------------------------------------------------------ //----------------------------------------------------------- Engine::asString() //------------------------------------------------------------------------------ -std::string Engine::asString(void) const throw() { +std::string Engine::asString(void) const { std::string trace; _concept_identification_map_iter iter; _concept_identification_map_iter iter_min(a_concept_identification_map.begin()); @@ -232,7 +232,7 @@ std::string Engine::asString(void) const throw() { //------------------------------------------------------------------------------ //-------------------------------------------------------------- Engine::asXML() //------------------------------------------------------------------------------ -anna::xml::Node* Engine::asXML(anna::xml::Node* parent, const int & numberOfDecimals) const throw() { +anna::xml::Node* Engine::asXML(anna::xml::Node* parent, const int & numberOfDecimals) const { anna::xml::Node* result = parent->createChild("anna.statistics.Engine"); _concept_identification_map_iter iter; _concept_identification_map_iter iter_min(a_concept_identification_map.begin()); diff --git a/source/statistics/Meter.cpp b/source/statistics/Meter.cpp index bf4c3f8..3058ebc 100644 --- a/source/statistics/Meter.cpp +++ b/source/statistics/Meter.cpp @@ -57,7 +57,7 @@ const Meter & Meter::operator = (const Meter & meter) { //------------------------------------------------------------------------------ //------------------------------------------------------------ Meter::asString() //------------------------------------------------------------------------------ -std::string Meter::asString(const int & numberOfDecimals) const throw() { +std::string Meter::asString(const int & numberOfDecimals) const { std::string trace; trace = "\n====="; trace += "\nMeter"; @@ -70,7 +70,7 @@ std::string Meter::asString(const int & numberOfDecimals) const throw() { //------------------------------------------------------------------------------ //--------------------------------------------------------------- Meter::asXML() //------------------------------------------------------------------------------ -anna::xml::Node* Meter::asXML(anna::xml::Node* parent, const int & numberOfDecimals) const throw() { +anna::xml::Node* Meter::asXML(anna::xml::Node* parent, const int & numberOfDecimals) const { anna::xml::Node* result = parent->createChild("anna.statistics.Meter"); return (a_accumulator.asXML(result, numberOfDecimals)); } diff --git a/source/statistics/internal/sccs.cpp b/source/statistics/internal/sccs.cpp index ef8e6db..abe0f16 100644 --- a/source/statistics/internal/sccs.cpp +++ b/source/statistics/internal/sccs.cpp @@ -14,7 +14,7 @@ anna_define_sccs_tag(statistics, 1) void anna::statistics::sccs::activate() -throw() { +{ //anna::sccs::activate() anna::ModuleManager::instantiate().insert(anna_use_sccs_tag(statistics), 0); } diff --git a/source/test/Communicator.cpp b/source/test/Communicator.cpp index fce8835..e19064c 100644 --- a/source/test/Communicator.cpp +++ b/source/test/Communicator.cpp @@ -21,7 +21,7 @@ using namespace std; using namespace anna; bool test::Communicator::canContinue (const comm::ClientSocket& clientSocket) - throw (RuntimeException) + noexcept(false) { Guard guard (this, "test::Communicator::canContinue"); @@ -49,7 +49,7 @@ bool test::Communicator::canContinue (const comm::ClientSocket& clientSocket) } void test::Communicator::delay () - throw (RuntimeException) + noexcept(false) { if (a_delay > 0) { int random = (a_delay > 10) ? (rand () % (a_delay / 10)): 0; @@ -70,7 +70,7 @@ void test::Communicator::delay () } void test::Communicator::terminate () - throw () + { if (hasRequestedStop () == true) return; @@ -100,7 +100,7 @@ void test::Communicator::terminate () // si es asi termina //---------------------------------------------------------------------------------------- void test::Communicator::eventOverQuota (const comm::ClientSocket&) - throw () + { int counter = 0; diff --git a/source/test/Control.cpp b/source/test/Control.cpp index d5c78e4..6daab72 100644 --- a/source/test/Control.cpp +++ b/source/test/Control.cpp @@ -40,7 +40,7 @@ test::Control::Control (comm::Communicator* engine) : {;} bool test::Control::canContinue (const comm::socket::Client&) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod ttmm (Logger::Local7, "test::Control::canContinue", ANNA_FILE_LOCATION)); @@ -60,7 +60,7 @@ bool test::Control::canContinue (const comm::socket::Client&) } void test::Control::delay () - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod ttmm (Logger::Local7, "test::Control::delay", ANNA_FILE_LOCATION)); @@ -88,7 +88,7 @@ void test::Control::delay () // Aproximación del valor que lleva en mensaje en cola I/O Millisecond test::Control::latency (const Millisecond& init) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod ttmm (Logger::Local7, "test::Control::latency", ANNA_FILE_LOCATION)); @@ -105,7 +105,7 @@ Millisecond test::Control::latency (const Millisecond& init) } void test::Control::report () - throw () + { const Millisecond serviceTime = anna::Millisecond::getTime () - a_initTime; @@ -131,7 +131,7 @@ void test::Control::report () } void test::Control::stop () - throw (RuntimeException) + noexcept(false) { if (a_engine.hasRequestedStop () == true) return; @@ -141,7 +141,7 @@ void test::Control::stop () } xml::Node* test::Control::asXML (xml::Node* parent) - throw () + { xml::Node* result = parent->createChild ("test.Control"); diff --git a/source/test/Menu.cpp b/source/test/Menu.cpp index 8a0ebf8..88af5d7 100644 --- a/source/test/Menu.cpp +++ b/source/test/Menu.cpp @@ -26,7 +26,7 @@ test::Menu::Menu (Communicator* communicator) : } void test::Menu::paint () const - throw () + { switch (a_status) { case 0: @@ -42,7 +42,7 @@ void test::Menu::paint () const } void test::Menu::apply () - throw (RuntimeException) + noexcept(false) { switch (a_status) { case 0: diff --git a/source/testing/TestCase.cpp b/source/testing/TestCase.cpp index 8c38d06..991a254 100644 --- a/source/testing/TestCase.cpp +++ b/source/testing/TestCase.cpp @@ -33,18 +33,18 @@ using namespace anna::testing; /////////////////////////////////////////////////////////////////////////////////////////////////// -void TestCase::DebugSummary::addHint(const std::string &hint) throw() { +void TestCase::DebugSummary::addHint(const std::string &hint) { event_t event; event.Timestamp = anna::functions::millisecond(); event.Hint = hint; a_events.push_back(event); } -void TestCase::DebugSummary::clear() throw() { +void TestCase::DebugSummary::clear() { a_events.clear(); } -anna::xml::Node* TestCase::DebugSummary::asXML(anna::xml::Node* parent) const throw() { +anna::xml::Node* TestCase::DebugSummary::asXML(anna::xml::Node* parent) const { anna::xml::Node* result = parent->createChild("DebugSummary"); std::vector::const_iterator it; @@ -57,7 +57,7 @@ anna::xml::Node* TestCase::DebugSummary::asXML(anna::xml::Node* parent) const th return result; }; -std::string TestCase::DebugSummary::asString() const throw() { +std::string TestCase::DebugSummary::asString() const { std::string result = ""; std::vector::const_iterator it; @@ -93,17 +93,17 @@ TestCase::~TestCase() { const char* TestCase::asText(const State::_v state) -throw() { +{ static const char* text [] = { "Initialized", "InProgress", "Failed", "Success" }; return text [state]; } -anna::Millisecond TestCase::getLapseMs() const throw() { +anna::Millisecond TestCase::getLapseMs() const { return ((a_finishTimestamp >= a_startTimestamp) ? (a_finishTimestamp - a_startTimestamp) : (anna::Millisecond)0); } anna::xml::Node* TestCase::asXML(anna::xml::Node* parent) const -throw() { +{ anna::xml::Node* result = parent->createChild("TestCase"); result->createAttribute("Id", a_id); @@ -134,12 +134,12 @@ throw() { return result; } -std::string TestCase::asXMLString() const throw() { +std::string TestCase::asXMLString() const { anna::xml::Node root("root"); return anna::xml::Compiler().apply(asXML(&root)); } -bool TestCase::hasSameCondition(const TestDiameterCondition &condition) const throw() { +bool TestCase::hasSameCondition(const TestDiameterCondition &condition) const { std::vector::const_iterator it; TestStepWaitDiameter *step; for (it = a_steps.begin(); it != a_steps.end(); it++) { @@ -151,7 +151,7 @@ bool TestCase::hasSameCondition(const TestDiameterCondition &condition) const th } -void TestCase::setState(const State::_v &state) throw() { +void TestCase::setState(const State::_v &state) { State::_v previousState = a_state; if (state == previousState) return; @@ -215,7 +215,7 @@ void TestCase::setState(const State::_v &state) throw() { } } -bool TestCase::done() throw() { +bool TestCase::done() { if (a_stepsIt == a_steps.end()) { setState(State::Success); return true; @@ -224,7 +224,7 @@ bool TestCase::done() throw() { return false; } -bool TestCase::process() throw() { +bool TestCase::process() { if (steps() == 0) { LOGWARNING(anna::Logger::warning(anna::functions::asString("Test case %llu (%s) is empty, nothing to execute", a_id, a_description.c_str()), ANNA_FILE_LOCATION)); return false; @@ -264,7 +264,7 @@ bool TestCase::process() throw() { return somethingDone; } -bool TestCase::reset(bool hard) throw() { +bool TestCase::reset(bool hard) { // Soft reset if finished: if (!hard /* is soft reset */ && !isFinished()) return false; @@ -306,12 +306,12 @@ bool TestCase::safeToClear() { return true; } -void TestCase::assertInitialized() const throw(anna::RuntimeException) { +void TestCase::assertInitialized() const noexcept(false) { if (isFinished()) throw anna::RuntimeException(anna::functions::asString("Cannot program anymore. The test case %llu (%s) has finished. You must reset it to append new steps (or do it during execution, which is also allowed).", a_id, a_description.c_str()), ANNA_FILE_LOCATION); } -void TestCase::assertMessage(const anna::DataBlock &db, bool toEntity) throw(anna::RuntimeException) { +void TestCase::assertMessage(const anna::DataBlock &db, bool toEntity) noexcept(false) { bool isRequest = anna::diameter::codec::functions::isRequest(db); bool registerKeys = ((isRequest && toEntity) || (!isRequest && !toEntity) /* (*) */); @@ -342,14 +342,14 @@ void TestCase::assertMessage(const anna::DataBlock &db, bool toEntity) throw(ann } } -void TestCase::addTimeout(const anna::Millisecond &timeout) throw(anna::RuntimeException) { +void TestCase::addTimeout(const anna::Millisecond &timeout) noexcept(false) { assertInitialized(); TestStepTimeout *step = new TestStepTimeout(this); step->setTimeout(timeout); addStep(step); } -void TestCase::addSendDiameterXml2e(const anna::DataBlock &db, anna::diameter::comm::OriginHost *host, int stepNumber) throw(anna::RuntimeException) { +void TestCase::addSendDiameterXml2e(const anna::DataBlock &db, anna::diameter::comm::OriginHost *host, int stepNumber) noexcept(false) { assertInitialized(); assertMessage(db, true /* to entity */); @@ -374,7 +374,7 @@ void TestCase::addSendDiameterXml2e(const anna::DataBlock &db, anna::diameter::c addStep(step); } -void TestCase::addSendDiameterXml2c(const anna::DataBlock &db, anna::diameter::comm::OriginHost *host, int stepNumber) throw(anna::RuntimeException) { +void TestCase::addSendDiameterXml2c(const anna::DataBlock &db, anna::diameter::comm::OriginHost *host, int stepNumber) noexcept(false) { assertInitialized(); assertMessage(db, false /* to client */); @@ -399,7 +399,7 @@ void TestCase::addSendDiameterXml2c(const anna::DataBlock &db, anna::diameter::c addStep(step); } -void TestCase::addDelay(const anna::Millisecond &delay) throw(anna::RuntimeException) { +void TestCase::addDelay(const anna::Millisecond &delay) noexcept(false) { assertInitialized(); TestStepDelay *step = new TestStepDelay(this); step->setDelay(delay); @@ -409,7 +409,7 @@ void TestCase::addDelay(const anna::Millisecond &delay) throw(anna::RuntimeExcep void TestCase::addWaitDiameter(bool fromEntity, const std::string &code, const std::string &bitR, const std::string &hopByHop, const std::string &applicationId, const std::string &sessionId, const std::string &resultCode, - const std::string &msisdn, const std::string &imsi, const std::string &serviceContextId) throw(anna::RuntimeException) { + const std::string &msisdn, const std::string &imsi, const std::string &serviceContextId) noexcept(false) { assertInitialized(); std::string usedHopByHop = hopByHop; TestStepWaitDiameter *step = NULL; @@ -461,7 +461,7 @@ void TestCase::addWaitDiameter(bool fromEntity, addStep(step); } -void TestCase::addWaitDiameterRegexpHex(bool fromEntity, const std::string ®exp) throw(anna::RuntimeException) { +void TestCase::addWaitDiameterRegexpHex(bool fromEntity, const std::string ®exp) noexcept(false) { assertInitialized(); TestStepWaitDiameter *step = new TestStepWaitDiameter(this); @@ -475,7 +475,7 @@ void TestCase::addWaitDiameterRegexpHex(bool fromEntity, const std::string ®e addStep(step); } -void TestCase::addWaitDiameterRegexpXml(bool fromEntity, const std::string ®exp) throw(anna::RuntimeException) { +void TestCase::addWaitDiameterRegexpXml(bool fromEntity, const std::string ®exp) noexcept(false) { assertInitialized(); TestStepWaitDiameter *step = new TestStepWaitDiameter(this); @@ -489,7 +489,7 @@ void TestCase::addWaitDiameterRegexpXml(bool fromEntity, const std::string ®e addStep(step); } -void TestCase::addCommand(const std::string &cmd) throw(anna::RuntimeException) { +void TestCase::addCommand(const std::string &cmd) noexcept(false) { assertInitialized(); TestStepCmd *step = new TestStepCmd(this); @@ -498,7 +498,7 @@ void TestCase::addCommand(const std::string &cmd) throw(anna::RuntimeException) addStep(step); } -void TestCase::addIpLimit(unsigned int ipLimit) throw(anna::RuntimeException) { +void TestCase::addIpLimit(unsigned int ipLimit) noexcept(false) { assertInitialized(); TestStepIpLimit *step = new TestStepIpLimit(this); @@ -507,7 +507,7 @@ void TestCase::addIpLimit(unsigned int ipLimit) throw(anna::RuntimeException) { addStep(step); } -TestStepWaitDiameter *TestCase::searchNextWaitConditionFulfilled(const anna::DataBlock &message, bool waitFromEntity) throw() { +TestStepWaitDiameter *TestCase::searchNextWaitConditionFulfilled(const anna::DataBlock &message, bool waitFromEntity) { TestStepWaitDiameter *result; for (std::vector::const_iterator it = a_stepsIt /* current */; it != a_steps.end(); it++) { @@ -521,7 +521,7 @@ TestStepWaitDiameter *TestCase::searchNextWaitConditionFulfilled(const anna::Dat return NULL; } -const TestStep *TestCase::getStep(int stepNumber) const throw() { +const TestStep *TestCase::getStep(int stepNumber) const { if (stepNumber < 1 || stepNumber > steps()) return NULL; // return a_steps.at(stepNumber-1); // http://stackoverflow.com/questions/3269809/stdvectorat-vs-operator-surprising-results-5-to-10-times-slower-f return a_steps[stepNumber-1]; diff --git a/source/testing/TestClock.cpp b/source/testing/TestClock.cpp index d949983..4fe87a4 100644 --- a/source/testing/TestClock.cpp +++ b/source/testing/TestClock.cpp @@ -14,7 +14,7 @@ #include -bool anna::testing::TestClock::tick() throw(anna::RuntimeException) { +bool anna::testing::TestClock::tick() noexcept(false) { return a_manager->tick(); } diff --git a/source/testing/TestCondition.cpp b/source/testing/TestCondition.cpp index 416b893..e82e52e 100644 --- a/source/testing/TestCondition.cpp +++ b/source/testing/TestCondition.cpp @@ -29,18 +29,18 @@ using namespace anna::testing; const char* TestDiameterCondition::asText(const Type::_v type) -throw() { +{ static const char* text [] = { "RegexpXml", "RegexpHex", "Fields" }; return text [type]; } -bool TestDiameterCondition::exists() const throw() { +bool TestDiameterCondition::exists() const { if (a_type != Type::Fields) return (getRegexp() != ""); return (a_code != "" || a_bitR != "" || a_hopByHop != "" || a_applicationId != "" || a_sessionId != "" || a_resultCode != "" || a_msisdn != "" || a_imsi != "" || a_serviceContextId != ""); } -bool TestDiameterCondition::comply(const anna::DataBlock &message) const throw() { +bool TestDiameterCondition::comply(const anna::DataBlock &message) const { if (a_type == Type::RegexpXml) { anna::diameter::codec::Message codecMsg; @@ -138,7 +138,7 @@ bool TestDiameterCondition::comply(const anna::DataBlock &message) const throw() } anna::xml::Node* TestDiameterCondition::asXML(anna::xml::Node* parent) const -throw() { +{ anna::xml::Node* result = parent->createChild("TestDiameterCondition"); if (!exists()) return result; diff --git a/source/testing/TestManager.cpp b/source/testing/TestManager.cpp index 8b72efa..87278f1 100644 --- a/source/testing/TestManager.cpp +++ b/source/testing/TestManager.cpp @@ -35,7 +35,7 @@ using namespace anna::testing; /////////////////////////////////////////////////////////////////////////////////////////////////// -void TestManager::StatSummary::newTCState(const TestCase::State::_v beginState, const TestCase::State::_v endState) throw() { +void TestManager::StatSummary::newTCState(const TestCase::State::_v beginState, const TestCase::State::_v endState) { if ((beginState == TestCase::State::Initialized)&&(endState == TestCase::State::Initialized)) { // special case (new test case provisioning) a_initializedTcs++; @@ -58,14 +58,14 @@ void TestManager::StatSummary::newTCState(const TestCase::State::_v beginState, } } -void TestManager::StatSummary::clear() throw() { +void TestManager::StatSummary::clear() { a_initializedTcs = 0; a_inprogressTcs = 0; a_failedTcs = 0; a_sucessTcs = 0; } -anna::xml::Node *TestManager::StatSummary::asXML(anna::xml::Node* parent) const throw() { +anna::xml::Node *TestManager::StatSummary::asXML(anna::xml::Node* parent) const { anna::xml::Node* result = parent->createChild("StatSummary"); anna::xml::Node* tcs = result->createChild("TestCasesCounts"); @@ -106,7 +106,7 @@ TestManager::TestManager() : a_currentTestIt = a_testPool.end(); } -void TestManager::registerKey1(const std::string &key, const TestCase *testCase) throw(anna::RuntimeException) { +void TestManager::registerKey1(const std::string &key, const TestCase *testCase) noexcept(false) { auto it = a_key1TestCaseMap.find(key); if (it != a_key1TestCaseMap.end()) { // found @@ -121,7 +121,7 @@ void TestManager::registerKey1(const std::string &key, const TestCase *testCase) } } -void TestManager::registerKey2(const std::string &key, const TestCase *testCase) throw(anna::RuntimeException) { +void TestManager::registerKey2(const std::string &key, const TestCase *testCase) noexcept(false) { auto it = a_key2TestCaseMap.find(key); if (it != a_key2TestCaseMap.end()) { // found @@ -137,7 +137,7 @@ void TestManager::registerKey2(const std::string &key, const TestCase *testCase) } TestTimer* TestManager::createTimer(TestCaseStep* testCaseStep, const anna::Millisecond &timeout, const TestTimer::Type::_v type) -throw(anna::RuntimeException) { +noexcept(false) { TestTimer* result(NULL); if(a_timeController == NULL) @@ -162,7 +162,7 @@ throw(anna::RuntimeException) { } void TestManager::cancelTimer(TestTimer* timer) -throw() { +{ if(timer == NULL) return; @@ -186,13 +186,13 @@ throw() { // Se invoca automaticamente desde anna::timex::Engine //------------------------------------------------------------------------------------------ void TestManager::release(anna::timex::TimeEvent* timeEvent) -throw() { +{ TestTimer* timer = static_cast (timeEvent); timer->setContext(NULL); a_timers.release(timer); } -bool TestManager::configureTTPS(int testTicksPerSecond) throw() { +bool TestManager::configureTTPS(int testTicksPerSecond) { if (testTicksPerSecond == 0) { if (a_clock) { @@ -250,7 +250,7 @@ bool TestManager::configureTTPS(int testTicksPerSecond) throw() { return true; } -bool TestManager::gotoTestCase(unsigned int id) throw() { +bool TestManager::gotoTestCase(unsigned int id) { test_pool_it it = a_testPool.find(id); if (it != a_testPool.end()) { a_currentTestIt = it; @@ -260,7 +260,7 @@ bool TestManager::gotoTestCase(unsigned int id) throw() { return false; } -bool TestManager::runTestCase(unsigned int id) throw() { +bool TestManager::runTestCase(unsigned int id) { test_pool_it it = a_testPool.find(id); if (it != a_testPool.end()) { a_currentTestIt = it; @@ -277,7 +277,7 @@ bool TestManager::runTestCase(unsigned int id) throw() { return false; } -TestCase *TestManager::findTestCase(unsigned int id) const throw() { // id = -1 provides current test case triggered +TestCase *TestManager::findTestCase(unsigned int id) const { // id = -1 provides current test case triggered if (!tests()) return NULL; test_pool_it it = ((id != -1) ? a_testPool.find(id) : a_currentTestIt); @@ -285,7 +285,7 @@ TestCase *TestManager::findTestCase(unsigned int id) const throw() { // id = -1 return NULL; } -TestCase *TestManager::getTestCase(unsigned int id, const std::string &description) throw() { +TestCase *TestManager::getTestCase(unsigned int id, const std::string &description) { test_pool_nc_it it = a_testPool.find(id); if (it != a_testPool.end()) return it->second; @@ -295,7 +295,7 @@ TestCase *TestManager::getTestCase(unsigned int id, const std::string &descripti return result; } -bool TestManager::clearPool(std::string &result) throw() { +bool TestManager::clearPool(std::string &result) { result = ""; @@ -340,7 +340,7 @@ bool TestManager::clearPool(std::string &result) throw() { return true; } -bool TestManager::resetPool(bool hard) throw() { +bool TestManager::resetPool(bool hard) { bool result = false; // any reset if (!tests()) return result; @@ -353,12 +353,12 @@ bool TestManager::resetPool(bool hard) throw() { return result; } -bool TestManager::tick() throw() { +bool TestManager::tick() { LOGDEBUG(anna::Logger::debug("New test clock tick !", ANNA_FILE_LOCATION)); return execTestCases(a_synchronousAmount); } -bool TestManager::execTestCases(int sync_amount) throw() { +bool TestManager::execTestCases(int sync_amount) { if (!tests()) { LOGWARNING(anna::Logger::warning("Testing pool is empty. You need programming", ANNA_FILE_LOCATION)); @@ -375,7 +375,7 @@ bool TestManager::execTestCases(int sync_amount) throw() { return true; } -bool TestManager::nextTestCase() throw() { +bool TestManager::nextTestCase() { while (true) { @@ -424,7 +424,7 @@ bool TestManager::nextTestCase() throw() { } } -TestCase *TestManager::getDiameterTestCaseFromSessionId(const anna::DataBlock &message, std::string &sessionId) throw() { +TestCase *TestManager::getDiameterTestCaseFromSessionId(const anna::DataBlock &message, std::string &sessionId) { try { sessionId = anna::diameter::helpers::base::functions::getSessionId(message); } @@ -441,7 +441,7 @@ TestCase *TestManager::getDiameterTestCaseFromSessionId(const anna::DataBlock &m return NULL; } -TestCase *TestManager::getDiameterTestCaseFromSubscriberId(const anna::DataBlock &message, std::string &subscriberId) throw() { +TestCase *TestManager::getDiameterTestCaseFromSubscriberId(const anna::DataBlock &message, std::string &subscriberId) { try { subscriberId = anna::diameter::helpers::dcca::functions::getSubscriptionIdData(message, anna::diameter::helpers::dcca::AVPVALUES__Subscription_Id_Type::END_USER_E164); if (subscriberId == "") // try with IMSI @@ -460,7 +460,7 @@ TestCase *TestManager::getDiameterTestCaseFromSubscriberId(const anna::DataBlock return NULL; } -void TestManager::receiveDiameterMessage(const anna::DataBlock &message, const anna::diameter::comm::ClientSession *clientSession) throw(anna::RuntimeException) { +void TestManager::receiveDiameterMessage(const anna::DataBlock &message, const anna::diameter::comm::ClientSession *clientSession) noexcept(false) { // Testing disabled: if (!tests()) return; @@ -501,7 +501,7 @@ void TestManager::receiveDiameterMessage(const anna::DataBlock &message, const a } } -void TestManager::receiveDiameterMessage(const anna::DataBlock &message, const anna::diameter::comm::ServerSession *serverSession) throw(anna::RuntimeException) { +void TestManager::receiveDiameterMessage(const anna::DataBlock &message, const anna::diameter::comm::ServerSession *serverSession) noexcept(false) { // Testing disabled: if (!tests()) return; @@ -543,7 +543,7 @@ void TestManager::receiveDiameterMessage(const anna::DataBlock &message, const a } anna::xml::Node* TestManager::asXML(anna::xml::Node* parent) const -throw() { +{ anna::xml::Node* result = parent->createChild("TestManager"); int poolSize = a_testPool.size(); @@ -587,7 +587,7 @@ throw() { } anna::xml::Node* TestManager::junitAsXML(anna::xml::Node* parent) const -throw() { +{ // if only a single testsuite element is present, the testsuites element can be omitted //anna::xml::Node* result = parent->createChild("testsuites"); anna::xml::Node* result = parent->createChild("testsuite"); @@ -729,17 +729,17 @@ Each testcase element can have multiple error, failure, system-out, or system-er return result; } -std::string TestManager::asXMLString() const throw() { +std::string TestManager::asXMLString() const { anna::xml::Node root("root"); return anna::xml::Compiler().apply(asXML(&root)); } -std::string TestManager::junitAsXMLString() const throw() { +std::string TestManager::junitAsXMLString() const { anna::xml::Node root("root"); return anna::xml::Compiler().apply(junitAsXML(&root)); } -std::string TestManager::summaryCounts() const throw() { +std::string TestManager::summaryCounts() const { std::string result= "\nSummary Counts:\n"; unsigned int total = a_statSummary.getTotal(); @@ -758,7 +758,7 @@ std::string TestManager::summaryCounts() const throw() { return result; } -std::string TestManager::summaryStates() const throw() { +std::string TestManager::summaryStates() const { std::string result = "\nSummary States:\n"; const char *literal = "\n[%s] %s"; diff --git a/source/testing/TestStep.cpp b/source/testing/TestStep.cpp index 84c577c..a6d8185 100644 --- a/source/testing/TestStep.cpp +++ b/source/testing/TestStep.cpp @@ -153,7 +153,7 @@ namespace { } */ - bool decodeMessage(const anna::DataBlock &message, anna::diameter::codec::Message &messageCodec) throw() { + bool decodeMessage(const anna::DataBlock &message, anna::diameter::codec::Message &messageCodec) { if (message.isEmpty()) return false; @@ -185,7 +185,7 @@ void TestStep::initialize(TestCase *testCase) { a_number = testCase->steps() + 1; // testCase is not NULL } -bool TestStep::decodeMessage(bool trust) throw() { +bool TestStep::decodeMessage(bool trust) { if (a_messageCodec) return true; a_messageCodec = new anna::diameter::codec::Message; if (::decodeMessage(a_message, *a_messageCodec)) return true; @@ -200,13 +200,13 @@ bool TestStep::decodeMessage(bool trust) throw() { } const char* TestStep::asText(const Type::_v type) -throw() { +{ static const char* text [] = { "Unconfigured", "Timeout", "SendDiameterXmlToEntity", "SendDiameterXmlToClient", "Delay", "Wait", "Command", "IpLimit" }; return text [type]; } anna::xml::Node* TestStep::asXML(anna::xml::Node* parent) -throw() { +{ anna::xml::Node* result = parent->createChild("TestStep"); result->createAttribute("Number", a_number); @@ -231,12 +231,12 @@ throw() { return result; } -std::string TestStep::asXMLString() throw() { +std::string TestStep::asXMLString() { anna::xml::Node root("root"); return anna::xml::Compiler().apply(asXML(&root)); } -bool TestStep::execute() throw() { +bool TestStep::execute() { int ia = a_testCase->interactiveAmount(); if (ia > -1) { @@ -262,7 +262,7 @@ bool TestStep::execute() throw() { return do_execute(); } -void TestStep::complete() throw() { +void TestStep::complete() { const char *literal = "Complete %s Test Step %d/%d (test case %llu)"; @@ -277,7 +277,7 @@ void TestStep::complete() throw() { do_complete(); } -void TestStep::reset() throw() { +void TestStep::reset() { const char *literal = "Reset %s Test Step %d/%d (test case %llu)"; @@ -295,7 +295,7 @@ void TestStep::reset() throw() { do_reset(); } -void TestStep::next() throw() { +void TestStep::next() { a_testCase->nextStep(); a_testCase->process(); } @@ -305,7 +305,7 @@ void TestStep::next() throw() { // TestStepTimeout //////////////////////////////////////////////////////////////////////////////////////////////////////// anna::xml::Node* TestStepTimeout::asXML(anna::xml::Node* parent) -throw() { +{ anna::xml::Node* result = TestStep::asXML(parent); // end timestamp will be 0 if test finished OK //parent->createChild("TestStepTimeout"); result->createAttribute("Timeout", a_timeout.asString()); @@ -313,7 +313,7 @@ throw() { return result; } -bool TestStepTimeout::do_execute() throw() { +bool TestStepTimeout::do_execute() { try { a_timer = TestManager::instantiate().createTimer((TestCaseStep*)this, a_timeout, TestTimer::Type::TimeLeft); } @@ -326,7 +326,7 @@ bool TestStepTimeout::do_execute() throw() { return true; // go next } -void TestStepTimeout::do_complete() throw() { +void TestStepTimeout::do_complete() { int stepNumber = getNumber(); if (stepNumber == a_testCase->steps()) { a_testCase->addDebugSummaryHint(anna::functions::asString("Timeout expired (step number %d) but it was the last test case step", stepNumber)); // before report (when set Failed state) @@ -346,7 +346,7 @@ void TestStepTimeout::do_complete() throw() { a_timer = NULL; } -void TestStepTimeout::cancelTimer() throw() { +void TestStepTimeout::cancelTimer() { if (!a_timer) return; try { TestManager::instantiate().cancelTimer(a_timer); @@ -358,7 +358,7 @@ void TestStepTimeout::cancelTimer() throw() { //a_timeout = 0; THIS IS CONFIGURATION INFO } -void TestStepTimeout::do_reset() throw() { +void TestStepTimeout::do_reset() { cancelTimer(); } @@ -366,7 +366,7 @@ void TestStepTimeout::do_reset() throw() { // TestStepSendDiameterXml //////////////////////////////////////////////////////////////////////////////////////////////////////// anna::xml::Node* TestStepSendDiameterXml::asXML(anna::xml::Node* parent) -throw() { +{ anna::xml::Node* result = TestStep::asXML(parent); //parent->createChild("TestStepSendDiameterXml"); std::string msg = "", xmlmsg = ""; @@ -399,7 +399,7 @@ throw() { return result; } -bool TestStepSendDiameterXml::do_execute() throw() { +bool TestStepSendDiameterXml::do_execute() { bool success = false; std::string failReason = "Error sending diameter message"; anna::diameter::comm::Entity *entity = a_originHost->getEntity(); // by default @@ -540,7 +540,7 @@ bool TestStepSendDiameterXml::do_execute() throw() { return success; // go next if sent was OK } -void TestStepSendDiameterXml::do_reset() throw() { +void TestStepSendDiameterXml::do_reset() { a_expired = false; //a_message.clear(); //a_messageAlreadyDecoded = false; @@ -550,7 +550,7 @@ void TestStepSendDiameterXml::do_reset() throw() { // TestStepDelay //////////////////////////////////////////////////////////////////////////////////////////////////////// anna::xml::Node* TestStepDelay::asXML(anna::xml::Node* parent) -throw() { +{ anna::xml::Node* result = TestStep::asXML(parent); //parent->createChild("TestStepDelay"); @@ -559,7 +559,7 @@ throw() { return result; } -bool TestStepDelay::do_execute() throw() { +bool TestStepDelay::do_execute() { if (a_delay == 0) { complete(); return true; } // special case try { a_timer = TestManager::instantiate().createTimer((TestCaseStep*)this, a_delay, TestTimer::Type::Delay); @@ -573,7 +573,7 @@ bool TestStepDelay::do_execute() throw() { return false; // don't go next (wait complete) } -void TestStepDelay::do_complete() throw() { +void TestStepDelay::do_complete() { if (a_delay == 0) return; // special case a_timer = NULL; if (TestManager::instantiate().getDumpStdout()) { @@ -583,7 +583,7 @@ void TestStepDelay::do_complete() throw() { // TODO, avoid this recursion } -void TestStepDelay::cancelTimer() throw() { +void TestStepDelay::cancelTimer() { if (!a_timer) return; if (a_delay == 0) return; // special case try { @@ -596,7 +596,7 @@ void TestStepDelay::cancelTimer() throw() { //a_delay = 0; THIS IS CONFIGURATION INFO } -void TestStepDelay::do_reset() throw() { +void TestStepDelay::do_reset() { cancelTimer(); } @@ -607,7 +607,7 @@ void TestStepDelay::do_reset() throw() { void TestStepWaitDiameter::setCondition(bool fromEntity, const std::string &code, const std::string &bitR, const std::string &hopByHop, const std::string &applicationId, const std::string &sessionId, const std::string &resultCode, - const std::string &msisdn, const std::string &imsi, const std::string &serviceContextId) throw() { + const std::string &msisdn, const std::string &imsi, const std::string &serviceContextId) { a_condition.setReceivedFromEntity(fromEntity); a_condition.setCode(code); @@ -620,18 +620,18 @@ void TestStepWaitDiameter::setCondition(bool fromEntity, a_condition.setServiceContextId(serviceContextId); } -void TestStepWaitDiameter::setConditionRegexpHex(bool fromEntity, const std::string ®exp) throw() { +void TestStepWaitDiameter::setConditionRegexpHex(bool fromEntity, const std::string ®exp) { a_condition.setReceivedFromEntity(fromEntity); a_condition.setRegexpHex(regexp); } -void TestStepWaitDiameter::setConditionRegexpXml(bool fromEntity, const std::string ®exp) throw() { +void TestStepWaitDiameter::setConditionRegexpXml(bool fromEntity, const std::string ®exp) { a_condition.setReceivedFromEntity(fromEntity); a_condition.setRegexpXml(regexp); } anna::xml::Node* TestStepWaitDiameter::asXML(anna::xml::Node* parent) -throw() { +{ anna::xml::Node* result = TestStep::asXML(parent); //parent->createChild("TestStepWaitDiameter"); std::string msg = "", xmlmsg = ""; @@ -671,16 +671,16 @@ throw() { return result; } -bool TestStepWaitDiameter::do_execute() throw() { +bool TestStepWaitDiameter::do_execute() { return a_completed; } -void TestStepWaitDiameter::do_complete() throw() { +void TestStepWaitDiameter::do_complete() { //a_testCase->process(); // next() not invoked; we only want to reactivate the test case // avoid stack overflow: we will process the test case externally when incoming message is fulfilled (TestCase.cpp), and TestManager is noticed } -bool TestStepWaitDiameter::fulfilled(const anna::DataBlock &db/*, bool matchSessionId*/) throw() { +bool TestStepWaitDiameter::fulfilled(const anna::DataBlock &db/*, bool matchSessionId*/) { if (a_condition.comply(db/*, matchSessionId*/)) { a_message = db; // store matched complete(); @@ -699,7 +699,7 @@ bool TestStepWaitDiameter::fulfilled(const anna::DataBlock &db/*, bool matchSess return false; } -void TestStepWaitDiameter::do_reset() throw() { +void TestStepWaitDiameter::do_reset() { a_message.clear(); a_clientSession = NULL; a_serverSession = NULL; @@ -709,7 +709,7 @@ void TestStepWaitDiameter::do_reset() throw() { // TestStepCmd //////////////////////////////////////////////////////////////////////////////////////////////////////// anna::xml::Node* TestStepCmd::asXML(anna::xml::Node* parent) -throw() { +{ anna::xml::Node* result = TestStep::asXML(parent); //parent->createChild("TestStepCmd"); @@ -729,7 +729,7 @@ throw() { return result; } -bool TestStepCmd::do_execute() throw() { +bool TestStepCmd::do_execute() { if (!a_threadRunning /* || a_threadDeprecated DO NOT WANT TO OVERLAP ... */) { // Special tags to replace: std::string cmd = getScript(); @@ -751,7 +751,7 @@ bool TestStepCmd::do_execute() throw() { // We must implement a interrupt procedure for the thread on reset call... TODO ! } -void TestStepCmd::do_complete() throw() { +void TestStepCmd::do_complete() { if (TestManager::instantiate().getDumpStdout()) { std::cout << "Executed Command Test Step (" << a_script << ") [rc=" << a_resultCode << "]" << std::endl; @@ -773,7 +773,7 @@ void TestStepCmd::do_complete() throw() { // TODO, avoid this recursion } -void TestStepCmd::do_reset() throw() { +void TestStepCmd::do_reset() { if (a_threadRunning) { std::string s_warn = anna::functions::asString("Thread still in progress: deprecating step %d for Test Case %llu", getNumber(), a_testCase->getId()); @@ -793,7 +793,7 @@ void TestStepCmd::do_reset() throw() { } anna::xml::Node* TestStepIpLimit::asXML(anna::xml::Node* parent) -throw() { +{ anna::xml::Node* result = TestStep::asXML(parent); std::string limit = (a_ipLimit != UINT_MAX) ? anna::functions::asString(a_ipLimit) : "[no limit]"; result->createAttribute("IpLimit", limit); @@ -801,13 +801,13 @@ throw() { return result; } -bool TestStepIpLimit::do_execute() throw() { +bool TestStepIpLimit::do_execute() { TestManager::instantiate().setInProgressLimit(a_ipLimit); complete(); return true; // go next } -void TestStepIpLimit::do_complete() throw() { +void TestStepIpLimit::do_complete() { if (TestManager::instantiate().getDumpStdout()) { std::string limit = (a_ipLimit != UINT_MAX) ? anna::functions::asString(a_ipLimit) : "[no limit]"; std::cout << "Executed IpLimit Test Step (value = " << limit << ")" << std::endl; diff --git a/source/testing/TestTimer.cpp b/source/testing/TestTimer.cpp index 47c4ccc..4825900 100644 --- a/source/testing/TestTimer.cpp +++ b/source/testing/TestTimer.cpp @@ -22,7 +22,7 @@ using namespace anna; using namespace anna::testing; void TestTimer::expire(anna::timex::Engine*) -throw(anna::RuntimeException) { +noexcept(false) { TestStep *step = getTestCaseStep(); @@ -37,14 +37,14 @@ throw(anna::RuntimeException) { } const char* TestTimer::asText(const Type::_v type) -throw() { +{ static const char* text [] = { "TimeLeft", "Delay" }; return text [type]; } string TestTimer::asString() const -throw() { +{ string result("TestTimer { "); result += anna::timex::Transaction::asString(); result += " Type: "; diff --git a/source/time/Date.cpp b/source/time/Date.cpp index b002fce..0745fdd 100644 --- a/source/time/Date.cpp +++ b/source/time/Date.cpp @@ -37,7 +37,7 @@ using namespace anna::time; //------------------------------------------------------------------------------ //----------------------------------------------------------- Date::initialize() //------------------------------------------------------------------------------ -void Date::initialize(const char * TZ) throw() { +void Date::initialize(const char * TZ) { a_timestamp = ::time(NULL); setTz(TZ); } @@ -46,7 +46,7 @@ void Date::initialize(const char * TZ) throw() { //------------------------------------------------------------------------------ //-------------------------------------------------------------- Date::refresh() //------------------------------------------------------------------------------ -void Date::refresh(void) throw() { +void Date::refresh(void) { anna::Guard guard(a_mutex); // Set current/programmed timezone @@ -78,7 +78,7 @@ Date::Date(const char *TZ) { //------------------------------------------------------------------------------ //---------------------------------------------------------------- Date::setTz() //------------------------------------------------------------------------------ -void Date::setTz(const char * TZ) throw() { +void Date::setTz(const char * TZ) { if (TZ) a_tz.set(TZ); else a_tz = functions::getSystemTimezone(); @@ -89,7 +89,7 @@ void Date::setTz(const char * TZ) throw() { //------------------------------------------------------------------------------ //---------------------------------------------------- Date::setSystemTimezone() //------------------------------------------------------------------------------ -void Date::setSystemTimezone() throw() { +void Date::setSystemTimezone() { a_tz = functions::getSystemTimezone(); // Refresh the other data: refresh(); @@ -99,7 +99,7 @@ void Date::setSystemTimezone() throw() { //------------------------------------------------------------------------------ //---------------------------------------------------------------- Date::store() //------------------------------------------------------------------------------ -void Date::store(const time_t & unixTimestamp) throw() { +void Date::store(const time_t & unixTimestamp) { a_timestamp = unixTimestamp; // Refresh the other data: refresh(); @@ -109,7 +109,7 @@ void Date::store(const time_t & unixTimestamp) throw() { //------------------------------------------------------------------------------ //------------------------------------------------------------- Date::storeNtp() //------------------------------------------------------------------------------ -void Date::storeNtp(const unsigned int & ntpTimestamp) throw() { +void Date::storeNtp(const unsigned int & ntpTimestamp) { a_timestamp = ntpTimestamp - TIMESTAMP_OFFSET_NTP1900_OVER_UNIX1970; // Refresh the other data: refresh(); @@ -121,7 +121,7 @@ void Date::storeNtp(const unsigned int & ntpTimestamp) throw() { //------------------------------------------------------------------------------ void Date::store(const struct tm &date, const char *TZ) -throw(anna::RuntimeException) +noexcept(false) { if (TZ) { @@ -153,7 +153,7 @@ throw(anna::RuntimeException) //---------------------------------------------------------------- Date::store() //------------------------------------------------------------------------------ void Date::store(const std::string &stringDate, const char *TZ, const char *strptimeFormat) -throw(anna::RuntimeException) +noexcept(false) { if(strptimeFormat == NULL) throw anna::RuntimeException("Invalid NULL strptimeFormat !!", ANNA_FILE_LOCATION); @@ -195,7 +195,7 @@ Date & Date::operator = (const Date & d) { //------------------------------------------------------------------------------ //--------------------------------------------------------------- Date::getDay() //------------------------------------------------------------------------------ -const char *Date::getDay(void) const throw() { +const char *Date::getDay(void) const { static const char *weekdayname[] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; @@ -207,7 +207,7 @@ const char *Date::getDay(void) const throw() { //------------------------------------------------------------------------------ //------------------------------------------------------- Date::yyyymmddHHmmss() //------------------------------------------------------------------------------ -std::string Date::yyyymmddHHmmss(void) const throw() { +std::string Date::yyyymmddHHmmss(void) const { return anna::functions::asString("%04d%02d%02d%02d%02d%02d", 1900 + a_tm.tm_year, 1 + (a_tm.tm_mon), a_tm.tm_mday, a_tm.tm_hour, a_tm.tm_min, a_tm.tm_sec); @@ -217,7 +217,7 @@ std::string Date::yyyymmddHHmmss(void) const throw() { //------------------------------------------------------------------------------ //------------------------------------------------------------- Date::asString() //------------------------------------------------------------------------------ -std::string Date::asString(void) const throw() { +std::string Date::asString(void) const { std::string result = anna::functions::asString("%s %02d/%02d/%04d %02d:%02d:%02d ", getDay(), getTm().tm_mday, 1 + (getTm().tm_mon), 1900 + getTm().tm_year, @@ -234,7 +234,7 @@ std::string Date::asString(void) const throw() { //------------------------------------------------------------------------------ //---------------------------------------------------------------- Date::asXML() //------------------------------------------------------------------------------ -anna::xml::Node* Date::asXML(anna::xml::Node* parent) const throw() { +anna::xml::Node* Date::asXML(anna::xml::Node* parent) const { //anna::xml::Node* result = parent->createChild("anna.time.Date"); parent->createAttribute("Date", anna::functions::asString("%02d/%02d/%04d", getTm().tm_mday, 1 + (getTm().tm_mon), 1900 + getTm().tm_year)); parent->createAttribute("Day", getDay()); diff --git a/source/time/functions.cpp b/source/time/functions.cpp index fe6bb57..30f8352 100644 --- a/source/time/functions.cpp +++ b/source/time/functions.cpp @@ -27,7 +27,7 @@ unsigned long long int SecondsReference; } -void anna::time::functions::initialize() throw() { +void anna::time::functions::initialize() { static bool cached = false; if(!cached) { SystemTimezone.set(getenv("TZ")); @@ -36,39 +36,39 @@ void anna::time::functions::initialize() throw() { } } -void anna::time::functions::setControlPoint(unsigned long long int secondsTimestamp) throw() { +void anna::time::functions::setControlPoint(unsigned long long int secondsTimestamp) { SecondsReference = secondsTimestamp ? secondsTimestamp : (::time(NULL)); } -unsigned long long int anna::time::functions::getSecondsReference() throw() { +unsigned long long int anna::time::functions::getSecondsReference() { return SecondsReference; } -const anna::time::Timezone & anna::time::functions::getSystemTimezone(void) throw() { +const anna::time::Timezone & anna::time::functions::getSystemTimezone(void) { return (SystemTimezone); } -bool anna::time::functions::initialized(void) throw() { +bool anna::time::functions::initialized(void) { return (SystemTimezone.isInitialized()); } -unsigned long long int anna::time::functions::unixSeconds(void) throw() { +unsigned long long int anna::time::functions::unixSeconds(void) { return (::time(NULL)); } -unsigned long long int anna::time::functions::unixMilliseconds() throw() { +unsigned long long int anna::time::functions::unixMilliseconds() { struct timeval tv; gettimeofday(&tv, NULL); return (tv.tv_sec * 1000) + (tv.tv_usec / 1000); } -unsigned long long int anna::time::functions::lapsedMilliseconds() throw() { +unsigned long long int anna::time::functions::lapsedMilliseconds() { struct timeval tv; gettimeofday(&tv, NULL); return ((tv.tv_sec - SecondsReference) * 1000) + (tv.tv_usec / 1000); } -unsigned long long int anna::time::functions::unixMicroseconds(void) throw() { +unsigned long long int anna::time::functions::unixMicroseconds(void) { struct timeval tv; gettimeofday(&tv, NULL); unsigned long long int result(tv.tv_sec); @@ -76,7 +76,7 @@ unsigned long long int anna::time::functions::unixMicroseconds(void) throw() { return result += tv.tv_usec; } -std::string anna::time::functions::currentTimeAsString(void) throw() { +std::string anna::time::functions::currentTimeAsString(void) { struct timeval tv; gettimeofday(&tv, NULL); struct tm *tm; diff --git a/source/time/internal/sccs.cpp b/source/time/internal/sccs.cpp index 70671f9..329cda7 100644 --- a/source/time/internal/sccs.cpp +++ b/source/time/internal/sccs.cpp @@ -14,7 +14,7 @@ anna_define_sccs_tag(time, 1) void anna::time::sccs::activate() -throw() { +{ //anna::sccs::activate(); anna::ModuleManager::instantiate().insert(anna_use_sccs_tag(time), 0); } diff --git a/source/timex/Clock.cpp b/source/timex/Clock.cpp index 60f9e41..b8a0965 100644 --- a/source/timex/Clock.cpp +++ b/source/timex/Clock.cpp @@ -17,7 +17,7 @@ anna::timex::Clock::Clock(const char* name, const Millisecond & timeout) : } void anna::timex::Clock::expire(timex::Engine* timeController) -throw(RuntimeException) { +noexcept(false) { bool moreTick = true; try { diff --git a/source/timex/Engine.cpp b/source/timex/Engine.cpp index 1ec6747..396e438 100644 --- a/source/timex/Engine.cpp +++ b/source/timex/Engine.cpp @@ -65,7 +65,7 @@ anna::timex::Engine::~Engine() { // en que realmente llega la seal de ualarm. //-------------------------------------------------------------------------------------------- void anna::timex::Engine::do_initialize() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tm("timex::Engine", "do_initialize", ANNA_FILE_LOCATION)); if(a_maxQuantum > 0) { @@ -116,7 +116,7 @@ throw(RuntimeException) { // Reimplementado de app::Component void anna::timex::Engine::do_cloneParent() -throw() { +{ } /* @@ -124,7 +124,7 @@ throw() { * Instala la senhal de tick en el proceso, ya que la alarma no se hereda directamente. */ void anna::timex::Engine::do_cloneChild() -throw(RuntimeException) { +noexcept(false) { } //---------------------------------------------------------------------------- @@ -132,7 +132,7 @@ throw(RuntimeException) { // en el 'pipe'. //---------------------------------------------------------------------------- void anna::timex::Engine::pause() -throw(RuntimeException) { +noexcept(false) { Guard guard(this, "timex::Engine (pause)"); if(a_tickProducer->isInPause() == false) { @@ -146,7 +146,7 @@ throw(RuntimeException) { } void anna::timex::Engine::play() -throw(RuntimeException) { +noexcept(false) { Guard guard(this, "timex::Engine (play)"); if(a_tickProducer->isInPause() == true) { @@ -160,7 +160,7 @@ throw(RuntimeException) { } void anna::timex::Engine::activate(timex::TimeEvent* timeEvent) -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tm(Logger::Local7, "timex::Engine", "activate", ANNA_FILE_LOCATION)); if(a_maxQuantum == 0) @@ -229,7 +229,7 @@ throw(RuntimeException) { } anna::timex::TimeEvent* anna::timex::Engine::getTimeEvent(const timex::TimeEvent::Id eventTimeId) -throw() { +{ LOGMETHOD(TraceMethod tm(Logger::Local7, "timex::Engine", "getTimeEvent", ANNA_FILE_LOCATION)); Directory::iterator iid; TimeEvent* result(NULL); @@ -253,7 +253,7 @@ throw() { } void anna::timex::Engine::cancel(timex::TimeEvent* timeEvent) -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tm(Logger::Local7, "timex::Engine", "cancel", ANNA_FILE_LOCATION)); if(timeEvent == NULL) @@ -301,7 +301,7 @@ throw(RuntimeException) { } void anna::timex::Engine::do_stop() -throw() { +{ LOGMETHOD(TraceMethod tm("timex::Engine", "do_stop", ANNA_FILE_LOCATION)); Quantum::iterator ii, maxii; Guard guard(this, "timex::Engine (do_stop)"); @@ -333,7 +333,7 @@ throw() { } void anna::timex::Engine::kill() -throw() { +{ Guard guard(this, "timex::Engine (kill)"); app::functions::component (ANNA_FILE_LOCATION)->detach(a_tickConsumer); @@ -362,7 +362,7 @@ throw() { // (3) Si el temporizador ha sido reactivado no tiene que liberarlo. //---------------------------------------------------------------------------------- void anna::timex::Engine::tick() -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tm(Logger::Local7, "timex::Engine", "tick", ANNA_FILE_LOCATION)); /* if (Logger::isActive (Logger::Local6) == true && a_directory.size () > 0) { @@ -439,13 +439,13 @@ throw(RuntimeException) { } void anna::timex::Engine::notifyRelease(timex::TimeEvent* timeEvent) -throw() { +{ if(timeEvent->a_observer != NULL) timeEvent->a_observer->release(timeEvent); } string anna::timex::Engine::asString() const -throw() { +{ string msg("timex::Engine { "); msg += app::Component::asString(); msg += " | Max Timeout: "; @@ -460,7 +460,7 @@ throw() { } xml::Node* anna::timex::Engine::asXML(xml::Node* parent) const -throw() { +{ parent = Component::asXML(parent); xml::Node* result = parent->createChild("timex.Engine"); result->createAttribute("MaxTimeout", a_maxTimeout); diff --git a/source/timex/TimeEvent.cpp b/source/timex/TimeEvent.cpp index 713ba09..110256e 100644 --- a/source/timex/TimeEvent.cpp +++ b/source/timex/TimeEvent.cpp @@ -25,7 +25,7 @@ anna::timex::TimeEvent::~TimeEvent() { } std::string anna::timex::TimeEvent::asString() const -throw() { +{ std::string result("timex::TimeEvent { Id: "); result += functions::asHexString(a_id); result += " | Reference: "; diff --git a/source/timex/internal/TickConsumer.cpp b/source/timex/internal/TickConsumer.cpp index 4a36404..e037944 100644 --- a/source/timex/internal/TickConsumer.cpp +++ b/source/timex/internal/TickConsumer.cpp @@ -27,7 +27,7 @@ using namespace anna; // (2) Puede ser que se invoque mas de una vez. //-------------------------------------------------------------------------------------------- void anna::timex::TickConsumer::initialize() -throw(RuntimeException) { +noexcept(false) { if(a_pipe [0] != -1) // (2) return; @@ -41,7 +41,7 @@ throw(RuntimeException) { } void anna::timex::TickConsumer::apply() -throw(RuntimeException) { +noexcept(false) { char buffer [256]; if(a_pipe [0] == -1) @@ -65,7 +65,7 @@ throw(RuntimeException) { } void anna::timex::TickConsumer::finalize() -throw() { +{ if(a_timeController.a_tickProducer) a_timeController.a_tickProducer->requestStop(); } @@ -79,7 +79,7 @@ throw() { * el control de tiempos. */ void anna::timex::TickConsumer::clone() -throw(RuntimeException) { +noexcept(false) { close(a_pipe [0]); close(a_pipe [1]); @@ -96,7 +96,7 @@ throw(RuntimeException) { } std::string anna::timex::TickConsumer::asString() const -throw() { +{ string result("timex::TickConsumer { "); result += Handler::asString(); return result += functions::asString(" | Pipe (Read = %d, Write = %d) } ", a_pipe [0], a_pipe [1]); diff --git a/source/timex/internal/TickProducer.cpp b/source/timex/internal/TickProducer.cpp index c2b88e7..273400d 100644 --- a/source/timex/internal/TickProducer.cpp +++ b/source/timex/internal/TickProducer.cpp @@ -25,7 +25,7 @@ using namespace anna; //static void* anna::timex::TickProducer::exec(void* arg) -throw() { +{ sigset_t mask; sigemptyset(&mask); pthread_sigmask(SIG_SETMASK, &mask, NULL); @@ -58,7 +58,7 @@ anna::timex::TickProducer::TickProducer(timex::Engine* timeController, const int {;} void anna::timex::TickProducer::tick() -throw() { +{ static char onebyte = 0xff; static int errorCount = 0; @@ -85,7 +85,7 @@ throw() { // que podemos considerar que normalmente no desviar�tanto tiempo. //-------------------------------------------------------------------------------------------- Millisecond anna::timex::TickProducer::calculeSlice(const Millisecond & msnow) -throw() { +{ Millisecond result(a_timeController.getResolution()); int correction = (a_expectedTime == 0) ? 0 : (a_expectedTime - msnow); // (2) diff --git a/source/timex/internal/sccs.cpp b/source/timex/internal/sccs.cpp index 76f2dae..81197bf 100644 --- a/source/timex/internal/sccs.cpp +++ b/source/timex/internal/sccs.cpp @@ -16,7 +16,7 @@ anna_define_sccs_tag(timex, 5); void anna::timex::sccs::activate() -throw() { +{ app::sccs::activate(); comm::sccs::activate(); ModuleManager::instantiate().insert(anna_use_sccs_tag(timex), "00"); diff --git a/source/xml/Attribute.cpp b/source/xml/Attribute.cpp index 9f8887f..f5f8438 100644 --- a/source/xml/Attribute.cpp +++ b/source/xml/Attribute.cpp @@ -13,7 +13,7 @@ using namespace std; using namespace anna; string xml::Attribute::asString() const -throw() { +{ std::string result("xml::Attribute {"); result += Data::asString(); result += " | Name: "; diff --git a/source/xml/Compiler.cpp b/source/xml/Compiler.cpp index 1cbc286..a5e7435 100644 --- a/source/xml/Compiler.cpp +++ b/source/xml/Compiler.cpp @@ -29,7 +29,7 @@ Compiler::Compiler() { } const char* Compiler::apply(const Node* node, const int flags) -throw(RuntimeException) { +noexcept(false) { Guard guard(this, "xml::Compiler::apply"); a_result.clear(); @@ -42,7 +42,7 @@ throw(RuntimeException) { } const char* Compiler::apply(const Document& document, const Node* node, const int flags) -throw(RuntimeException) { +noexcept(false) { Guard guard(this, "xml::Compiler::apply"); a_result.clear(); const char* version = document.getVersion(); @@ -77,7 +77,7 @@ throw(RuntimeException) { // nodos + texto. //------------------------------------------------------------------------------------ void Compiler::apply(const Node* node, Result& result, const int level, const int flags) -throw(RuntimeException) { +noexcept(false) { const bool hasText(node->getText() != NULL); Node::const_child_iterator ii = node->child_begin(); Node::const_child_iterator maxii = node->child_end(); @@ -104,7 +104,7 @@ throw(RuntimeException) { // nodos + texto. //------------------------------------------------------------------------------------ void Compiler::apply(const Node* node, Result& result, const int flags) -throw(RuntimeException) { +noexcept(false) { static const int level = 0; const bool hasText(node->getText() != NULL); Node::const_child_iterator ii = node->child_begin(); @@ -133,7 +133,7 @@ throw(RuntimeException) { /*static*/ void Compiler::open(const Node* node, Result& result, const int level, const bool quickClose, const bool newline, const int flags) -throw(RuntimeException) { +noexcept(false) { const Attribute* attribute; const Namespace* ns; @@ -187,7 +187,7 @@ throw(RuntimeException) { /*static*/ void Compiler::writeFullName(const Node* node, Result& result, const int flags) -throw(RuntimeException) { +noexcept(false) { const Namespace* ns; if((flags & Mode::NoNamespaces) == 0 && (ns = node->getNamespace()) != NULL) { @@ -200,7 +200,7 @@ throw(RuntimeException) { /*static*/ void Compiler::writeFullName(const Attribute* attr, Result& result, const int flags) -throw(RuntimeException) { +noexcept(false) { const Namespace* ns; if((flags & Mode::NoNamespaces) == 0 && (ns = attr->getNamespace()) != NULL) { @@ -213,7 +213,7 @@ throw(RuntimeException) { /*static*/ void Compiler::close(const Node* node, Result& result, const int level, const int flags) -throw(RuntimeException) { +noexcept(false) { for(int i = 0; i < level; i ++) result += std::string(ANNA_XML_INDENTATION_SPACES, ' '); @@ -223,7 +223,7 @@ throw(RuntimeException) { } void Compiler::Result::extend(const int nbytes) -throw(RuntimeException) { +noexcept(false) { if((a_size + nbytes) >= a_maxSize) { int newSize = ((a_size + nbytes) << 1) - ((a_size + nbytes) >> 1); char* newBuffer = new char [newSize]; diff --git a/source/xml/Compressor.cpp b/source/xml/Compressor.cpp index 543b0e5..09654bd 100644 --- a/source/xml/Compressor.cpp +++ b/source/xml/Compressor.cpp @@ -16,6 +16,6 @@ using namespace std; using namespace anna; const DataBlock& xml::Compressor::apply(const xml::Document& docXML) -throw(RuntimeException) { +noexcept(false) { return ZBlock::compress(docXML.getContent()); } diff --git a/source/xml/DTD.cc.new b/source/xml/DTD.cc.new index 5fd659f..25cc7c1 100644 --- a/source/xml/DTD.cc.new +++ b/source/xml/DTD.cc.new @@ -19,7 +19,7 @@ DTD::~DTD () } void DTD::initialize (const char* content) - throw (RuntimeException) + noexcept(false) { LOGMETHOD (TraceMethod tf ("anna::xml::DTD", "initialize", ANNA_FILE_LOCATION)); @@ -34,7 +34,7 @@ void DTD::initialize (const char* content) } void DTD::validate (_xmlValidCtxt* context, _xmlDoc* document) const - throw (RuntimeException) + noexcept(false) { if (a_handle == NULL) throw RuntimeException ("'DTD::inicialize' was not called", ANNA_FILE_LOCATION); diff --git a/source/xml/DTD.cpp b/source/xml/DTD.cpp index 59c9b24..95074d3 100644 --- a/source/xml/DTD.cpp +++ b/source/xml/DTD.cpp @@ -26,7 +26,7 @@ DTD::~DTD() { } void DTD::initialize(const char* content) -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tf("anna::xml::DTD", "initialize", ANNA_FILE_LOCATION)); Guard guard(a_mutex); @@ -39,7 +39,7 @@ throw(RuntimeException) { } void DTD::validate(_xmlValidCtxt* context, _xmlDoc* document) const -throw(RuntimeException) { +noexcept(false) { if(a_handle == NULL) throw RuntimeException("'DTD::inicialize' was not called", ANNA_FILE_LOCATION); diff --git a/source/xml/DTDFile.cpp b/source/xml/DTDFile.cpp index cdddb0a..4f3a29f 100644 --- a/source/xml/DTDFile.cpp +++ b/source/xml/DTDFile.cpp @@ -24,7 +24,7 @@ using namespace anna; using namespace anna::xml; _xmlDtd* DTDFile::parse(const char *filename) const -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tf("anna::xml::DTDFile", "parse", ANNA_FILE_LOCATION)); _xmlDtd* result; int stream; diff --git a/source/xml/DTDMemory.cpp b/source/xml/DTDMemory.cpp index e685ada..963d219 100644 --- a/source/xml/DTDMemory.cpp +++ b/source/xml/DTDMemory.cpp @@ -38,7 +38,7 @@ DTDMemory::DTDMemory(const char *dtd) { // la DTD a partir de un archivo. //--------------------------------------------------------------------------------------------- _xmlDtd* DTDMemory::parse(const char* content) const -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tf("anna::xml::DTDMemory", "parse", ANNA_FILE_LOCATION)); _xmlDtd* result; int stream; diff --git a/source/xml/Data.cpp b/source/xml/Data.cpp index 4af223f..2a6cd5f 100644 --- a/source/xml/Data.cpp +++ b/source/xml/Data.cpp @@ -15,12 +15,12 @@ using namespace std; using namespace anna; void xml::Data::setValue(const int value) -throw() { +{ a_value = anna::functions::asString(value); } string xml::Data::asString() const -throw() { +{ string result("xml::Data { Node: "); result += a_owner->getName(); result += " | Value: "; diff --git a/source/xml/Decompressor.cpp b/source/xml/Decompressor.cpp index ae51bc3..478b24c 100644 --- a/source/xml/Decompressor.cpp +++ b/source/xml/Decompressor.cpp @@ -24,7 +24,7 @@ xml::Decompressor::~Decompressor() { } const xml::Document& xml::Decompressor::apply(const DataBlock& zdata) -throw(RuntimeException) { +noexcept(false) { const DataBlock& contain = ZBlock::uncompress(zdata); a_document->initialize(contain); return *a_document; diff --git a/source/xml/Document.cpp b/source/xml/Document.cpp index ebeefa7..27695f6 100644 --- a/source/xml/Document.cpp +++ b/source/xml/Document.cpp @@ -41,7 +41,7 @@ Document::~Document() { } void Document::initialize(const char* content) -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tf("anna::xml::Document", "initialize (char*)", ANNA_FILE_LOCATION)); clear(); a_handle = do_initialize(content); @@ -50,7 +50,7 @@ throw(RuntimeException) { } void Document::initialize(const DataBlock& content) -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tf("anna::xml::Document", "initialize (DataBlock)", ANNA_FILE_LOCATION)); clear(); a_handle = do_initialize(content); @@ -59,7 +59,7 @@ throw(RuntimeException) { } const xml::Node* Document::parse() -throw(RuntimeException) { +noexcept(false) { if(a_parser == NULL) a_parser = new Parser; @@ -67,7 +67,7 @@ throw(RuntimeException) { } const xml::Node* Document::parse(const xml::DTD& dtd) -throw(RuntimeException) { +noexcept(false) { if(a_parser == NULL) a_parser = new Parser; @@ -75,7 +75,7 @@ throw(RuntimeException) { } void Document::clear() -throw() { +{ if(a_handle != NULL) { xmlFreeDoc(a_handle); a_handle = NULL; @@ -92,17 +92,17 @@ throw() { } const char* Document::getEncoding() const -throw() { +{ return (a_encoding == NULL) ? NULL : ((a_encoding->empty() == true) ? NULL : a_encoding->c_str()); } const char* Document::getVersion() const -throw() { +{ return (a_version == NULL) ? NULL : ((a_version->empty() == true) ? NULL : a_version->c_str()); } const char* Document::getContentAsCString() const -throw(RuntimeException) { +noexcept(false) { const char* result = NULL; if(a_contentIsCString == false) { @@ -121,7 +121,7 @@ throw(RuntimeException) { } void Document::setEncoding(const char* encoding) -throw() { +{ if(a_encoding == NULL) { if(encoding != NULL) a_encoding = new string(encoding); @@ -134,7 +134,7 @@ throw() { } void Document::setVersion(const char* version) -throw() { +{ if(a_version == NULL) { if(version != NULL) a_version = new string(version); diff --git a/source/xml/DocumentFile.cpp b/source/xml/DocumentFile.cpp index f5ac226..824d99b 100644 --- a/source/xml/DocumentFile.cpp +++ b/source/xml/DocumentFile.cpp @@ -27,7 +27,7 @@ using namespace anna; using namespace anna::xml; _xmlDoc* DocumentFile::do_initialize(const char* filename) -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tf("anna::xml::DocumentFile", "do_initialize", ANNA_FILE_LOCATION)); _xmlDoc* result; a_filename = filename; @@ -53,14 +53,14 @@ throw(RuntimeException) { } _xmlDoc* DocumentFile::do_initialize(const anna::DataBlock&) -throw(RuntimeException) { +noexcept(false) { throw RuntimeException("xml::DocumentFile::do_initialize | Not implemented", ANNA_FILE_LOCATION); return NULL; } const anna::DataBlock& DocumentFile::getContent() const -throw(RuntimeException) { +noexcept(false) { const anna::DataBlock& result = Document::getContent(); if(result.isEmpty() == false) diff --git a/source/xml/DocumentMemory.cpp b/source/xml/DocumentMemory.cpp index 4b7ccf5..95f7943 100644 --- a/source/xml/DocumentMemory.cpp +++ b/source/xml/DocumentMemory.cpp @@ -20,7 +20,7 @@ using namespace anna; using namespace anna::xml; _xmlDoc* DocumentMemory::do_initialize(const char* content) -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tf("anna::xml::DocumentMemory", "do_initialize (char*)", ANNA_FILE_LOCATION)); setContent(content); _xmlDoc* result; @@ -41,7 +41,7 @@ throw(RuntimeException) { } _xmlDoc* DocumentMemory::do_initialize(const anna::DataBlock& content) -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tf("anna::xml::DocumentMemory", "do_initialize (DataBlock)", ANNA_FILE_LOCATION)); setContent(content); _xmlDoc* result; diff --git a/source/xml/Namespace.cpp b/source/xml/Namespace.cpp index 413a5ae..a86f875 100644 --- a/source/xml/Namespace.cpp +++ b/source/xml/Namespace.cpp @@ -12,7 +12,7 @@ using namespace std; using namespace anna; string xml::Namespace::asString() const -throw() { +{ string result("xml::Namespace { Name: "); result += a_name; result += " | Reference: "; diff --git a/source/xml/Node.cpp b/source/xml/Node.cpp index d7b84b3..ef47687 100644 --- a/source/xml/Node.cpp +++ b/source/xml/Node.cpp @@ -56,7 +56,7 @@ Node::~Node() { } void Node::clear() -throw() { +{ for(attribute_iterator aa = a_attributes.begin(), maxaa = a_attributes.end(); aa != maxaa; aa ++) a_attribute_pool->release(attribute(aa)); @@ -85,7 +85,7 @@ throw() { } const Attribute* Node::getAttribute(const char* name, const bool exceptionWhenNotFound) const -throw(RuntimeException) { +noexcept(false) { const Attribute* result(NULL); result = find(name, attribute_begin(), attribute_end()); @@ -101,7 +101,7 @@ throw(RuntimeException) { } xml::Attribute* Node::createAttribute(const char* name, const char* value, const Namespace* _namespace) -throw() { +{ Attribute* attribute = a_attribute_pool->create(); attribute->setNode(this); attribute->setName(name); @@ -112,7 +112,7 @@ throw() { } xml::Text* Node::createText(const char* text) -throw(RuntimeException) { +noexcept(false) { if(a_text != NULL) { string msg = asString(); msg += " | "; @@ -128,7 +128,7 @@ throw(RuntimeException) { } Node* Node::createChild(const char* name) -throw() { +{ Node* result = a_node_pool->create(); result->a_parent = this; result->setName(name); @@ -144,7 +144,7 @@ throw() { * Recordar que todos los namespaces se crean sólo en el nodo ROOT. */ const Namespace* Node::createNamespace(const std::string& name, const char* reference) -throw(RuntimeException) { +noexcept(false) { const Namespace* result = NULL; if((result = namespace_find(name, false)) != NULL) { @@ -170,7 +170,7 @@ throw(RuntimeException) { } const Node* Node::find(const char* childName, const bool exceptionWhenNotFound) const -throw(RuntimeException) { +noexcept(false) { const Node* child; for(Node::Children::const_iterator ii = a_children.begin(), maxii = a_children.end(); ii != maxii; ii ++) { @@ -193,7 +193,7 @@ throw(RuntimeException) { } Namespace* Node::namespace_find(const std::string& name, const bool exceptionWhenNotFound) -throw(RuntimeException) { +noexcept(false) { Namespace* result = a_root->a_namespaces->find(name); if(result == NULL && exceptionWhenNotFound == true) { @@ -208,7 +208,7 @@ throw(RuntimeException) { } string Node::asString() const -throw() { +{ string result("xml::Node { Name: "); result += a_name; @@ -221,7 +221,7 @@ throw() { } const Attribute* Node::find(const char* attrName, const_attribute_iterator begin, const_attribute_iterator end) -throw() { +{ Attribute* attribute; for(; begin != end; begin ++) { diff --git a/source/xml/Parser.cpp b/source/xml/Parser.cpp index 6eed989..b2d1e51 100644 --- a/source/xml/Parser.cpp +++ b/source/xml/Parser.cpp @@ -47,7 +47,7 @@ Parser::~Parser() { } const Node* Parser::apply(const Document& document) -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tf("anna::xml::Parser", "apply(Document)", ANNA_FILE_LOCATION)); Guard guard(*this); reset(); @@ -56,7 +56,7 @@ throw(RuntimeException) { } const Node* Parser::apply(const Document& document, const DTD& dtd) -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tf("anna::xml::Parser", "apply(Document,DTD)", ANNA_FILE_LOCATION)); Guard guard(*this); reset(); @@ -66,7 +66,7 @@ throw(RuntimeException) { } void Parser::apply(_xmlDoc* document) -throw(RuntimeException) { +noexcept(false) { LOGMETHOD(TraceMethod tf("anna::xml::Parser", "apply (_xmlDoc)", ANNA_FILE_LOCATION)); xmlNode* root; @@ -91,7 +91,7 @@ throw(RuntimeException) { } void Parser::children(Node* node, xmlNode* xmlNode) -throw(RuntimeException) { +noexcept(false) { Node* child; bool isSeparator; const char* w; @@ -133,7 +133,7 @@ throw(RuntimeException) { } void Parser::attributes(Node* node, xmlAttr* attribute) -throw(RuntimeException) { +noexcept(false) { const char* value; const Namespace* ns = NULL; @@ -147,7 +147,7 @@ throw(RuntimeException) { /* static */ void Parser::errorHandler(void *ctx, const char *msg, ...) -throw() { +{ va_list ap; va_start(ap, msg); vsprintf(st_text, msg, ap); @@ -162,7 +162,7 @@ throw() { /* static */ void Parser::warningHandler(void *ctx, const char *msg, ...) -throw() { +{ va_list ap; if(Logger::isActive(Logger::Warning)) { @@ -180,13 +180,13 @@ throw() { // La metodo que invoque a este debe hacerlo con una secci�n cr�tica activa. void Parser::reset() -throw() { +{ if(a_root != NULL) a_root->clear(); } void Parser::setupEncoding(_xmlDoc* document) -throw() { +{ if(document->encoding != NULL) { a_encoding = true; @@ -205,7 +205,7 @@ throw() { } const char* Parser::decode(const unsigned char* source) -throw() { +{ if(a_encoding == false) return (const char*) source; diff --git a/source/xml/XPath.cpp b/source/xml/XPath.cpp index f2e98cc..8d46fd1 100644 --- a/source/xml/XPath.cpp +++ b/source/xml/XPath.cpp @@ -36,7 +36,7 @@ xml::XPath::XPath(const char* name) { * Los nodos se recuperan mediante los métodos node_begin, node_end y node */ void xml::XPath::apply(const Document& document, const char* expression, const int mode) -throw(RuntimeException) { +noexcept(false) { a_mode = mode; ConfigSkeleton configSkeleton(&XPath::callbackApply); @@ -47,7 +47,7 @@ throw(RuntimeException) { } bool xml::XPath::match(const Document& document, const char* expression, const int mode) -throw(RuntimeException) { +noexcept(false) { a_result = false; ConfigSkeleton configSkeleton(&XPath::callbackMatch); @@ -65,7 +65,7 @@ throw(RuntimeException) { } const xml::Node* xml::XPath::find(const Document& document, const char* expression, const int mode, const Exception::Mode::_v emode) -throw(RuntimeException) { +noexcept(false) { apply(document, expression, mode); Node::const_child_iterator ii = node_begin(); @@ -96,7 +96,7 @@ throw(RuntimeException) { } void xml::XPath::skeleton(const Document& document, const char* expression, xml::XPath::ConfigSkeleton& config) -throw(RuntimeException) { +noexcept(false) { LOGDEBUG( string msg("xml::XPath::skeleton | Document: "); msg += functions::asString(document.getContent()); @@ -146,7 +146,7 @@ throw(RuntimeException) { * lo que nos obliga a recorrerlo en profundidad. */ void xml::XPath::initializeNamespaces(_xmlXPathContext* context, const Document& document) -throw(RuntimeException) { +noexcept(false) { xmlNode* root; if((root = xmlDocGetRootElement(document.a_handle)) == NULL) @@ -157,7 +157,7 @@ throw(RuntimeException) { } void xml::XPath::forwardNamespaces(_xmlXPathContext* context, _xmlNode* xmlNode) -throw(RuntimeException) { +noexcept(false) { while(xmlNode != NULL) { if(xmlNode->type == XML_ELEMENT_NODE) { for(xmlNs* ns = xmlNode->nsDef; ns != NULL; ns = ns->next) { @@ -214,7 +214,7 @@ void xml::XPath::callbackMatch(const _xmlNodeSet* nodes) { } void xml::XPath::text(Node* node, xmlNode* xmlNode) -throw(RuntimeException) { +noexcept(false) { bool isSeparator; const char* w; diff --git a/source/xml/functions.cpp b/source/xml/functions.cpp index 0fde737..2e4c81f 100644 --- a/source/xml/functions.cpp +++ b/source/xml/functions.cpp @@ -12,7 +12,7 @@ #include void anna::xml::functions::initialize() -throw() { +{ xml::sccs::activate(); xmlInitMemory(); } diff --git a/source/xml/internal/sccs.cpp b/source/xml/internal/sccs.cpp index ec25e58..9738d8d 100644 --- a/source/xml/internal/sccs.cpp +++ b/source/xml/internal/sccs.cpp @@ -15,7 +15,7 @@ anna_define_sccs_tag(xml, 0) void anna::xml::sccs::activate() -throw() { +{ anna::sccs::activate(); anna::io::sccs::activate(); ModuleManager::instantiate().insert(anna_use_sccs_tag(xml), "00");