9 #ifndef __IPEXCEPTION_HPP__
10 #define __IPEXCEPTION_HPP__
90 "Exception of type: %s in file \"%s\" at line %d:\n Exception message: %s\n",
123 #define THROW_EXCEPTION(__except_type, __msg) \
124 throw __except_type( (__msg), (__FILE__), (__LINE__) );
126 #define ASSERT_EXCEPTION(__condition, __except_type, __msg) \
127 if (! (__condition) ) { \
128 std::string newmsg = #__condition; \
129 newmsg += " evaluated false: "; \
131 throw __except_type( (newmsg), (__FILE__), (__LINE__) ); \
134 #define DECLARE_STD_EXCEPTION(__except_type) \
135 class __except_type : public Ipopt::IpoptException \
138 __except_type(std::string msg, std::string fname, Ipopt::Index line) \
139 : Ipopt::IpoptException(msg,fname,line, #__except_type) {} \
140 __except_type(const __except_type& copy) \
141 : Ipopt::IpoptException(copy) {} \
144 void operator=(const __except_type&); \
const std::string & Message() const
This is the base class for all exceptions.
EJournalLevel
Print Level Enum.
IpoptException()
Default Constructor.
IpoptException(std::string msg, std::string file_name, Index line_number, std::string type="IpoptException")
Constructor.
void ReportException(const Journalist &jnlst, EJournalLevel level=J_ERROR) const
Method to report the exception to a journalist.
virtual void Printf(EJournalLevel level, EJournalCategory category, const char *format,...) const
Method to print a formatted string.
void operator=(const IpoptException &)
Overloaded Equals Operator.
int Index
Type of all indices of vectors, matrices etc.
IpoptException(const IpoptException ©)
Copy Constructor.
Class responsible for all message output.
virtual ~IpoptException()
Default destructor.