Ipopt
3.12.12
|
This is the base class for all exceptions. More...
#include <IpException.hpp>
Public Member Functions | |
void | ReportException (const Journalist &jnlst, EJournalLevel level=J_ERROR) const |
Method to report the exception to a journalist. More... | |
const std::string & | Message () const |
Constructors/Destructors | |
IpoptException (std::string msg, std::string file_name, Index line_number, std::string type="IpoptException") | |
Constructor. More... | |
IpoptException (const IpoptException ©) | |
Copy Constructor. More... | |
virtual | ~IpoptException () |
Default destructor. More... | |
Private Member Functions | |
Default Compiler Generated Methods | |
(Hidden to avoid implicit creation/calling). These methods are not implemented and we do not want the compiler to implement them for us, so we declare them private and do not define them. This ensures that they will not be implicitly created/called. | |
IpoptException () | |
Default Constructor. More... | |
void | operator= (const IpoptException &) |
Overloaded Equals Operator. More... | |
Private Attributes | |
std::string | msg_ |
std::string | file_name_ |
Index | line_number_ |
std::string | type_ |
This is the base class for all exceptions.
The easiest way to use this class is by means of the following macros:
DECLARE_STD_EXCEPTION(ExceptionType);
This macro defines a new class with the name ExceptionType, inherited from the base class IpoptException. After this, exceptions of this type can be thrown using
THROW_EXCEPTION(ExceptionType, Message);
where Message is a std::string with a message that gives an indication of what caused the exception. Exceptions can also be thrown using the macro
ASSERT_EXCEPTION(Condition, ExceptionType, Message);
where Conditions is an expression. If Condition evaluates to false, then the exception of the type ExceptionType is thrown with Message.
When an exception is caught, the method ReportException can be used to write the information about the exception to the Journalist, using the level J_ERROR and the category J_MAIN.
Definition at line 57 of file IpException.hpp.
|
inline |
Constructor.
Definition at line 63 of file IpException.hpp.
|
inline |
Copy Constructor.
Definition at line 72 of file IpException.hpp.
|
inlinevirtual |
Default destructor.
Definition at line 81 of file IpException.hpp.
|
private |
Default Constructor.
|
inline |
Method to report the exception to a journalist.
Definition at line 86 of file IpException.hpp.
|
inline |
Definition at line 94 of file IpException.hpp.
|
private |
Overloaded Equals Operator.
|
private |
Definition at line 115 of file IpException.hpp.
|
private |
Definition at line 116 of file IpException.hpp.
|
private |
Definition at line 117 of file IpException.hpp.
|
private |
Definition at line 118 of file IpException.hpp.