20 #ifndef __mast__exceptions__ 21 #define __mast__exceptions__ 27 namespace Exceptions {
33 const std::string& val_msg,
34 const std::string& msg,
35 const std::string& file,
49 <<
"Condition Violated: " 68 template <
typename Val1Type>
75 const std::string& cond,
76 const std::string& msg,
77 const std::string& file,
80 "Val 1: " + std::to_string(v1),
95 template <
typename Val1Type,
typename Val2Type>
103 const std::string& cond,
104 const std::string& msg,
105 const std::string& file,
108 "Val 1: " + std::to_string(v1) +
" \nVal 2: " + std::to_string(v2),
128 #define Assert0(cond, msg) { } 129 #define Assert1(cond, v1, msg) { } 130 #define Assert2(cond, v1, v2, msg) { } 134 #define Assert0(cond, msg) \ 136 MAST::Exceptions::ExceptionBase \ 141 __LINE__).throw_error() \ 143 #define Assert1(cond, v1, msg) \ 145 MAST::Exceptions::Exception1<decltype(v1)> \ 150 __LINE__).throw_error() \ 152 #define Assert2(cond, v1, v2, msg) \ 154 MAST::Exceptions::Exception2<decltype(v1), decltype(v2)> \ 160 __LINE__).throw_error() \ 166 #define Error(cond, msg) \ 168 MAST::Exceptions::ExceptionBase( \ 173 __LINE__).throw_error() \ 175 #endif // __mast__exceptions__
ExceptionBase(const std::string &cond, const std::string &val_msg, const std::string &msg, const std::string &file, const int line)
const std::string _val_msg
Exception2(const Val1Type v1, const Val2Type v2, const std::string &cond, const std::string &msg, const std::string &file, const int line)
Exception1(const Val1Type v1, const std::string &cond, const std::string &msg, const std::string &file, const int line)