11#ifndef __IPEXCEPTION_HPP__
12#define __IPEXCEPTION_HPP__
64 const std::string&
msg,
67 const std::string&
type =
"IpoptException"
80 file_name_(
copy.file_name_),
81 line_number_(
copy.line_number_),
97 "Exception of type: %s in file \"%s\" at line %" IPOPT_INDEX_FORMAT ":\n Exception message: %s\n", type_.c_str(), file_name_.c_str(), line_number_, msg_.c_str());
132#define THROW_EXCEPTION(__except_type, __msg) \
133 throw __except_type( (__msg), (__FILE__), (__LINE__) );
135#define ASSERT_EXCEPTION(__condition, __except_type, __msg) \
136 if (! (__condition) ) { \
137 std::string newmsg = #__condition; \
138 newmsg += " evaluated false: "; \
140 throw __except_type( (newmsg), (__FILE__), (__LINE__) ); \
143#define DECLARE_STD_EXCEPTION(__except_type) \
144 class IPOPTLIB_EXPORT __except_type : public Ipopt::IpoptException \
147 __except_type(const std::string& msg, const std::string& fname, Ipopt::Index line) \
148 : Ipopt::IpoptException(msg,fname,line, #__except_type) {} \
149 __except_type(const __except_type& copy) \
150 : Ipopt::IpoptException(copy) {} \
153 void operator=(const __except_type&); \
#define IPOPT_INDEX_FORMAT
Format specifier to use for ipindex in printf-format strings.
Templated class which stores one entry for the CachedResult class.
This is the base class for all exceptions.
IpoptException(const std::string &msg, const std::string &file_name, Index line_number, const std::string &type="IpoptException")
Constructor.
virtual ~IpoptException()
Default destructor.
const std::string & Message() const
void ReportException(const Journalist &jnlst, EJournalLevel level=J_ERROR) const
Method to report the exception to a journalist.
IpoptException(const IpoptException ©)
Copy Constructor.
void operator=(const IpoptException &)
Default Assignment Operator.
IpoptException()
Default Constructor.
Class responsible for all message output.
This file contains a base class for all exceptions and a set of macros to help with exceptions.
ipindex Index
Type of all indices of vectors, matrices etc.
EJournalLevel
Print Level Enum.