10 #ifndef __PION_PIONEXCEPTION_HEADER__
11 #define __PION_PIONEXCEPTION_HEADER__
13 #include <pion/PionConfig.hpp>
33 PionException(
const std::string& what_msg) : m_what_msg(what_msg) {}
36 PionException(
const char *description,
const std::string& param)
37 : m_what_msg(std::string(description) + param) {}
38 PionException(std::string description,
const std::string& param)
39 : m_what_msg(description + param) {}
42 virtual const char*
what()
const throw() {
43 return m_what_msg.c_str();
49 const std::string m_what_msg;
62 static std::string make_string(
const std::string& file,
unsigned long line) {
63 std::string result(
"Assertion failed at ");
66 sprintf(line_buf,
" line %lu", line);
77 #define PION_ASSERT(EXPR) ((void)0);
79 #define PION_ASSERT(EXPR) if (!(EXPR)) { throw BadAssertException(__FILE__, __LINE__); }