| 1 |
/* |
| 2 |
* Copyright (C) 1996-2011 Daniel Waggoner |
| 3 |
* |
| 4 |
* This free software: you can redistribute it and/or modify |
| 5 |
* it under the terms of the GNU General Public License as published by |
| 6 |
* the Free Software Foundation, either version 3 of the License, or |
| 7 |
* (at your option) any later version. |
| 8 |
* |
| 9 |
* It is distributed in the hope that it will be useful, |
| 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
* GNU General Public License for more details. |
| 13 |
* |
| 14 |
* If you did not received a copy of the GNU General Public License |
| 15 |
* with this software, see <http://www.gnu.org/licenses/>. |
| 16 |
*/ |
| 17 |
|
| 18 |
#ifndef __DW_EXECPTIONS__ |
| 19 |
#define __DW_EXECPTIONS__ |
| 20 |
|
| 21 |
#include <typeinfo> |
| 22 |
|
| 23 |
class dw_exception : public std::exception |
| 24 |
{ |
| 25 |
public: |
| 26 |
dw_exception() throw() { }; |
| 27 |
dw_exception(const dw_exception& err) throw() { }; |
| 28 |
dw_exception& operator=(const dw_exception& err) throw() { }; |
| 29 |
|
| 30 |
virtual const char* what() throw() { return "dw: unspecified error"; }; |
| 31 |
}; |
| 32 |
|
| 33 |
class dw_arg_error : public dw_exception |
| 34 |
{ |
| 35 |
public: |
| 36 |
dw_arg_error() throw() : dw_exception() { }; |
| 37 |
|
| 38 |
virtual const char* what() throw() { return "dw: argument error"; }; |
| 39 |
}; |
| 40 |
|
| 41 |
class dw_mem_error : public dw_exception |
| 42 |
{ |
| 43 |
public: |
| 44 |
dw_mem_error() throw() : dw_exception() { }; |
| 45 |
|
| 46 |
virtual const char* what() throw() { return "dw: memory error"; }; |
| 47 |
}; |
| 48 |
|
| 49 |
class dw_fnct_error : public dw_exception |
| 50 |
{ |
| 51 |
public: |
| 52 |
dw_fnct_error() throw() : dw_exception() { }; |
| 53 |
|
| 54 |
virtual const char* what() throw() { return "dw: function error"; }; |
| 55 |
}; |
| 56 |
|
| 57 |
class dw_dim_error : public dw_exception |
| 58 |
{ |
| 59 |
public: |
| 60 |
dw_dim_error() throw() : dw_exception() { }; |
| 61 |
|
| 62 |
virtual const char* what() throw() { return "dw: dimension error"; }; |
| 63 |
}; |
| 64 |
|
| 65 |
class dw_sing_error : public dw_exception |
| 66 |
{ |
| 67 |
public: |
| 68 |
dw_dim_error() throw() : dw_exception() { }; |
| 69 |
|
| 70 |
virtual const char* what() throw() { return "dw: singularity error"; }; |
| 71 |
}; |
| 72 |
|
| 73 |
#endif |