-// ANNA - Anna is Not 'N' 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_Connection_hpp
/**
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
\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;
\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
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:
/**
/**
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.
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;
};