29 #ifdef OOMPH_HAS_STACKTRACE
44 namespace Global_timings
60 namespace TerminateHelper
81 (*Error_message_stream_pt) << (*Exception_stringstream_pt).str();
130 (*Exception_stream_pt) << (*Exception_stringstream_pt).str();
146 const char* location,
148 std::ostream& exception_stream,
149 const unsigned& output_width,
150 bool list_trace_back)
151 : std::runtime_error(
"OomphException")
167 for (
unsigned i = 0;
i < output_width;
i++)
169 exception_header +=
"=";
171 exception_header +=
"\n";
174 exception_header +=
"Oomph-lib ";
175 exception_header += exception_type;
178 exception_header +=
"\n\n at ";
179 exception_header += location;
180 exception_header +=
"\n\n in ";
181 exception_header += function_name;
184 exception_header +=
"\n\n";
187 for (
unsigned i = 0;
i < (unsigned)(0.8 * output_width);
i++)
189 exception_header +=
"-";
193 (*Exception_stringstream_pt) << exception_header << std::endl;
196 (*Exception_stringstream_pt) << std::endl << error_description << std::endl;
198 #ifdef OOMPH_HAS_STACKTRACE
207 for (
unsigned i = 0;
i < output_width;
i++)
209 (*Exception_stringstream_pt) <<
"=";
211 (*Exception_stringstream_pt) << std::endl << std::endl;
215 (*TerminateHelper::Exception_stringstream_pt)
216 << (*Exception_stringstream_pt).str();
249 namespace Global_output_stream
266 namespace Global_unsigned
282 namespace Global_string_for_annotation
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
static unsigned Output_width
Width in characters of the output report.
static std::ostream * Stream_pt
Output stream that is used to write the errors.
~OomphLibException()
The destructor cannot throw an exception (C++ STL standard)
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_EX...
std::stringstream * Exception_stringstream_pt
String stream that records the error message.
std::ostream * Exception_stream_pt
Exception stream to which we write message in destructor.
bool Suppress_error_message
Boolean to suppress issuing of the error message in destructor (useful if error is caught successfull...
OomphLibQuietException()
Constructor.
static unsigned Output_width
Width of output.
static std::ostream * Stream_pt
Output stream that is used to write the errors.
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
std::ofstream * Outfile
Output stream.
std::vector< std::string > String
Storage for strings that may be used for global annotations. This is global data and you use it at yo...
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
bool Doc_comprehensive_timings
Global boolean to switch on comprehensive timing – can probably be declared const false when developm...
unsigned Number
The unsigned.
void clean_up_memory()
Clean up function that deletes anything dynamically allocated in this namespace.
void suppress_exception_error_messages()
Flush string stream of error messages (call when error has been caught)
void setup()
Setup terminate helper.
void spawn_errors_from_uncaught_errors()
Function to spawn messages from uncaught errors.
std::stringstream * Exception_stringstream_pt
String stream that records the error message.
std::ostream * Error_message_stream_pt
Stream to output error messages.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
Nullstream oomph_nullstream
///////////////////////////////////////////////////////////////////////// ///////////////////////////...
OutputModifier default_output_modifier
Single global instatiation of the default output modifier.
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...
static void print_stacktrace(std::ostream &exception_stream, unsigned int max_frames=63)