40#if OGRE_ASSERT_MODE == 1
42# define OgreAssert( a, b ) assert( (a) && (b) )
44# if OGRE_COMP != OGRE_COMPILER_BORL
45# define OgreAssert( a, b ) if( !(a) ) OGRE_EXCEPT( Ogre::Exception::ERR_RT_ASSERTION_FAILED, (b), "no function info")
47# define OgreAssert( a, b ) if( !(a) ) OGRE_EXCEPT( Ogre::Exception::ERR_RT_ASSERTION_FAILED, (b), __FUNC__ )
52#elif OGRE_ASSERT_MODE == 2
53# if OGRE_COMP != OGRE_COMPILER_BORL
54# define OgreAssert( a, b ) if( !(a) ) OGRE_EXCEPT( Ogre::Exception::ERR_RT_ASSERTION_FAILED, (b), "no function info")
56# define OgreAssert( a, b ) if( !(a) ) OGRE_EXCEPT( Ogre::Exception::ERR_RT_ASSERTION_FAILED, (b), __FUNC__ )
61# define OgreAssert( a, b ) assert( (a) && (b) )
119 Exception(
int number,
const String& description,
const String& source,
const char* type,
const char* file,
long line );
167 const char*
what()
const throw() {
return getFullDescription().c_str(); }
179 :
Exception(inNumber, inDescription, inSource,
"UnimplementedException", inFile, inLine) {}
185 :
Exception(inNumber, inDescription, inSource,
"FileNotFoundException", inFile, inLine) {}
191 :
Exception(inNumber, inDescription, inSource,
"IOException", inFile, inLine) {}
197 :
Exception(inNumber, inDescription, inSource,
"InvalidStateException", inFile, inLine) {}
203 :
Exception(inNumber, inDescription, inSource,
"InvalidParametersException", inFile, inLine) {}
209 :
Exception(inNumber, inDescription, inSource,
"ItemIdentityException", inFile, inLine) {}
215 :
Exception(inNumber, inDescription, inSource,
"InternalErrorException", inFile, inLine) {}
221 :
Exception(inNumber, inDescription, inSource,
"RenderingAPIException", inFile, inLine) {}
227 :
Exception(inNumber, inDescription, inSource,
"RuntimeAssertionException", inFile, inLine) {}
243 const String& src,
const char* file,
long line)
257 default:
throw Exception(number, desc, src,
"Exception", file, line);
265#define OGRE_EXCEPT(code, desc, src) Ogre::ExceptionFactory::throwException(code, code, desc, src, __FILE__, __LINE__)
266#define OGRE_EXCEPT_EX(code, num, desc, src) Ogre::ExceptionFactory::throwException(code, num, desc, src, __FILE__, __LINE__)
268#define OGRE_EXCEPT_EX(code, num, desc, src) OGRE_EXCEPT(code, desc, src)
Class implementing dispatch method in order to construct by-value exceptions of a derived type based ...
static OGRE_NORETURN void throwException(Exception::ExceptionCodes code, int number, const String &desc, const String &src, const char *file, long line)
ExceptionFactory()
Private constructor, no construction.
When thrown, provides information about an error that has occurred inside the engine.
virtual const String & getFullDescription(void) const
Returns a string with the full description of this error.
const char * what() const
Override std::exception::what.
~Exception()
Needed for compatibility with std::exception.
Exception(const Exception &rhs)
Copy constructor.
ExceptionCodes
Static definitions of error codes.
@ ERR_CANNOT_WRITE_TO_FILE
@ ERR_RT_ASSERTION_FAILED
Exception(int number, const String &description, const String &source, const char *type, const char *file, long line)
Advanced constructor.
virtual const String & getDescription(void) const
Returns a string with only the 'description' field of this exception.
virtual int getNumber(void) const
Gets the error code.
virtual const String & getSource() const
Gets the source function.
Exception(int number, const String &description, const String &source)
Default constructor.
virtual const String & getFile() const
Gets source file name.
virtual long getLine() const
Gets line number.
FileNotFoundException(int inNumber, const String &inDescription, const String &inSource, const char *inFile, long inLine)
IOException(int inNumber, const String &inDescription, const String &inSource, const char *inFile, long inLine)
InternalErrorException(int inNumber, const String &inDescription, const String &inSource, const char *inFile, long inLine)
InvalidParametersException(int inNumber, const String &inDescription, const String &inSource, const char *inFile, long inLine)
InvalidStateException(int inNumber, const String &inDescription, const String &inSource, const char *inFile, long inLine)
ItemIdentityException(int inNumber, const String &inDescription, const String &inSource, const char *inFile, long inLine)
RenderingAPIException(int inNumber, const String &inDescription, const String &inSource, const char *inFile, long inLine)
RuntimeAssertionException(int inNumber, const String &inDescription, const String &inSource, const char *inFile, long inLine)
UnimplementedException(int inNumber, const String &inDescription, const String &inSource, const char *inFile, long inLine)