My Project 1.10.10
Loading...
Searching...
No Matches
H5Exception.h
1// C++ informative line for the emacs editor: -*- C++ -*-
2/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
3 * Copyright by The HDF Group. *
4 * All rights reserved. *
5 * *
6 * This file is part of HDF5. The full HDF5 copyright notice, including *
7 * terms governing use, modification, and redistribution, is contained in *
8 * the COPYING file, which can be found at the root of the source code *
9 * distribution tree, or in https://www.hdfgroup.org/licenses. *
10 * If you do not have access to either file, you may request a copy from *
11 * help@hdfgroup.org. *
12 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13
14#ifndef H5Exception_H
15#define H5Exception_H
16
17#include <string>
18
19namespace H5 {
20#define H5std_string std::string
21
27class H5_DLLCPP Exception {
28 public:
29 // Creates an exception with a function name where the failure occurs
30 // and an optional detailed message
31 Exception(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
32
33 // Returns a character string that describes the error specified by
34 // a major error number.
35 H5std_string getMajorString(hid_t err_major_id) const;
36
37 // Returns a character string that describes the error specified by
38 // a minor error number.
39 H5std_string getMinorString(hid_t err_minor_id) const;
40
41 // Returns the detailed message set at the time the exception is thrown
42 H5std_string getDetailMsg() const;
43 const char *getCDetailMsg() const; // C string of detailed message
44 H5std_string getFuncName() const; // function name as a string object
45 const char *getCFuncName() const; // function name as a char string
46
47 // Turns on the automatic error printing.
48 static void setAutoPrint(H5E_auto2_t &func, void *client_data);
49
50 // Turns off the automatic error printing.
51 static void dontPrint();
52
53 // Retrieves the current settings for the automatic error stack
54 // traversal function and its data.
55 static void getAutoPrint(H5E_auto2_t &func, void **client_data);
56
57 // Clears the error stack for the current thread.
58 static void clearErrorStack();
59
60 // Walks the error stack for the current thread, calling the
61 // specified function.
62 static void walkErrorStack(H5E_direction_t direction, H5E_walk2_t func, void *client_data);
63
64 // Prints the error stack in a default manner.
65 static void printErrorStack(FILE *stream = stderr, hid_t err_stack = H5E_DEFAULT);
66 // Deprecated in favor of printErrorStack.
67 // Removed from code. -BMR, 2017/08/11 1.8.20 and 1.10.2
68 // virtual void printError(FILE* stream = NULL) const;
69
70 // Default constructor
71 Exception();
72
73 // copy constructor
74 Exception(const Exception &orig);
75
76 // virtual Destructor
77 virtual ~Exception() throw();
78
79 protected:
80 // Default value for detail_message
81 static const char DEFAULT_MSG[];
82
83 private:
84 H5std_string detail_message;
85 H5std_string func_name;
86};
87
88class H5_DLLCPP FileIException : public Exception {
89 public:
90 FileIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
92 virtual ~FileIException() throw() H5_OVERRIDE;
93};
94
95class H5_DLLCPP GroupIException : public Exception {
96 public:
97 GroupIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
99 virtual ~GroupIException() throw() H5_OVERRIDE;
100};
101
102class H5_DLLCPP DataSpaceIException : public Exception {
103 public:
104 DataSpaceIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
106 virtual ~DataSpaceIException() throw() H5_OVERRIDE;
107};
108
109class H5_DLLCPP DataTypeIException : public Exception {
110 public:
111 DataTypeIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
113 virtual ~DataTypeIException() throw() H5_OVERRIDE;
114};
115
116class H5_DLLCPP ObjHeaderIException : public Exception {
117 public:
118 ObjHeaderIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
120 virtual ~ObjHeaderIException() throw() H5_OVERRIDE;
121};
122
123class H5_DLLCPP PropListIException : public Exception {
124 public:
125 PropListIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
127 virtual ~PropListIException() throw() H5_OVERRIDE;
128};
129
130class H5_DLLCPP DataSetIException : public Exception {
131 public:
132 DataSetIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
134 virtual ~DataSetIException() throw() H5_OVERRIDE;
135};
136
137class H5_DLLCPP AttributeIException : public Exception {
138 public:
139 AttributeIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
141 virtual ~AttributeIException() throw() H5_OVERRIDE;
142};
143
144class H5_DLLCPP ReferenceException : public Exception {
145 public:
146 ReferenceException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
148 virtual ~ReferenceException() throw() H5_OVERRIDE;
149};
150
151class H5_DLLCPP LibraryIException : public Exception {
152 public:
153 LibraryIException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
155 virtual ~LibraryIException() throw() H5_OVERRIDE;
156};
157
158class H5_DLLCPP LocationException : public Exception {
159 public:
160 LocationException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
162 virtual ~LocationException() throw() H5_OVERRIDE;
163};
164
165class H5_DLLCPP IdComponentException : public Exception {
166 public:
167 IdComponentException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
169 virtual ~IdComponentException() throw() H5_OVERRIDE;
170
171}; // end of IdComponentException
172} // namespace H5
173
174#endif // H5Exception_H
Definition H5Exception.h:137
Definition H5Exception.h:130
Definition H5Exception.h:102
Definition H5Exception.h:109
Exception provides wrappers of HDF5 error handling functions.
Definition H5Exception.h:27
Definition H5Exception.h:88
Definition H5Exception.h:95
Definition H5Exception.h:165
Definition H5Exception.h:151
Definition H5Exception.h:158
Definition H5Exception.h:116
Definition H5Exception.h:123
Definition H5Exception.h:144
Definition H5AbstractDs.cpp:33


The HDF Group Help Desk:
  Copyright by The HDF Group