Class err_hnd_gsl (o2scl)

O2scl : Class List

class err_hnd_gsl : public o2scl::err_hnd_type

The error handler.

An error handler for use in 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.

Subclassed by o2scl::err_hnd_cpp

Public Functions

err_hnd_gsl()
inline virtual ~err_hnd_gsl()
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.

inline virtual const char *type() const

Return type (“err_hnd_gsl”)

Public Members

size_t fname_size

Number of characters from filename to print (default 28)

Protected 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.

Protected Static 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.