Classes | Namespaces | Macros
casadi_exception.hpp File Reference
#include <exception>
#include <string>
#include <sstream>
#include <iostream>
#include <stdexcept>
Include dependency graph for casadi_exception.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CasADi::CasadiException
 Casadi exception class. More...
 

Namespaces

 CasADi
 

Macros

#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;
 

Macro Definition Documentation

#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 
)
Value:
{ \
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()); \
}\
} \
#define CASADI_ASSERT_WHERE
#define CASADI_ASSERT_STR(x)
Casadi exception class.

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 
)
Value:
if((x)==false){ \
std::cerr << "CasADi warning: \"" << msg << "\" (assertion \"" CASADI_ASSERT_STR(x) "\"" CASADI_ASSERT_WHERE " failed.)" << std::endl;\
}
#define CASADI_ASSERT_WHERE
#define CASADI_ASSERT_STR(x)

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)
Value:
{\
std::stringstream ss_internal_; \
ss_internal_ << CASADI_ASSERT_WHERE << std::endl << msg << std::endl; \
throw CasADi::CasadiException(ss_internal_.str()); \
}
#define CASADI_ASSERT_WHERE
Casadi exception class.

Definition at line 108 of file casadi_exception.hpp.

#define casadi_log (   msg)
Value:
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.



acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:35:17