00001 // -*- C++ -*- 00002 // 00003 // This file is part of libgvectors. 00004 // libgvectors is a C++ library intended for visualizing mathematical vectors. 00005 // Copyright (C) 2007 Rafael Ostertag 00006 // 00007 // This program is free software; you can redistribute it and/or 00008 // modify it under the terms of the GNU General Public License 00009 // as published by the Free Software Foundation; either version 2 00010 // of the License, or (at your option) any later version. 00011 // 00012 // This program is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU General Public License 00018 // along with this program; if not, write to the Free Software 00019 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00020 // USA. 00021 // 00022 // $Id: gvexceptions_8h-source.html,v 1.1 2007-09-08 19:02:35 rafi Exp $ 00023 // 00024 // File: gvexceptions.h 00025 // Author: Rafael Ostertag 00026 // 00027 // Created on July 15, 2007, 12:48 PM 00028 // 00029 00039 #ifndef _GVEXCEPTIONS_H 00040 #define _GVEXCEPTIONS_H 00041 00042 #include <exception> 00043 #include <string> 00044 00045 #include <gvectors-config.h> 00046 00047 namespace GVectors { 00048 00055 class GVException : public std::exception { 00056 protected: 00062 std::string str_what; 00063 00064 public: 00066 explicit GVException() throw(); 00068 explicit GVException(const std::string& w) throw(); 00070 virtual ~GVException() throw(); 00072 virtual const char* what() const throw(); 00073 }; 00074 00080 class GVEUnsupported : public GVException { 00081 public: 00083 explicit GVEUnsupported() throw(); 00085 explicit GVEUnsupported(const std::string &w) throw(); 00087 virtual ~GVEUnsupported() throw(); 00088 }; 00089 00095 class GVEDynCastFailed : public GVException { 00096 public: 00098 explicit GVEDynCastFailed() throw(); 00100 explicit GVEDynCastFailed(const std::string &w) throw(); 00102 virtual ~GVEDynCastFailed() throw(); 00103 }; 00104 00111 class GVEItemNotFound : public GVException { 00112 public: 00114 explicit GVEItemNotFound() throw(); 00116 explicit GVEItemNotFound(const std::string &w) throw(); 00118 virtual ~GVEItemNotFound() throw(); 00119 }; 00120 00127 class GVEInvalidMatrixIndex : public GVException { 00128 public: 00130 explicit GVEInvalidMatrixIndex() throw(); 00132 explicit GVEInvalidMatrixIndex(const std::string &w) throw(); 00134 virtual ~GVEInvalidMatrixIndex() throw(); 00135 }; 00136 00144 class GVEInvalidMDimension : public GVException { 00145 public: 00147 explicit GVEInvalidMDimension() throw(); 00149 explicit GVEInvalidMDimension(const std::string &w) throw(); 00151 virtual ~GVEInvalidMDimension() throw(); 00152 }; 00153 00161 class GVEStoreCorrupt : public GVException { 00162 public: 00164 explicit GVEStoreCorrupt() throw(); 00166 explicit GVEStoreCorrupt(const std::string &w) throw(); 00168 virtual ~GVEStoreCorrupt() throw(); 00169 }; 00170 00171 #if defined(HAVE_GFILEIO) || defined(HAVE_LIBXML) 00172 00178 class GVEWrongFileVersion : public GVException { 00179 public: 00181 explicit GVEWrongFileVersion() throw(); 00183 explicit GVEWrongFileVersion(const std::string& w) throw(); 00185 virtual ~GVEWrongFileVersion() throw(); 00186 }; 00187 #endif /* HAVE_GFILEIO or HAVE_LIBXML*/ 00188 00189 #ifdef HAVE_LIBXML 00190 00197 class GVEXMLFileWrite : public GVException { 00198 public: 00200 explicit GVEXMLFileWrite() throw(); 00202 explicit GVEXMLFileWrite(const std::string& w) throw(); 00204 virtual ~GVEXMLFileWrite() throw(); 00205 }; 00206 00218 class GVEXMLInvalid : public GVException { 00219 public: 00221 explicit GVEXMLInvalid() throw(); 00223 explicit GVEXMLInvalid(const std::string& w) throw(); 00225 virtual ~GVEXMLInvalid() throw(); 00226 }; 00227 #endif /* HAVE_LIBXML */ 00228 00229 } 00230 00231 #endif /* _GVEXCEPTIONS_H */
1.4.7