Remove dynamic exceptions
[anna.git] / include / anna / dbos / ObjectFacade.hpp
index 0426749..922da40 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_dbos_ObjectFacade_hpp
@@ -82,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
@@ -98,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));
   }
 
@@ -124,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 ";
@@ -153,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 ";
@@ -186,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 ";
@@ -215,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 ";
@@ -242,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 ";
@@ -266,7 +238,7 @@ public:
      objetos ofrecidos por esta clase no tendra ningun efecto.
   */
   static void release(T*& t)
-  throw() {
+  {
     if(st_storageArea == NULL)
       return;
 
@@ -281,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);
 
@@ -300,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);
 
@@ -316,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);
 
@@ -331,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";
@@ -351,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";
@@ -373,7 +345,7 @@ public:
      al metodo #release para esta instancia.
   */
   static void erase(T*& t)
-  throw(RuntimeException) {
+  noexcept(false) {
     if(st_storageArea == NULL)
       return;
 
@@ -384,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 <T*>(StorageArea::data(ii)); }
+  static T* data(StorageArea::iterator& ii) { return static_cast <T*>(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 <const T*>(StorageArea::data(ii)); }
+  static const T* data(StorageArea::const_iterator& ii) { return static_cast <const T*>(StorageArea::data(ii)); }
 
   /**
      Metodo creador de nuevas instancias de la clase T.
@@ -398,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;