/*========================================================================= Program: crea Module: $RCSfile: creaException.h,v $ Language: C++ Date: $Date: 2009/06/04 14:24:07 $ Version: $Revision: 1.2 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or http://www.creatis.insa-lyon.fr/Public/crea/License.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ /** * \file * \brief class Exception:generic class for throwing any exception (header) * * Long description: */ /** * \class crea::Exception * \brief class Exception : generic class for throwing any exception * * Long description: */ #ifndef __creaException_h__ #define __creaException_h__ #include "creaSystem.h" #include "creaMessageManager.h" #include namespace crea { inline std::string bbGetObjectDescription() { return(""); } class CREA_EXPORT Exception : public std::exception { public: Exception(const std::string& object, const std::string& source_file, const std::string& message) throw() : mObject(object), mSourceFile(source_file), mMessage(message) { mWhatMessage = " * ERROR : " + mMessage + " * OBJECT : " + mObject + " * FILE " + mSourceFile; } ~Exception() throw() {} virtual const char* what() const throw() { return mWhatMessage.c_str(); } void Print() throw() { std::cerr << "* ERROR : " << mMessage < 0) { std::cerr << "* OBJECT : " <