SO3Engine
SO3Exception.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OpenSpace3D
4For the latest info, see http://www.openspace3d.com
5
6Copyright (c) 2012 I-maginer
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://www.gnu.org/copyleft/lesser.txt
21
22-----------------------------------------------------------------------------
23*/
24
25#ifndef __SO3_EXCEPTION_H__
26#define __SO3_EXCEPTION_H__
27
29
30namespace SO3
31{
32
36 class _SO3_Export SException : public std::exception
37 {
38 public:
39 protected:
40 long line;
41 std::string typeName;
42 std::string description;
43 std::string source;
44 std::string file;
46 mutable std::string fullDesc;
47 private:
48
49 public:
53 SException(const std::string& exceptDescription, const std::string& exceptSource, bool exceptToLogFile);
54
58 SException(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptType, const char* exceptFile, long exceptLine, bool exceptToLogFile);
59
63 SException(const SException& exception);
64
68 virtual ~SException() throw();
69
72 void operator =(const SException& exception);
73
76 virtual const std::string& GetFullDescription() const;
77
80 virtual const std::string& GetSource() const;
81
84 virtual const std::string& GetFile() const;
85
88 virtual long GetLine() const;
89
92 virtual const std::string& GetDescription() const;
93
96 const char* what() const throw();
97 protected:
98 private:
99 };
100
104 class _SO3_Export SExceptionUnimplemented : public SException
105 {
106 public:
107 protected:
108 private:
109
110 public:
111 SExceptionUnimplemented(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
112 protected:
113 private:
114 };
115
119 class _SO3_Export SExceptionNullReference : public SException
120 {
121 public:
122 protected:
123 private:
124
125 public:
126 SExceptionNullReference(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
127 protected:
128 private:
129 };
130
134 class _SO3_Export SExceptionFileNotFound : public SException
135 {
136 public:
137 protected:
138 private:
139
140 public:
141 SExceptionFileNotFound(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
142 protected:
143 private:
144 };
145
149 class _SO3_Export SExceptionIO : public SException
150 {
151 public:
152 protected:
153 private:
154
155 public:
156 SExceptionIO(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
157 protected:
158 private:
159 };
160
164 class _SO3_Export SExceptionItemIdentity : public SException
165 {
166 public:
167 protected:
168 private:
169
170 public:
171 SExceptionItemIdentity(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
172 protected:
173 private:
174 };
175
179 class _SO3_Export SExceptionItemNotFound : public SException
180 {
181 public:
182 protected:
183 private:
184
185 public:
186 SExceptionItemNotFound(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
187 protected:
188 private:
189 };
190
194 class _SO3_Export SExceptionInternalError : public SException
195 {
196 public:
197 protected:
198 private:
199
200 public:
201 SExceptionInternalError(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
202 protected:
203 private:
204 };
205
209 class _SO3_Export SExceptionExternalAPIError : public SException
210 {
211 public:
212 protected:
213 private:
214
215 public:
216 SExceptionExternalAPIError(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
217 protected:
218 private:
219 };
220
224 class _SO3_Export SExceptionInvalidParameters : public SException
225 {
226 public:
227 protected:
228 private:
229
230 public:
231 SExceptionInvalidParameters(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
232 protected:
233 private:
234 };
235
239 class _SO3_Export SExceptionBadCast : public SException
240 {
241 public:
242 protected:
243 private:
244
245 public:
246 SExceptionBadCast(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
247 protected:
248 private:
249 };
250
254 class _SO3_Export SExceptionWriteData : public SException
255 {
256 public:
257 protected:
258 private:
259
260 public:
261 SExceptionWriteData(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
262 protected:
263 private:
264 };
265
269 class _SO3_Export SExceptionWriteOnly : public SException
270 {
271 public:
272 protected:
273 private:
274
275 public:
276 SExceptionWriteOnly(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
277 protected:
278 private:
279 };
280
284 class _SO3_Export SExceptionReadData : public SException
285 {
286 public:
287 protected:
288 private:
289
290 public:
291 SExceptionReadData(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
292 protected:
293 private:
294 };
295
299 class _SO3_Export SExceptionReadOnly : public SException
300 {
301 public:
302 protected:
303 private:
304
305 public:
306 SExceptionReadOnly(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
307 protected:
308 private:
309 };
310
314 class _SO3_Export SExceptionOutOfBound : public SException
315 {
316 public:
317 protected:
318 private:
319
320 public:
321 SExceptionOutOfBound(const std::string& exceptDescription, const std::string& exceptSource, const char* exceptFile, long exceptLine, bool exceptToLogFile=false);
322 protected:
323 private:
324 };
325
329 #define SO3_EXCEPT(exceptionType, desc, src, toLogFile) throw(exceptionType(desc, src, __FILE__, __LINE__, toLogFile))
330
331}
332
333#endif
librairies include
SException indicating that an attempt was done to cast a pointer to a non-related type.
SException indicating that an unknow error occurs, but we are pretty sure that it's not a SO3 interna...
SException indicating that a request for a file failed, cause it was not found or inaccessible on the...
Base class for SO3 custom exception.
std::string typeName
std::string file
std::string fullDesc
std::string source
std::string description
SException indicating that an error occurs while reading or writing data from a file or memory.
SException indicating that an unknow error occurs, but we are pretty sure that it's a so3 internal er...
SException indicating that at least one invalid parameter was provided on a functionnality call.
SException indicating that an attempt to create a new item with a given identifier fails cause anothe...
SException indicating that an attempt to get an item fails, cause there's no item with the given iden...
SException indicating that a call to a pointer variable not initialized was attempted.
SException indicating that an attempt to get a tab element with a given index out of bound.
SException indicating that an error occurs while reading some data from disk or memory.
SException indicating that an attempt to read some data from an unreachable source occurs.
SException indicating that a call to an unimplemented functionnality was done.
SException indicating that an error occurs while writing some data to disk or memory.
SException indicating that an attempt to write some data to an unreachable destination occurs.