Remove dynamic exceptions
[anna.git] / include / anna / dbms / ResultCode.hpp
index 7823292..ef23bf3 100644 (file)
@@ -1,37 +1,9 @@
-// ANNA - Anna is Not Nothingness Anymore
-//
-// (c) Copyright 2005-2014 Eduardo Ramos Testillano & Francisco Ruiz Rayo
-//
-// https://bitbucket.org/testillano/anna
-//
-// 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 Google Inc. 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_dbms_ResultCode_hpp
@@ -82,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
   /**
@@ -97,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);
@@ -112,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
@@ -120,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
@@ -130,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;
@@ -153,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;
   };
 
   /**
@@ -180,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);
   }
@@ -190,7 +162,7 @@ private:
   char* a_errorText;
   const ErrorDecoder* a_errorDecoder;
 
-  void copy(const char* text) throw();
+  void copy(const char* text) ;
 };
 
 }