00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _H5Exception_H
00018 #define _H5Exception_H
00019
00020 #include <string>
00021
00022 #ifndef H5_NO_NAMESPACE
00023 namespace H5 {
00024 #ifdef H5_NO_STD
00025 #define H5std_string ::string
00026 #else
00027 #define H5std_string std::string
00028 #endif
00029 #endif
00030
00031 class H5_DLLCPP Exception {
00032 public:
00033
00034
00035 Exception(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
00036
00037
00038
00039 H5std_string getMajorString( hid_t err_major_id ) const;
00040
00041
00042
00043 H5std_string getMinorString( hid_t err_minor_id ) const;
00044
00045
00046 H5std_string getDetailMsg() const;
00047 const char* getCDetailMsg() const;
00048 H5std_string getFuncName() const;
00049 const char* getCFuncName() const;
00050
00051
00052 static void setAutoPrint( H5E_auto2_t& func, void* client_data);
00053
00054
00055 static void dontPrint();
00056
00057
00058
00059 static void getAutoPrint( H5E_auto2_t& func, void** client_data);
00060
00061
00062 static void clearErrorStack();
00063
00064
00065
00066 static void walkErrorStack( H5E_direction_t direction,
00067 H5E_walk2_t func, void* client_data);
00068
00069
00070 virtual void printError( FILE* stream = NULL ) const;
00071
00072
00073 Exception();
00074
00075
00076 Exception( const Exception& orig);
00077
00078
00079 virtual ~Exception();
00080
00081 private:
00082 H5std_string detail_message;
00083 H5std_string func_name;
00084
00085 protected:
00086
00087 static const H5std_string DEFAULT_MSG;
00088 };
00089
00090 class H5_DLLCPP FileIException : public Exception {
00091 public:
00092 FileIException( const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
00093 FileIException();
00094 virtual ~FileIException();
00095 };
00096
00097 class H5_DLLCPP GroupIException : public Exception {
00098 public:
00099 GroupIException( const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
00100 GroupIException();
00101 virtual ~GroupIException();
00102 };
00103
00104 class H5_DLLCPP DataSpaceIException : public Exception {
00105 public:
00106 DataSpaceIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
00107 DataSpaceIException();
00108 virtual ~DataSpaceIException();
00109 };
00110
00111 class H5_DLLCPP DataTypeIException : public Exception {
00112 public:
00113 DataTypeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
00114 DataTypeIException();
00115 virtual ~DataTypeIException();
00116 };
00117
00118 class H5_DLLCPP PropListIException : public Exception {
00119 public:
00120 PropListIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
00121 PropListIException();
00122 virtual ~PropListIException();
00123 };
00124
00125 class H5_DLLCPP DataSetIException : public Exception {
00126 public:
00127 DataSetIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
00128 DataSetIException();
00129 virtual ~DataSetIException();
00130 };
00131
00132 class H5_DLLCPP AttributeIException : public Exception {
00133 public:
00134 AttributeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
00135 AttributeIException();
00136 virtual ~AttributeIException();
00137 };
00138
00139 class H5_DLLCPP ReferenceException : public Exception {
00140 public:
00141 ReferenceException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
00142 ReferenceException();
00143 virtual ~ReferenceException();
00144 };
00145
00146 class H5_DLLCPP LibraryIException : public Exception {
00147 public:
00148 LibraryIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
00149 LibraryIException();
00150 virtual ~LibraryIException();
00151 };
00152
00153 class H5_DLLCPP IdComponentException : public Exception {
00154 public:
00155 IdComponentException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
00156 IdComponentException();
00157 virtual ~IdComponentException();
00158 };
00159
00160 #ifndef H5_NO_NAMESPACE
00161 }
00162 #endif
00163
00164 #endif // _H5Exception_H