err_class Class Reference

The error handler. More...

#include <err_hnd.h>

Inheritance diagram for err_class:

err_base

Detailed Description

The error handler.

An error handler for use in O2scl which replaces the GSL error handler

Note that the string arguments to set() can refer to temporary storage, since they are copied when the function is called and an error is set.

Definition at line 200 of file err_hnd.h.


Public Member Functions

virtual void set (const char *reason, const char *file, int line, int lerrno)
 Set an error.
virtual void get (const char *&reason, const char *&file, int &line, int &lerrno)
 Get the last error.
virtual int get_errno ()
 Return the last error number.
virtual int get_line ()
 Return the line number of the last error.
virtual const char * get_reason ()
 Return the reason for the last error.
virtual const char * get_file ()
 Return the file name of the last error.
virtual const char * get_str ()
 Return a string summarizing the last error.
virtual void reset ()
 Remove last error information.
void set_mode (int m)
 Set error handling mode.
int get_mode ()
 Return the error handling mode.

Data Fields

bool array_abort
 If true, call exit() when an array index error is set (default true).
size_t fname_size
 Number of characters from filename to print (default 35).

Protected Attributes

int a_errno
 The error number.
int a_line
 The line number.
int mode
 The mode of error handling (default 2).
char * a_file
 The filename.
char a_reason [rsize]
 The error explanation.
char fullstr [fsize]
 A full string with explanation and line and file info.

Static Protected Attributes

static const int rsize = 300
 The maximum size of error explanations.
static const int fsize = 400
 The maximum size of error explanations with the line and file info.

Member Function Documentation

void set_mode ( int  m  )  [inline]

Set error handling mode.

  • 0 - Continue execution after an error occurs
  • 1 - Continue execution after an error occurs
  • 2 - Abort execution after an error occurs, and print out the error information (default)

Definition at line 241 of file err_hnd.h.


Field Documentation

If true, call exit() when an array index error is set (default true).

This is ignored if O2SCL_ARRAY_ABORT is not defined.

Definition at line 257 of file err_hnd.h.


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

Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.

Project hosting provided by SourceForge.net Logo, O2scl Sourceforge Project Page