#include <IpException.hpp>
Collaboration diagram for Ipopt::IpoptException:
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 (std::string msg, std::string file_name, Index line_number, 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 &) |
Overloaded Equals Operator. | |
Private Attributes | |
std::string | msg_ |
std::string | file_name_ |
Index | line_number_ |
std::string | type_ |
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.
Ipopt::IpoptException::IpoptException | ( | std::string | msg, | |
std::string | file_name, | |||
Index | line_number, | |||
std::string | type = "IpoptException" | |||
) | [inline] |
Ipopt::IpoptException::IpoptException | ( | const IpoptException & | copy | ) | [inline] |
virtual Ipopt::IpoptException::~IpoptException | ( | ) | [inline, virtual] |
Ipopt::IpoptException::IpoptException | ( | ) | [private] |
Default Constructor.
void Ipopt::IpoptException::ReportException | ( | const Journalist & | jnlst, | |
EJournalLevel | level = J_ERROR | |||
) | const [inline] |
Method to report the exception to a journalist.
Definition at line 86 of file IpException.hpp.
References file_name_, Ipopt::J_MAIN, line_number_, msg_, Ipopt::Journalist::Printf(), and type_.
const std::string& Ipopt::IpoptException::Message | ( | ) | const [inline] |
void Ipopt::IpoptException::operator= | ( | const IpoptException & | ) | [private] |
Overloaded Equals Operator.
std::string Ipopt::IpoptException::msg_ [private] |
std::string Ipopt::IpoptException::file_name_ [private] |
Index Ipopt::IpoptException::line_number_ [private] |
std::string Ipopt::IpoptException::type_ [private] |