Classes | Namespaces | Defines
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

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 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()); \
 }\
} \

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;\
}

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()); \
 }

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 Thu Aug 27 2015 12:01:34