Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

gul_error.h

Go to the documentation of this file.
00001 /* LIBGUL - Geometry Utility Library
00002  * Copyright (C) 1998-1999 Norbert Irmer
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Library General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Library General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Library General Public
00015  * License along with this library; if not, write to the
00016  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017  * Boston, MA 02111-1307, USA.
00018  */
00019 
00020 #ifndef GUL_ERROR_H
00021 #define GUL_ERROR_H
00022 
00023 namespace gul {
00024 
00025 class Error
00026 {
00027 public:
00028   virtual int number() { return(1); }
00029   virtual const char *descr() { return("General error\n"); }
00030 };
00031 
00032 class AllocError : public Error
00033 {
00034 public:
00035   virtual int number() { return(2); }
00036   virtual const char *descr() { return("Alloc error\n"); }
00037 };
00038 
00039 class PoolAllocError : public Error
00040 {
00041 public:
00042   virtual int number() { return(3); }
00043   virtual const char *descr() { return("PoolAlloc error\n"); }
00044 };
00045 
00046 class InternalError : public Error
00047 {
00048 public:
00049   virtual int number() { return(4); }
00050   virtual const char *descr() 
00051   { return("Internal error - please contact authors\n"); }
00052 };
00053 
00054 class IntervalDivZeroError : public Error
00055 {
00056 public:
00057   virtual int number() { return(5); }
00058   virtual const char *descr() 
00059   { return("Division by neighborhood of 0 interval\n"); }
00060 };
00061 
00062 class SingularMatrixError : public Error
00063 {
00064 public:
00065   virtual int number() { return(6); }
00066   virtual const char *descr() 
00067   { return("Singular matrix encountered\n"); }
00068 };
00069 
00070 
00071 template < class X, class A > 
00072 inline void Assert( A assertion )
00073 {
00074  if(!assertion) throw X();
00075 }
00076 
00077 
00078 }
00079  
00080 #endif

Generated on Mon Jan 21 04:17:32 2002 for GUL 0.6 - Geometry Utility Library by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001