NGSolve  4.9
ngstd/exception.hpp
00001 #ifndef FILE_EXCEPTION
00002 #define FILE_EXCEPTION
00003 
00004 /**************************************************************************/
00005 /* File:   exception.hpp                                                  */
00006 /* Author: Joachim Schoeberl                                              */
00007 /* Date:   16. Jan. 2002                                                  */
00008 /**************************************************************************/
00009 
00010 namespace ngstd
00011 {
00012 
00013 #ifdef DEBUG
00014 #define CHECK_RANGE
00015 #endif
00016 
00017 
00018 
00020 class NGS_DLL_HEADER Exception 
00021 {
00023   string what;
00024 public:
00026   Exception (const string & s);
00028   Exception (const char * s);
00030   virtual ~Exception ();
00031 
00033   void Append (const string & s);
00035   void Append (const char * s);
00036 
00038   const string & What() const { return what; }
00039 };
00040 
00041 
00042 
00044 class NGS_DLL_HEADER RangeException : public Exception
00045 {
00046 public:
00048   RangeException (const string & where, 
00049                   int ind, int imin, int imax);
00050 };
00051 
00052 }
00053 
00054 #endif