Remove dynamic exceptions
[anna.git] / include / anna / comm / ByRangeDelivery.hpp
index 729bde1..0895029 100644 (file)
@@ -1,37 +1,9 @@
-// ANNA - Anna is Not Nothingness Anymore
-//
-// (c) Copyright 2005-2014 Eduardo Ramos Testillano & Francisco Ruiz Rayo
-//
-// http://redmine.teslayout.com/projects/anna-suite
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     *  Neither the name of the copyright holder nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: eduardo.ramos.testillano@gmail.com
-//          cisco.tierra@gmail.com
+// ANNA - Anna is Not Nothingness Anymore                                                         //
+//                                                                                                //
+// (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
+//                                                                                                //
+// See project site at http://redmine.teslayout.com/projects/anna-suite                           //
+// See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
 
 
 #ifndef anna_comm_ByRangeDelivery_hpp
@@ -85,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: ";
@@ -95,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));
@@ -140,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) {
@@ -178,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);
   }
@@ -188,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)) {
@@ -210,7 +182,7 @@ public:
   }
 
   std::string asString() const
-  throw() {
+  {
     std::string result = className();
     result += " { ";
     result += comm::Delivery::asString();
@@ -225,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);
 
@@ -241,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();
   }
@@ -263,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;
 
@@ -280,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";
@@ -292,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;
 
@@ -308,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 ++) {