27 #ifndef EXCEPTIONS_HPP_ 28 #define EXCEPTIONS_HPP_ 30 #include <boost/current_function.hpp> 42 const std::string& functionName,
43 const std::string& message_ =
"");
47 const char*
what()
const throw ();
52 #define SCHNECK_FAIL(message) \ 54 std::ostringstream _schnek_msg_stream; \ 55 _schnek_msg_stream << message; \ 56 throw schnek::ScheckException(__FILE__,__LINE__, \ 57 BOOST_CURRENT_FUNCTION,_schnek_msg_stream.str()); \ 61 #define SCHNEK_ASSERT(condition,message) \ 63 std::ostringstream _schnek_msg_stream; \ 64 _schnek_msg_stream << message; \ 65 throw schnek::ScheckException(__FILE__,__LINE__, \ 66 BOOST_CURRENT_FUNCTION,_schnek_msg_stream.str()); \ 69 #define SCHNEK_REQUIRE(condition,message) \ 71 std::ostringstream _schnek_msg_stream; \ 72 _schnek_msg_stream << message; \ 73 throw schnek::ScheckException(__FILE__,__LINE__, \ 74 BOOST_CURRENT_FUNCTION,_schnek_msg_stream.str()); \ 77 #define SCHNEK_ENSURE(condition,message) \ 79 std::ostringstream _schnek_msg_stream; \ 80 _schnek_msg_stream << message; \ 81 throw schnek::ScheckException(__FILE__,__LINE__, \ 82 BOOST_CURRENT_FUNCTION,_schnek_msg_stream.str()); \ 88 #define SCHNECK_FAIL_E(message, exceptclass) \ 90 std::ostringstream _schnek_msg_stream; \ 91 _schnek_msg_stream << message; \ 92 throw schnek::exceptclass(__FILE__,__LINE__, \ 93 BOOST_CURRENT_FUNCTION,_schnek_msg_stream.str()); \ 97 #define SCHNEK_ASSERT_E(condition,message, exceptclass) \ 99 std::ostringstream _schnek_msg_stream; \ 100 _schnek_msg_stream << message; \ 101 throw schnek::exceptclass(__FILE__,__LINE__, \ 102 BOOST_CURRENT_FUNCTION,_schnek_msg_stream.str()); \ 105 #define SCHNEK_REQUIRE_E(condition,message, exceptclass) \ 106 if (!(condition)) { \ 107 std::ostringstream _schnek_msg_stream; \ 108 _schnek_msg_stream << message; \ 109 throw schnek::exceptclass(__FILE__,__LINE__, \ 110 BOOST_CURRENT_FUNCTION,_schnek_msg_stream.str()); \ 113 #define SCHNEK_ENSURE_E(condition,message, exceptclass) \ 114 if (!(condition)) { \ 115 std::ostringstream _schnek_msg_stream; \ 116 _schnek_msg_stream << message; \ 117 throw schnek::exceptclass(__FILE__,__LINE__, \ 118 BOOST_CURRENT_FUNCTION,_schnek_msg_stream.str()); \ 121 #endif // EXCEPTIONS_HPP_ const char * what() const
returns the error message.
Definition: exceptions.cpp:41
Base error class.
Definition: exceptions.hpp:36