| 1 |
// SALOME Utils : general SALOME's definitions and tools |
| 2 |
// |
| 3 |
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, |
| 4 |
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS |
| 5 |
// |
| 6 |
// This library is free software; you can redistribute it and/or |
| 7 |
// modify it under the terms of the GNU Lesser General Public |
| 8 |
// License as published by the Free Software Foundation; either |
| 9 |
// version 2.1 of the License. |
| 10 |
// |
| 11 |
// This library is distributed in the hope that it will be useful, |
| 12 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 |
// Lesser General Public License for more details. |
| 15 |
// |
| 16 |
// You should have received a copy of the GNU Lesser General Public |
| 17 |
// License along with this library; if not, write to the Free Software |
| 18 |
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 |
// |
| 20 |
// See http://www.salome-platform.org/ or email : [email protected] |
| 21 |
|
| 22 |
#if !defined( __SMESH_Exception_hxx__ ) |
| 23 |
#define __SMESH_Exception_hxx__ |
| 24 |
|
| 25 |
# include <exception> |
| 26 |
# include <iostream> |
| 27 |
|
| 28 |
#ifdef _DEBUG_ |
| 29 |
# define LOCALIZED(message) #message , __FILE__ , __LINE__ |
| 30 |
#else |
| 31 |
# define LOCALIZED(message) #message |
| 32 |
#endif |
| 33 |
|
| 34 |
#if defined SMESH_EXPORTS |
| 35 |
#if defined WIN32 |
| 36 |
#define SMESH_EXPORT __declspec( dllexport ) |
| 37 |
#else |
| 38 |
#define SMESH_EXPORT |
| 39 |
#endif |
| 40 |
#else |
| 41 |
#if defined WNT |
| 42 |
#define SMESH_EXPORT __declspec( dllimport ) |
| 43 |
#else |
| 44 |
#define SMESH_EXPORT |
| 45 |
#endif |
| 46 |
#endif |
| 47 |
|
| 48 |
class SMESH_EXPORT SMESH_Exception : public std::exception |
| 49 |
{ |
| 50 |
|
| 51 |
private : |
| 52 |
SMESH_Exception( void ); |
| 53 |
|
| 54 |
protected : |
| 55 |
const char* _text ; // non constant pointer but read only char variable |
| 56 |
|
| 57 |
public : |
| 58 |
SMESH_Exception( const char *text, const char *fileName=0, const unsigned int lineNumber=0 ); |
| 59 |
SMESH_Exception( const SMESH_Exception &ex ); |
| 60 |
~SMESH_Exception() throw (); |
| 61 |
friend std::ostream & operator<<( std::ostream &os , const SMESH_Exception &ex ); |
| 62 |
virtual const char *what( void ) const throw () ; |
| 63 |
} ; |
| 64 |
|
| 65 |
|
| 66 |
#endif /* #if !defined( __SMESH_Exception_hxx__ ) */ |