Go to the documentation of this file.
32#ifndef SHARK_CORE_EXCEPTION_H
33#define SHARK_CORE_EXCEPTION_H
55 const std::string &
what =
"unknown reason",
56 const std::string &
file =
"unknown",
57 unsigned int line = 0,
58 const std::string & func =
"function"
75 inline const char*
what()
const throw() {
82 inline const std::string &
file()
const {
89 inline unsigned int line()
const {
106#define SHARKEXCEPTION(message) shark::Exception(message, __FILE__, __LINE__, __FUNCTION__)
108#define SHARKEXCEPTION(message) shark::Exception(message, __FILE__, __LINE__, __func__)
113#define RANGE_CHECK(cond) assert(cond)
114#define SIZE_CHECK(cond) assert(cond)
115#define SHARK_ASSERT(cond) assert(cond)
117#define RANGE_CHECK(cond) do { (void)sizeof(cond); } while (false)
118#define SIZE_CHECK(cond) do { (void)sizeof(cond); } while (false)
119#define SHARK_ASSERT(cond) do { (void)sizeof(cond); } while (false)
121#define SHARK_RUNTIME_CHECK(cond, message) do { if (!(cond)) throw SHARKEXCEPTION(message);} while (false)