Bayeux  3.4.1
Core Foundation library for SuperNEMO
error.h
Go to the documentation of this file.
1 
3 #ifndef MYGSL_ERROR_H
4 #define MYGSL_ERROR_H 1
5 
6 // Standard library:
7 #include <string>
8 
9 // Third party:
10 // - GSL:
11 #include <gsl/gsl_errno.h>
12 
13 namespace mygsl {
14 
16  class error
17  {
18  public:
19 
20  static void to_string (const int gsl_errno_ ,
21  std::string & err_string_);
22 
23  static std::string to_string (const int gsl_errno_);
24 
25  static void set_handler (gsl_error_handler_t &);
26 
27  static void off ();
28 
29  static void on ();
30 
31  static void set_default ();
32 
33  static void set_gsl_default ();
34 
35  static void default_handler(const char * reason_ ,
36  const char * file_ ,
37  int line_ ,
38  int gsl_errno_);
39  private:
40 
41  error();
42 
43  ~error();
44 
45  private:
46 
47  static bool _active_;
48  static error _singleton_;
49 
50  };
51 
52 #define MYGSL_ERROR(reason_, gsl_errno_) \
53  do { \
54  gsl_error (reason_, __FILE__, __LINE__, gsl_errno_) ; \
55  } while (0)
56 
57 }
58 
59 #endif // MYGSL_ERROR_H
60 
61 // Local Variables:
62 // mode: c++
63 // coding: utf-8
64 // End:
static void default_handler(const char *reason_, const char *file_, int line_, int gsl_errno_)
static void on()
static void set_default()
static void off()
static void to_string(const int gsl_errno_, std::string &err_string_)
static void set_handler(gsl_error_handler_t &)
Top-level namespace of the Bayeux/mygsl module library.
Definition: base_decay_driver.h:47
GSL error handling.
Definition: error.h:16
static void set_gsl_default()