20 #ifndef EPTEXCEPTION_H
21 #define EPTEXCEPTION_H
27 #include "../config.h"
32 #if EPT_ASSERT_MODE == 1
34 # define EptAssert( a, b ) assert( (a) && (b) )
37 # define EptAssert( a, b ) if( !(a) ) EPT_EXCEPT( EptException::ERR_RT_ASSERTION_FAILED, (b), __func__ )
42 #elif OGRE_ASSERT_MODE == 2
43 # define EptAssert( a, b ) if( !(a) ) EPT_EXCEPT( EptException::ERR_RT_ASSERTION_FAILED, (b), __func__ )
47 # define EptAssert( a, b ) assert( (a) && (b) )
76 EptException(
int number,
const std::string& description,
const std::string& source );
79 EptException(
int number,
const std::string& description,
const std::string& source,
const char* file,
long line );
94 virtual int getNumber(
void)
const throw();
112 static std::string
toString(
int code);
119 #define EPT_EXCEPT(num, desc) throw EptException(num, desc, __func__, __FILE__, __LINE__ );
122 #endif // EPTEXCEPTION_H
static std::string toString(int code)
virtual const std::string & getDescription(void) const
Returns a string with only the 'description' field of this exception.
const char * what() const
Override std::exception::what.
virtual int getNumber(void) const
Gets the error code.
~EptException()
Needed for compatibility with std::exception.
EptException & operator=(const EptException &)=default
Assignment operator.
virtual long getLine() const
Gets line number.
virtual const std::string & getSource() const
Gets the source function.
virtual const std::string & getFile() const
Gets source file name.
EptException(int number, const std::string &description, const std::string &source)
Default constructor.
virtual const std::string & getFullDescription(void) const
Returns a string with the full description of this error.