include/exception.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  * vim: set noet sw=8 cino=:
00003  * Copyright (c) 2006  Matthew Nicholson <matt@matt-land.com>
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018  */
00019  
00020 #ifndef _EXCEPTION_H
00021 #define _EXCEPTION_H
00022 
00023 #include <exception>
00024 #include <string>
00025 
00026 namespace VDrift
00027 {
00028 
00029 class EXCEPTION : public std::exception 
00030 {
00031         public:
00032                 explicit EXCEPTION(const std::string& description) : std::exception(), description(description)
00033                 {
00034                 }
00035 
00036                 virtual const char* what() const throw()
00037                 {
00038                         return description.c_str();
00039                 }
00040 
00041                 virtual ~EXCEPTION() throw() { }
00042         private:
00043                 std::string description;
00044                 
00045 };
00046 
00047 class INIT_ERROR : public EXCEPTION
00048 {
00049         public:
00050                 INIT_ERROR() : EXCEPTION("Initilization error") { }
00051                 explicit INIT_ERROR(const std::string& description) : EXCEPTION(description) { }
00052                 virtual ~INIT_ERROR() throw() { }
00053 };
00054 
00055 }
00056 
00057 
00058 #endif /* _EXCEPTION_H */

Generated on Thu Oct 19 04:05:47 2006 by  doxygen 1.4.6