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://oncora1.lyon.fnclcc.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
23 #include "clitkCommon.h"
26 #include "itkExceptionObject.h"
30 //--------------------------------------------------------------------
31 class ExceptionObject: public itk::ExceptionObject {
33 ExceptionObject(const char *file,
34 unsigned int lineNumber=0,
35 const char *desc="None");
36 virtual ~ExceptionObject() throw() {}
37 virtual const char* what() const throw();
38 std::string m_Message;
40 std::string m_Filename;
42 //--------------------------------------------------------------------
44 //--------------------------------------------------------------------
45 // Largely inspired from itkExceptionMacro, but work without
47 #define clitkExceptionMacro(x) \
49 ::itk::OStringStream message; \
51 ::clitk::ExceptionObject e_(__FILE__, __LINE__, message.str().c_str()); \
52 throw e_; /* Explicit naming to work around Intel compiler bug. */ \
54 //--------------------------------------------------------------------
56 } // end namespace clitk
57 //--------------------------------------------------------------------
59 #endif // CLITKEXCEPTIONOBJECT_H