Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
o2scl::err_hnd_gsl Class Reference

The error handler. More...

#include <err_hnd.h>

Inheritance diagram for o2scl::err_hnd_gsl:
o2scl::err_hnd_type o2scl::err_hnd_cpp

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 () const
 Return the last error number.
virtual int get_line () const
 Return the line number of the last error.
virtual const char * get_reason () const
 Return the reason for the last error.
virtual const char * get_file () const
 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.
virtual const char * type () const
 Return type ("err_hnd_gsl")

Public Attributes

size_t fname_size
 Number of characters from filename to print (default 28)

Protected Member Functions

std::string errno_to_string (int errnox)
 Convert an error number to a string.

Protected Attributes

int a_errno
 The error number.
int a_line
 The line number.
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.

Additional Inherited Members

- Static Public Member Functions inherited from o2scl::err_hnd_type
static void gsl_hnd (const char *reason, const char *file, int line, int lerrno)
 Set an error. More...

Detailed Description

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 199 of file err_hnd.h.

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

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).