19 inline static std::string
msg(
const char *file,
int line,
const char *
func) {
20 std::stringstream myoutput;
21 myoutput << file <<
"\n" << line <<
"\n" <<
func;
22 return myoutput.str();
34 inline static std::string
msgx(
const T &
msg,
const char *file,
int line,
const char *
func) {
35 std::stringstream myoutput;
36 myoutput << msg <<
"\n" << file <<
"\n" << line <<
"\n" <<
func;
37 return myoutput.str();
50 template<
class X = std::runtime_error>
51 void inline static error_if(
const std::string &s,
bool arg) {
62 template<
class X = std::runtime_error>
75 template<
class X = std::inval
id_argument>
76 void inline static all(
const std::string &s, std::initializer_list<bool> lst) {
80 for (
auto itr = lst.begin(); itr != lst.end(); itr++) {
84 std::stringstream sstream;
85 sstream << s <<
" invalid argument:" << counter;
86 throw X(sstream.str());
97 template<
class T,
class X = std::inval
id_argument>
98 void inline static ptr(
const std::string &s, T *ptr) {
100 std::stringstream sstream;
101 sstream <<
"nullpointer:" << s;
102 throw X(sstream.str());
113 #define nmx_msg nmx::Error::msg(__FILE__, __LINE__, __PRETTY_FUNCTION__) 119 #define nmx_msg_txt(msg) nmx::Error::msgx(msg, __FILE__, __LINE__, __PRETTY_FUNCTION__) 125 #define nmx_msgx(msg) nmx::Error::msgx(#msg, __FILE__, __LINE__, __PRETTY_FUNCTION__)
static void ptr(const std::string &s, T *ptr)
null_ptr teste Zeiger auf Gültigkeit
static void error_if(const std::string &s, bool arg)
error_if Fehler wenn Bedingung erfüllt ist
int func(double x, const double yin[], double yout[], void *params)
func rechte Seite der Differenzialgleichung
static void error_if_not(const std::string &s, bool arg)
error_if_not Fehler wenn Bedingung nicht erfüllt ist
The Error struct erzeugt Fehlermeldungen.
static std::string msg(const char *file, int line, const char *func)
msg Text einer Fehlermeldung zusammengesetzt aus
static std::string msgx(const T &msg, const char *file, int line, const char *func)
info Text einer Fehlermeldung zusammengesetzt aus
The Check struct Testfunktionen zum Auffinden von Fehlern.
static void all(const std::string &s, std::initializer_list< bool > lst)
input teste mehrere Bedingungen auf einmal