MISR Toolkit  1.5.1
H5Exception.h
Go to the documentation of this file.
1 // C++ informative line for the emacs editor: -*- C++ -*-
2 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
3  * Copyright by The HDF Group. *
4  * Copyright by the Board of Trustees of the University of Illinois. *
5  * All rights reserved. *
6  * *
7  * This file is part of HDF5. The full HDF5 copyright notice, including *
8  * terms governing use, modification, and redistribution, is contained in *
9  * the COPYING file, which can be found at the root of the source code *
10  * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
11  * If you do not have access to either file, you may request a copy from *
12  * help@hdfgroup.org. *
13  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
14 
15 #ifndef __H5Exception_H
16 #define __H5Exception_H
17 
18 #include <string>
19 
20 namespace H5 {
21 
22 #ifdef H5_NO_STD
23  #define H5std_string ::string
24 #else
25  #define H5std_string std::string
26 #endif
27 
34  public:
35  // Creates an exception with a function name where the failure occurs
36  // and an optional detailed message
37  Exception(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
38 
39  // Returns a character string that describes the error specified by
40  // a major error number.
41  H5std_string getMajorString(hid_t err_major_id) const;
42 
43  // Returns a character string that describes the error specified by
44  // a minor error number.
45  H5std_string getMinorString(hid_t err_minor_id) const;
46 
47  // Returns the detailed message set at the time the exception is thrown
48  H5std_string getDetailMsg() const;
49  const char* getCDetailMsg() const; // C string of detailed message
50  H5std_string getFuncName() const; // function name as a string object
51  const char* getCFuncName() const; // function name as a char string
52 
53  // Turns on the automatic error printing.
54  static void setAutoPrint(H5E_auto2_t& func, void* client_data);
55 
56  // Turns off the automatic error printing.
57  static void dontPrint();
58 
59  // Retrieves the current settings for the automatic error stack
60  // traversal function and its data.
61  static void getAutoPrint(H5E_auto2_t& func, void** client_data);
62 
63  // Clears the error stack for the current thread.
64  static void clearErrorStack();
65 
66  // Walks the error stack for the current thread, calling the
67  // specified function.
68  static void walkErrorStack(H5E_direction_t direction,
69  H5E_walk2_t func, void* client_data);
70 
71  // Prints the error stack in a default manner.
72  static void printErrorStack(FILE* stream = stderr,
73  hid_t err_stack = H5E_DEFAULT); // Static
74  virtual void printError(FILE* stream = NULL) const;
75 
76  // Default constructor
77  Exception();
78 
79  // copy constructor
80  Exception(const Exception& orig);
81 
82  // virtual Destructor
83  virtual ~Exception() throw();
84 
85  protected:
86  // Default value for detail_message
87  static const char DEFAULT_MSG[];
88 
89  private:
92 };
93 
95  public:
96  LocationException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
98  virtual ~LocationException() throw();
99 };
100 
102  public:
103  GroupIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
104  GroupIException();
105  virtual ~GroupIException() throw();
106 };
107 
109  public:
110  FileIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
111  FileIException();
112  virtual ~FileIException() throw();
113 };
114 
116  public:
117  DataSpaceIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
119  virtual ~DataSpaceIException() throw();
120 };
121 
123  public:
124  DataTypeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
126  virtual ~DataTypeIException() throw();
127 };
128 
130  public:
131  PropListIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
133  virtual ~PropListIException() throw();
134 };
135 
137  public:
138  DataSetIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
140  virtual ~DataSetIException() throw();
141 };
142 
144  public:
145  AttributeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
147  virtual ~AttributeIException() throw();
148 };
149 
151  public:
152  ReferenceException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
154  virtual ~ReferenceException() throw();
155 };
156 
158  public:
159  LibraryIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
161  virtual ~LibraryIException() throw();
162 };
163 
165  public:
166  IdComponentException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
168  virtual ~IdComponentException() throw();
169 
170 }; // end of IdComponentException
171 } // namespace H5
172 
173 #endif // __H5Exception_H
#define H5_DLLCPP
Definition: H5api_adpt.h:262
herr_t(* H5E_auto2_t)(hid_t estack, void *client_data)
Definition: H5Epublic.h:152
Exception provides wrappers of HDF5 error handling functions.
Definition: H5Exception.h:33
H5E_direction_t
Definition: H5Epublic.h:139
herr_t(* H5E_walk2_t)(unsigned n, const H5E_error2_t *err_desc, void *client_data)
Definition: H5Epublic.h:150
#define H5std_string
Definition: H5Exception.h:25
int hid_t
Definition: H5Ipublic.h:54
H5std_string func_name
Definition: H5Exception.h:91
#define H5E_DEFAULT
Definition: H5Epublic.h:27
H5std_string detail_message
Definition: H5Exception.h:90

MISR Toolkit - Copyright © 2005 - 2020 Jet Propulsion Laboratory
Generated on Fri Jun 19 2020 22:49:52