1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
5 - University of LYON http://www.universite-lyon.fr/
6 - Léon Bérard cancer center http://www.centreleonberard.fr
7 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the copyright notices for more information.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
19 #ifndef CLITKEXCEPTIONOBJECT_H
20 #define CLITKEXCEPTIONOBJECT_H
25 #include "clitkCommon.h"
32 //--------------------------------------------------------------------
33 class ExceptionObject: public itk::ExceptionObject {
35 ExceptionObject(const char *file,
36 unsigned int lineNumber=0,
37 const char *desc="None");
38 virtual ~ExceptionObject() throw() {}
39 virtual const char* what() const throw();
40 std::string m_Message;
42 std::string m_Filename;
44 //--------------------------------------------------------------------
46 //--------------------------------------------------------------------
47 // Largely inspired from itkExceptionMacro, but work without
49 #define clitkExceptionMacro(x) \
51 std::ostringstream message; \
53 ::clitk::ExceptionObject e_(__FILE__, __LINE__, message.str().c_str()); \
54 throw e_; /* Explicit naming to work around Intel compiler bug. */ \
56 //--------------------------------------------------------------------
58 } // end namespace clitk
59 //--------------------------------------------------------------------
61 #endif // CLITKEXCEPTIONOBJECT_H