X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdbos%2Fworkdir%2Fstorage%2FFile.cpp;h=a9357de440801c22c331e127af5821128ebba623;hb=5a6cba5fde2b2f538a7515f8293cc0a8d9589dfa;hp=de7a53a2c842687589ab12ecfcab516c31f2b7e9;hpb=39033fd99e58e994a5e98c1060dcc79e0d81f9c9;p=anna.git diff --git a/example/dbos/workdir/storage/File.cpp b/example/dbos/workdir/storage/File.cpp index de7a53a..a9357de 100644 --- a/example/dbos/workdir/storage/File.cpp +++ b/example/dbos/workdir/storage/File.cpp @@ -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 // #include @@ -66,7 +38,7 @@ int storage::File::st_maxSize = 0; dbos_prepare_object (storage::File); void storage::File::setup (dbos::Repository& repository, const int maxSize) - throw (RuntimeException) + noexcept(false) { st_loader = new File::Loader (); st_maxSize = maxSize; @@ -80,7 +52,7 @@ void storage::File::setup (dbos::Repository& repository, const int maxSize) } storage::File* storage::File::instantiate (const filesystem::File* file) - throw (RuntimeException) + noexcept(false) { if (st_loader == NULL) throw RuntimeException ("storage::File::setup no ha sido invocado", ANNA_FILE_LOCATION); @@ -99,14 +71,14 @@ storage::File* storage::File::instantiate (const filesystem::File* file) } void storage::File::initialize (dbos::Loader& loader) - throw (RuntimeException, dbms::DatabaseException) + noexcept(false) { File::Loader& dbLoader = static_cast (loader); - + a_filesystemFile = dbLoader.getFile (); a_parent = Directory::instantiate (filesystem::Directory::down_cast (a_filesystemFile->getParent ())); a_inode = dbLoader.getINode (); - + LOGINFORMATION ( string msg ("storage::File::initialize | "); msg += asString (); @@ -115,18 +87,18 @@ void storage::File::initialize (dbos::Loader& loader) } void storage::File::destroy () - throw () -{ + +{ LOGINFORMATION ( string msg ("storage::File::destroy | "); msg += asString (); Logger::information (msg, ANNA_FILE_LOCATION); ); - Directory::release (a_parent); + Directory::release (a_parent); } string storage::File::asString () const - throw () + { std::string result ("storage::File { Name: "); result += a_filesystemFile->getPath (); @@ -134,25 +106,25 @@ string storage::File::asString () const return result += " }"; } -/* +/* * Transfiere la información del medio físico al primer nivel de C++. * Posteriormente será interpretada en storage::File::initialize */ -bool storage::File::Loader::load (dbms::Connection*, const dbos::StorageArea* ssaa) - throw (RuntimeException) +bool storage::File::Loader::load (dbms::Connection*, const dbos::StorageArea* ssaa) + noexcept(false) { a_inode = io::functions::getINode (a_filesystemFile->getPath ()); return true; } -dbos::Index storage::File::Loader::getIndex () const - throw () +dbos::Index storage::File::Loader::getIndex () const + { - return st_hash.calcule (a_filesystemFile->getPath ()); + return st_hash.calcule (a_filesystemFile->getPath ()); } string storage::File::Loader::asString () const - throw () + { std::string result ("storage::Loader::File { Name: "); result += a_filesystemFile->getPath ();