[657] | 1 | /************************************************************************
|
---|
| 2 | filename: CEGUIExceptions.h
|
---|
| 3 | created: 20/2/2004
|
---|
| 4 | author: Paul D Turner
|
---|
| 5 |
|
---|
| 6 | purpose: Defines exceptions used within the system
|
---|
| 7 | *************************************************************************/
|
---|
| 8 | /*************************************************************************
|
---|
| 9 | Crazy Eddie's GUI System (http://www.cegui.org.uk)
|
---|
| 10 | Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
|
---|
| 11 |
|
---|
| 12 | This library is free software; you can redistribute it and/or
|
---|
| 13 | modify it under the terms of the GNU Lesser General Public
|
---|
| 14 | License as published by the Free Software Foundation; either
|
---|
| 15 | version 2.1 of the License, or (at your option) any later version.
|
---|
| 16 |
|
---|
| 17 | This library is distributed in the hope that it will be useful,
|
---|
| 18 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
| 20 | Lesser General Public License for more details.
|
---|
| 21 |
|
---|
| 22 | You should have received a copy of the GNU Lesser General Public
|
---|
| 23 | License along with this library; if not, write to the Free Software
|
---|
| 24 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
| 25 | *************************************************************************/
|
---|
| 26 | #ifndef _CEGUIExceptions_h_
|
---|
| 27 | #define _CEGUIExceptions_h_
|
---|
| 28 |
|
---|
| 29 | #include "CEGUIBase.h"
|
---|
| 30 | #include "CEGUIString.h"
|
---|
| 31 |
|
---|
| 32 |
|
---|
| 33 | // Start of CEGUI namespace section
|
---|
| 34 | namespace CEGUI
|
---|
| 35 | {
|
---|
| 36 | /*!
|
---|
| 37 | \brief
|
---|
| 38 | Root exception class used within the GUI system.
|
---|
| 39 | */
|
---|
| 40 | class CEGUIEXPORT Exception
|
---|
| 41 | {
|
---|
| 42 | public:
|
---|
| 43 | /*************************************************************************
|
---|
| 44 | Construction and Destruction
|
---|
| 45 | *************************************************************************/
|
---|
| 46 | Exception(const String& message);
|
---|
| 47 | virtual ~Exception(void);
|
---|
| 48 |
|
---|
| 49 | /*!
|
---|
| 50 | \brief
|
---|
| 51 | Return a reference to the String object describing the reason for the exception being thrown.
|
---|
| 52 |
|
---|
| 53 | \return
|
---|
| 54 | String object containing a message describing the reason for the exception.
|
---|
| 55 | */
|
---|
| 56 | const String& getMessage(void) const {return d_message;}
|
---|
| 57 |
|
---|
| 58 |
|
---|
| 59 | protected:
|
---|
| 60 | String d_message;
|
---|
| 61 | };
|
---|
| 62 |
|
---|
| 63 | /*!
|
---|
| 64 | \brief
|
---|
| 65 | Exception class used when none of the other classes are applicable
|
---|
| 66 | */
|
---|
| 67 | class CEGUIEXPORT GenericException : public Exception
|
---|
| 68 | {
|
---|
| 69 | public:
|
---|
| 70 | /*************************************************************************
|
---|
| 71 | Construction and Destruction
|
---|
| 72 | *************************************************************************/
|
---|
| 73 | GenericException(const String& message) : Exception(message) {}
|
---|
| 74 | };
|
---|
| 75 |
|
---|
| 76 | /*!
|
---|
| 77 | \brief
|
---|
| 78 | Exception class used when a request was made using a name of an unknown object
|
---|
| 79 | */
|
---|
| 80 | class CEGUIEXPORT UnknownObjectException : public Exception
|
---|
| 81 | {
|
---|
| 82 | public:
|
---|
| 83 | /*************************************************************************
|
---|
| 84 | Construction and Destruction
|
---|
| 85 | *************************************************************************/
|
---|
| 86 | UnknownObjectException(const String& message) : Exception(message) {}
|
---|
| 87 | };
|
---|
| 88 |
|
---|
| 89 | /*!
|
---|
| 90 | \brief
|
---|
| 91 | Exception class used when some impossible request was made for the current system state
|
---|
| 92 | */
|
---|
| 93 | class CEGUIEXPORT InvalidRequestException : public Exception
|
---|
| 94 | {
|
---|
| 95 | public:
|
---|
| 96 | /*************************************************************************
|
---|
| 97 | Construction and Destruction
|
---|
| 98 | *************************************************************************/
|
---|
| 99 | InvalidRequestException(const String& message) : Exception(message) {}
|
---|
| 100 | };
|
---|
| 101 |
|
---|
| 102 | /*!
|
---|
| 103 | \brief
|
---|
| 104 | Exception class used when a file handling problem occurs
|
---|
| 105 | */
|
---|
| 106 | class CEGUIEXPORT FileIOException : public Exception
|
---|
| 107 | {
|
---|
| 108 | public:
|
---|
| 109 | /*************************************************************************
|
---|
| 110 | Construction and Destruction
|
---|
| 111 | *************************************************************************/
|
---|
| 112 | FileIOException(const String& message) : Exception(message) {}
|
---|
| 113 | };
|
---|
| 114 |
|
---|
| 115 | /*!
|
---|
| 116 | \brief
|
---|
| 117 | Exception class used when an problem is detected within the Renderer or related objects
|
---|
| 118 | */
|
---|
| 119 | class CEGUIEXPORT RendererException : public Exception
|
---|
| 120 | {
|
---|
| 121 | public:
|
---|
| 122 | /*************************************************************************
|
---|
| 123 | Construction and Destruction
|
---|
| 124 | *************************************************************************/
|
---|
| 125 | RendererException(const String& message) : Exception(message) {}
|
---|
| 126 | };
|
---|
| 127 |
|
---|
| 128 | /*!
|
---|
| 129 | \brief
|
---|
| 130 | Exception class used when an attempt is made to use an object name that is already in use within the system
|
---|
| 131 | */
|
---|
| 132 | class CEGUIEXPORT AlreadyExistsException : public Exception
|
---|
| 133 | {
|
---|
| 134 | public:
|
---|
| 135 | /*************************************************************************
|
---|
| 136 | Construction and Destruction
|
---|
| 137 | *************************************************************************/
|
---|
| 138 | AlreadyExistsException(const String& message) : Exception(message) {}
|
---|
| 139 | };
|
---|
| 140 |
|
---|
| 141 | /*!
|
---|
| 142 | \brief
|
---|
| 143 | Exception class used when a memory handling error is detected
|
---|
| 144 | */
|
---|
| 145 | class CEGUIEXPORT MemoryException : public Exception
|
---|
| 146 | {
|
---|
| 147 | public:
|
---|
| 148 | /*************************************************************************
|
---|
| 149 | Construction and Destruction
|
---|
| 150 | *************************************************************************/
|
---|
| 151 | MemoryException(const String& message) : Exception(message) {}
|
---|
| 152 | };
|
---|
| 153 |
|
---|
| 154 | /*!
|
---|
| 155 | \brief
|
---|
| 156 | Exception class used when some required object or parameter is null
|
---|
| 157 | */
|
---|
| 158 | class CEGUIEXPORT NullObjectException : public Exception
|
---|
| 159 | {
|
---|
| 160 | public:
|
---|
| 161 | /*************************************************************************
|
---|
| 162 | Construction and Destruction
|
---|
| 163 | *************************************************************************/
|
---|
| 164 | NullObjectException(const String& message) : Exception(message) {}
|
---|
| 165 | };
|
---|
| 166 |
|
---|
| 167 | /*Q
|
---|
| 168 | \brief
|
---|
| 169 | Exception class used when some attempt to delete, remove, or otherwise invalidate some object that is still in use occurs.
|
---|
| 170 | */
|
---|
| 171 | class CEGUIEXPORT ObjectInUseException : public Exception
|
---|
| 172 | {
|
---|
| 173 | public:
|
---|
| 174 | /*************************************************************************
|
---|
| 175 | Construction and Destruction
|
---|
| 176 | *************************************************************************/
|
---|
| 177 | ObjectInUseException(const String& message) : Exception(message) {}
|
---|
| 178 | };
|
---|
| 179 |
|
---|
| 180 |
|
---|
| 181 | } // End of CEGUI namespace section
|
---|
| 182 |
|
---|
| 183 |
|
---|
| 184 | #endif // end of guard _CEGUIExceptions_h_
|
---|