Ipopt Documentation  
No Matches
Ipopt::IpoptException Class Reference

This is the base class for all exceptions. More...

#include <IpException.hpp>

+ Inheritance 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
 IpoptException (const std::string &msg, const std::string &file_name, Index line_number, const std::string &type="IpoptException")
 IpoptException (const IpoptException &copy)
 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_

Detailed Description

This is the base class for all exceptions.

The easiest way to use this class is by means of the following macros:


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.

Constructor & Destructor Documentation

◆ IpoptException() [1/3]

Ipopt::IpoptException::IpoptException ( const std::string &  msg,
const std::string &  file_name,
Index  line_number,
const std::string &  type = "IpoptException" 


Definition at line 63 of file IpException.hpp.

◆ IpoptException() [2/3]

Ipopt::IpoptException::IpoptException ( const IpoptException copy)

Copy Constructor.

Definition at line 76 of file IpException.hpp.

◆ ~IpoptException()

virtual Ipopt::IpoptException::~IpoptException ( )

Default destructor.

Definition at line 86 of file IpException.hpp.

◆ IpoptException() [3/3]

Ipopt::IpoptException::IpoptException ( )

Default Constructor.

Member Function Documentation

◆ ReportException()

void Ipopt::IpoptException::ReportException ( const Journalist jnlst,
EJournalLevel  level = J_ERROR 
) const

Method to report the exception to a journalist.

Definition at line 91 of file IpException.hpp.

◆ Message()

const std::string & Ipopt::IpoptException::Message ( ) const

Definition at line 100 of file IpException.hpp.

◆ operator=()

void Ipopt::IpoptException::operator= ( const IpoptException )

Default Assignment Operator.

Member Data Documentation

◆ msg_

std::string Ipopt::IpoptException::msg_

Definition at line 124 of file IpException.hpp.

◆ file_name_

std::string Ipopt::IpoptException::file_name_

Definition at line 125 of file IpException.hpp.

◆ line_number_

Index Ipopt::IpoptException::line_number_

Definition at line 126 of file IpException.hpp.

◆ type_

std::string Ipopt::IpoptException::type_

Definition at line 127 of file IpException.hpp.

The documentation for this class was generated from the following file: