Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
oomph::OomphLibException Class Reference

//////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// More...

#include <oomph_definitions.h>

+ Inheritance diagram for oomph::OomphLibException:

Public Member Functions

void disable_error_message ()
 Suppress issueing of the error message in destructor (useful if error is caught successfully!) More...
 

Protected Member Functions

 OomphLibException (const std::string &error_description, const std::string &function_name, const char *location, const std::string &exception_type, std::ostream &exception_stream, const unsigned &output_width, bool list_trace_back)
 Constructor takes the error description, function name and a location string provided by the OOMPH_EXCEPTION_LOCATION macro and combines them into a standard header. The exception type will be the string "WARNING" or "ERROR" and the message is written to the exception_stream, with a specified output_width. Optionally provide a traceback of the function calls. More...
 
 ~OomphLibException () throw ()
 The destructor cannot throw an exception (C++ STL standard) More...
 

Protected Attributes

std::ostream * Exception_stream_pt
 Exception stream to which we write message in destructor. More...
 
std::stringstream * Exception_stringstream_pt
 String stream that records the error message. More...
 
bool Suppress_error_message
 Boolean to suppress issuing of the error message in destructor (useful if error is caught successfully!) More...
 

Detailed Description

//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////

===================================================================== A Base class for oomph-lib run-time exception (error and warning) handling.

The class can only be instantiated by the derived classes OomphLibError and OomphLibWarning. The (protected) constructor combines its string arguments into a standard format for uniform exception reports which are written to the specified output stream.

Definition at line 173 of file oomph_definitions.h.

Constructor & Destructor Documentation

◆ OomphLibException()

oomph::OomphLibException::OomphLibException ( const std::string &  error_description,
const std::string &  function_name,
const char *  location,
const std::string &  exception_type,
std::ostream &  exception_stream,
const unsigned &  output_width,
bool  list_trace_back 
)
protected

Constructor takes the error description, function name and a location string provided by the OOMPH_EXCEPTION_LOCATION macro and combines them into a standard header. The exception type will be the string "WARNING" or "ERROR" and the message is written to the exception_stream, with a specified output_width. Optionally provide a traceback of the function calls.

The OomphLibException constructor takes the error description, function name, a location string provided by the OOMPH_EXCEPTION_LOCATION and an exception type "WARNING" or "ERROR" and combines them into a standard error message that is written to the exception stream. The output_width of the message can also be specified. Optionally provide a traceback of the function calls.

Definition at line 144 of file oomph_definitions.cc.

References Exception_stream_pt, Exception_stringstream_pt, i, print_stacktrace(), oomph::Global_string_for_annotation::string(), and Suppress_error_message.

◆ ~OomphLibException()

oomph::OomphLibException::~OomphLibException ( )
throw (
)
protected

The destructor cannot throw an exception (C++ STL standard)

//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////

The OomphLibException destructor actually spawns the error message created in the constructor (unless suppresed)

Definition at line 126 of file oomph_definitions.cc.

References Exception_stringstream_pt, and Suppress_error_message.

Member Function Documentation

◆ disable_error_message()

void oomph::OomphLibException::disable_error_message ( )
inline

Suppress issueing of the error message in destructor (useful if error is caught successfully!)

Definition at line 178 of file oomph_definitions.h.

References Suppress_error_message, and oomph::TerminateHelper::suppress_exception_error_messages().

Referenced by oomph::FiniteElement::locate_zeta().

Member Data Documentation

◆ Exception_stream_pt

std::ostream* oomph::OomphLibException::Exception_stream_pt
protected

Exception stream to which we write message in destructor.

Definition at line 206 of file oomph_definitions.h.

Referenced by OomphLibException().

◆ Exception_stringstream_pt

std::stringstream* oomph::OomphLibException::Exception_stringstream_pt
protected

String stream that records the error message.

Definition at line 209 of file oomph_definitions.h.

Referenced by OomphLibException(), and ~OomphLibException().

◆ Suppress_error_message

bool oomph::OomphLibException::Suppress_error_message
protected

Boolean to suppress issuing of the error message in destructor (useful if error is caught successfully!)

Definition at line 213 of file oomph_definitions.h.

Referenced by disable_error_message(), OomphLibException(), and ~OomphLibException().


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