]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Change another small piece in the exception handling mechanism.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 1 Nov 1998 22:22:51 +0000 (22:22 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 1 Nov 1998 22:22:51 +0000 (22:22 +0000)
git-svn-id: https://svn.dealii.org/trunk@618 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/exceptions.h

index b3293c7683c3b89b3dcde06e3d67e2bc81a5d1de..fef9d1119df2826c923f0fb7d070bd5b66b8a6c6 100644 (file)
@@ -6,6 +6,8 @@
 
 
 #include <iostream.h>
+#include <exception>
+
 
 
 
@@ -25,7 +27,7 @@
                                  *  @see DeclException0
                                  *  @author Wolfgang Bangerth, November 1997
                                  */
-class ExceptionBase {
+class ExceptionBase : public exception {
   public:
     ExceptionBase () :
                    file(""), line(0), function(""), cond(""), exc("")  {};
@@ -45,6 +47,7 @@ class ExceptionBase {
                                      * put it here.
                                      */
     ExceptionBase (const ExceptionBase &e) :
+                   exception(e),
                    file(e.file), line(e.line), function(e.function),
                    cond(e.cond), exc(e.exc) {};
 
@@ -54,11 +57,11 @@ class ExceptionBase {
                                      * put it here.
                                      */
     ExceptionBase & operator = (const ExceptionBase &e) {
-      file = e.file;
-      line = e.line;
+      file     = e.file;
+      line     = e.line;
       function = e.function;
-      cond = e.cond;
-      exc = e.exc;
+      cond     = e.cond;
+      exc      = e.exc;
       return *this;
     };
     
@@ -110,6 +113,21 @@ class ExceptionBase {
     };
 
     
+                                    /**
+                                     *  Function derived from the base class
+                                     *  which allows to pass information like
+                                     *  the line and name of the file where the
+                                     *  exception occured as well as user
+                                     *  information.
+                                     *
+                                     *  This function is mainly used when using
+                                     *  exceptions declared by the
+                                     *  #DeclException*# macros with the #throw#
+                                     *  mechanism or the #Assert_or_Throw# macro.
+                                     */
+//    virtual const char * what () const;
+
+    
     const char *file;
     int         line;
     const char *function;
@@ -429,8 +447,6 @@ class Exception5 : public ExceptionBase {                             \
                           way.
 */
 
-#include <exception>
-
 
 /**
  * Exception class to be thrown whenever an I/O operation in the library

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.