err_hnd.h File Reference


Detailed Description

File for definitions for err_class.

Definition in file err_hnd.h.

#include <iostream>
#include <string>
#include <gsl/gsl_errno.h>

Go to the source code of this file.

Data Structures

class  err_class
 The error handler. More...

Defines

#define set_err(d, n)   o2scl::set_err_fn(d,__FILE__,__LINE__,n);
 Set an error.
#define set_err_ret(d, n)   do { o2scl::set_err_fn(d,__FILE__,__LINE__,n); return n; } while (0)
 Set an error and return the error value.
#define add_err(d, n)   o2scl::add_err_fn(d,__FILE__,__LINE__,n);
 Set an error and add the information from the last error.
#define add_err_ret(d, n)   do { o2scl::add_err_fn(d,__FILE__,__LINE__,n); return n; } while(0)
 Set an error, add the information from the last error, and return the error value.
#define err_print(ev)
 Print out error information.
#define cerr_print(ev)
 Print out error information to cerr, do nothing occured.
#define err_assert(ev)
 A version of assert, i.e. exit if the error value is non-zero and do nothing otherwise.
#define bool_assert(ev, str)
 A version of assert for bool types. Exit if the argument is false.

Enumerations

enum  {
  gsl_success = 0, gsl_failure = -1, gsl_continue = -2, gsl_edom = 1,
  gsl_erange = 2, gsl_efault = 3, gsl_einval = 4, gsl_efailed = 5,
  gsl_efactor = 6, gsl_esanity = 7, gsl_enomem = 8, gsl_ebadfunc = 9,
  gsl_erunaway = 10, gsl_emaxiter = 11, gsl_ezerodiv = 12, gsl_ebadtol = 13,
  gsl_etol = 14, gsl_eundrflw = 15, gsl_eovrflw = 16, gsl_eloss = 17,
  gsl_eround = 18, gsl_ebadlen = 19, gsl_enotsqr = 20, gsl_esing = 21,
  gsl_ediverge = 22, gsl_eunsup = 23, gsl_eunimpl = 24, gsl_ecache = 25,
  gsl_etable = 26, gsl_enoprog = 27, gsl_enoprogj = 28, gsl_etolf = 29,
  gsl_etolx = 30, gsl_etolg = 31, gsl_eof = 32, gsl_nobase = 33,
  gsl_notfound = 34, gsl_memtype = 35, gsl_efilenotfound = 36, gsl_index = 37
}
 The error definitions from GSL. More...

Functions

void set_err_fn (const char *desc, const char *file, int line, int errnum)
 Set an error.
void add_err_fn (const char *desc, const char *file, int line, int errnum)
 Set an error and add the information from the last error.
void error_update (int &ret, int err)
 Desc.

Variables

err_classerr_hnd
 The global error handler pointer.
err_class def_err_hnd
 The default error handler.


Define Documentation

#define cerr_print ( ev   ) 

Value:

do { if (ev!=0) std::cerr << ev << " " << err_hnd->get_str() << std::endl; \
  } while (0)
Print out error information to cerr, do nothing occured.

Definition at line 279 of file err_hnd.h.

#define err_assert ( ev   ) 

A version of assert, i.e. exit if the error value is non-zero and do nothing otherwise.

Todo:
Should make this consistent with assert() using NDEBUG

Definition at line 288 of file err_hnd.h.

#define err_print ( ev   ) 

Value:

do { if (ev!=0) std::cout << ev << " " << err_hnd->get_str() << std::endl; \
    else std::cout << "No error occured." << std::endl; } while (0)
Print out error information.

Definition at line 272 of file err_hnd.h.


Enumeration Type Documentation

anonymous enum

The error definitions from GSL.

Enumerator:
gsl_success  Success.
gsl_failure  Failure.
gsl_continue  iteration has not converged
gsl_edom  input domain error, e.g sqrt(-1)
gsl_erange  output range error, e.g. exp(1e100)
gsl_efault  invalid pointer
gsl_einval  invalid argument supplied by user
gsl_efailed  generic failure
gsl_efactor  factorization failed
gsl_esanity  sanity check failed - shouldn't happen
gsl_enomem  malloc failed
gsl_ebadfunc  problem with user-supplied function
gsl_erunaway  iterative process is out of control
gsl_emaxiter  exceeded max number of iterations
gsl_ezerodiv  tried to divide by zero
gsl_ebadtol  user specified an invalid tolerance
gsl_etol  failed to reach the specified tolerance
gsl_eundrflw  underflow
gsl_eovrflw  overflow
gsl_eloss  loss of accuracy
gsl_eround  failed because of roundoff error
gsl_ebadlen  matrix, vector lengths are not conformant
gsl_enotsqr  matrix not square
gsl_esing  apparent singularity detected
gsl_ediverge  integral or series is divergent
gsl_eunsup  requested feature is not supported by the hardware
gsl_eunimpl  requested feature not (yet) implemented
gsl_ecache  cache limit exceeded
gsl_etable  table limit exceeded
gsl_enoprog  iteration is not making progress toward solution
gsl_enoprogj  jacobian evaluations are not improving the solution
gsl_etolf  cannot reach the specified tolerance in f
gsl_etolx  cannot reach the specified tolerance in x
gsl_etolg  cannot reach the specified tolerance in gradient
gsl_eof  end of file
gsl_nobase  a blank method in a base class has been called
gsl_notfound  Generic "not found" result.
gsl_memtype  Incorrect type for memory object.
gsl_efilenotfound  File not found.
gsl_index  Invalid index for array or matrix.

Definition at line 42 of file err_hnd.h.


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