Go to the documentation of this file. 32 #ifndef SHARK_CORE_EXCEPTION_H 33 #define SHARK_CORE_EXCEPTION_H 64 inline const char*
what()
const throw() {
71 inline const std::string &
file()
const {
78 inline unsigned int line()
const {
94 #define SHARKEXCEPTION(message) shark::Exception(message, __FILE__, __LINE__) 98 inline void THROW_IF(
bool unexpectedCondition,
const std::string& message)
100 if (unexpectedCondition)
107 #define RANGE_CHECK(cond) do { if (!(cond)) throw SHARKEXCEPTION("range check error: "#cond); } while (false) 108 #define SIZE_CHECK(cond) do { if (!(cond)) throw SHARKEXCEPTION("size mismatch: "#cond); } while (false) 109 #define TYPE_CHECK(cond) do { if (!(cond)) throw SHARKEXCEPTION("type mismatch: "#cond); } while (false) 110 #define IO_CHECK(cond) do { if (!(cond)) throw SHARKEXCEPTION("I/O error "); } while (false) 111 #define SHARK_ASSERT(cond) do { if (!(cond)) throw SHARKEXCEPTION("assertion failed: "#cond); } while (false) 112 #define SHARK_CHECK(cond, error) do { if (!(cond)) throw SHARKEXCEPTION(error); } while (false) 114 #define RANGE_CHECK(cond) do { (void)sizeof(cond); } while (false) 115 #define SIZE_CHECK(cond) do { (void)sizeof(cond); } while (false) 116 #define TYPE_CHECK(cond) do { (void)sizeof(cond); } while (false) 117 #define IO_CHECK(cond) do { (void)sizeof(cond); } while (false) 118 #define SHARK_ASSERT(cond) do { (void)sizeof(cond); } while (false) 119 #define SHARK_CHECK(cond, error) do { (void)sizeof(cond); (void)sizeof(error);} while (false) 122 #endif // SHARK_CORE_EXCEPTION_H