X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=include%2Fanna%2Fdbms%2FResultCode.hpp;h=ef23bf3e405cd32457b2c20b78b7cd7e4e01d5ec;hb=5a6cba5fde2b2f538a7515f8293cc0a8d9589dfa;hp=40261b7abd4e115ec7dedd1dbeec1e5aeaa526d7;hpb=39033fd99e58e994a5e98c1060dcc79e0d81f9c9;p=anna.git diff --git a/include/anna/dbms/ResultCode.hpp b/include/anna/dbms/ResultCode.hpp index 40261b7..ef23bf3 100644 --- a/include/anna/dbms/ResultCode.hpp +++ b/include/anna/dbms/ResultCode.hpp @@ -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_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) ; }; }