#include <exception>
#include <string>
#include <sstream>
#include <iostream>
#include <stdexcept>
Go to the source code of this file.
Classes | |
class | CasADi::CasadiException |
Casadi exception class. More... | |
Namespaces | |
namespace | CasADi |
Defines | |
#define | casadi_assert(x) casadi_assert_message(x,"(Hint for developers: CasadiOptions.setCatchErrorsPython(False) to obtain gdb stacktrace in python.)" << std::endl << "Please notify the CasADi developers.") |
#define | casadi_assert_message(x, msg) |
#define | CASADI_ASSERT_STR(x) CASADI_ASSERT_STR1(x) |
#define | CASADI_ASSERT_STR1(x) #x |
#define | casadi_assert_warning(x, msg) |
#define | CASADI_ASSERT_WHERE " on line " CASADI_ASSERT_STR(__LINE__) " of file " CASADI_ASSERT_STR(__FILE__) |
#define | casadi_error(msg) |
#define | casadi_log(msg) |
#define | casadi_warning(msg) std::cerr << "CasADi warning: \"" << msg << "\" issued " CASADI_ASSERT_WHERE ". " << std::endl; |
#define casadi_assert | ( | x | ) | casadi_assert_message(x,"(Hint for developers: CasadiOptions.setCatchErrorsPython(False) to obtain gdb stacktrace in python.)" << std::endl << "Please notify the CasADi developers.") |
Definition at line 132 of file casadi_exception.hpp.
#define casadi_assert_message | ( | x, | |
msg | |||
) |
{ \ bool is_ok; \ try{ \ is_ok = x; \ } catch(std::exception& ex){ \ throw CasADi::CasadiException(std::string("When trying to check the assertion \"" CASADI_ASSERT_STR(x) "\"" CASADI_ASSERT_WHERE ", caught: \n")+ex.what());\ } \ if(!is_ok) { \ std::stringstream ss_internal_; \ ss_internal_ << "The assertion \"" CASADI_ASSERT_STR(x) "\"" CASADI_ASSERT_WHERE " failed. " << std::endl << msg << std::endl; \ throw CasADi::CasadiException(ss_internal_.str()); \ }\ } \
Definition at line 116 of file casadi_exception.hpp.
#define CASADI_ASSERT_STR | ( | x | ) | CASADI_ASSERT_STR1(x) |
Definition at line 98 of file casadi_exception.hpp.
#define CASADI_ASSERT_STR1 | ( | x | ) | #x |
Definition at line 97 of file casadi_exception.hpp.
#define casadi_assert_warning | ( | x, | |
msg | |||
) |
if((x)==false){ \ std::cerr << "CasADi warning: \"" << msg << "\" (assertion \"" CASADI_ASSERT_STR(x) "\"" CASADI_ASSERT_WHERE " failed.)" << std::endl;\ }
Definition at line 135 of file casadi_exception.hpp.
#define CASADI_ASSERT_WHERE " on line " CASADI_ASSERT_STR(__LINE__) " of file " CASADI_ASSERT_STR(__FILE__) |
Definition at line 101 of file casadi_exception.hpp.
#define casadi_error | ( | msg | ) |
{\ std::stringstream ss_internal_; \ ss_internal_ << CASADI_ASSERT_WHERE << std::endl << msg << std::endl; \ throw CasADi::CasadiException(ss_internal_.str()); \ }
Definition at line 108 of file casadi_exception.hpp.
#define casadi_log | ( | msg | ) |
if(verbose()){ \ std::cout << "CasADi log message: " << msg << std::endl; \ }
Definition at line 103 of file casadi_exception.hpp.
#define casadi_warning | ( | msg | ) | std::cerr << "CasADi warning: \"" << msg << "\" issued " CASADI_ASSERT_WHERE ". " << std::endl; |
Definition at line 141 of file casadi_exception.hpp.