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. | |
const std::string & | Message () const |
Constructors/Destructors | |
IpoptException (const std::string &msg, const std::string &file_name, Index line_number, const std::string &type="IpoptException") | |
Constructor. | |
IpoptException (const IpoptException ©) | |
Copy Constructor. | |
virtual | ~IpoptException () |
Default destructor. | |
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. | |
void | operator= (const IpoptException &) |
Default Assignment Operator. | |
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 76 of file IpException.hpp.
|
inlinevirtual |
Default destructor.
Definition at line 86 of file IpException.hpp.
|
private |
Default Constructor.
|
inline |
Method to report the exception to a journalist.
Definition at line 91 of file IpException.hpp.
|
inline |
Definition at line 100 of file IpException.hpp.
|
private |
Default Assignment Operator.
|
private |
Definition at line 124 of file IpException.hpp.
|
private |
Definition at line 125 of file IpException.hpp.
|
private |
Definition at line 126 of file IpException.hpp.
|
private |
Definition at line 127 of file IpException.hpp.