HDF5 C++ API Reference Manual

 

 

Main Page | Namespace List | Class Hierarchy | Compound List | File List | Compound Members | File Members | Examples

H5Exception.h

Go to the documentation of this file.
00001 // C++ informative line for the emacs editor: -*- C++ -*-
00002 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00003  * Copyright by the Board of Trustees of the University of Illinois.         *
00004  * All rights reserved.                                                      *
00005  *                                                                           *
00006  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
00007  * terms governing use, modification, and redistribution, is contained in    *
00008  * the files COPYING and Copyright.html.  COPYING can be found at the root   *
00009  * of the source code distribution tree; Copyright.html can be found at the  *
00010  * root level of an installed copy of the electronic HDF5 document set and   *
00011  * is linked from the top-level documents page.  It can also be found at     *
00012  * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html.  If you do not have     *
00013  * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
00014  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
00015 
00016 #ifndef _H5Exception_H
00017 #define _H5Exception_H
00018 
00019 #include <string>
00020 
00021 #ifndef H5_NO_NAMESPACE
00022 namespace H5 {
00023 #ifdef H5_NO_STD
00024     #define H5std_string ::string
00025 #else
00026     #define H5std_string std::string
00027 #endif
00028 #endif
00029 
00030 class H5_DLLCPP Exception {
00031    public:
00032         // Creates an exception with a function name where the failure occurs
00033         // and an optional detailed message
00034         Exception(const H5std_string func_name, const H5std_string message = DEFAULT_MSG);
00035 
00036         // Returns a character string that describes the error specified by
00037         // a major error number.
00038         H5std_string getMajorString( hid_t err_major_id ) const;
00039 
00040         // Returns a character string that describes the error specified by
00041         // a minor error number.
00042         H5std_string getMinorString( hid_t err_minor_id ) const;
00043 
00044         // Returns the detailed message set at the time the exception is thrown
00045         H5std_string getDetailMsg() const;
00046         const char* getCDetailMsg() const;      // C string of detailed message
00047         H5std_string getFuncName() const;       // function name as a string object
00048         const char* getCFuncName() const;       // function name as a char string
00049 
00050         // Turns on the automatic error printing.
00051         static void setAutoPrint( H5E_auto_stack_t& func, void* client_data);
00052 
00053         // Turns off the automatic error printing.
00054         static void dontPrint();
00055 
00056         // Retrieves the current settings for the automatic error stack
00057         // traversal function and its data.
00058         static void getAutoPrint( H5E_auto_stack_t& func, void** client_data);
00059 
00060         // Clears the error stack for the current thread.
00061         static void clearErrorStack();
00062 
00063         // Walks the error stack for the current thread, calling the
00064         // specified function.
00065         static void walkErrorStack( H5E_direction_t direction,
00066                                 H5E_walk_t func, void* client_data);
00067 
00068         // Prints the error stack in a default manner.
00069         virtual void printError( FILE* stream = NULL ) const;
00070 
00071         // Default constructor
00072         Exception();
00073 
00074         // copy constructor
00075         Exception( const Exception& orig);
00076 
00077         // virtual Destructor
00078         virtual ~Exception();
00079 
00080    private:
00081 // Because 'string' is not instantiated at compilation time, this
00082 // warning is displayed when building DLL; but the class is exported
00083 // so the warning is harmless
00084 #if defined(WIN32)
00085 #pragma warning(disable: 4251)
00086 #endif
00087         H5std_string detail_message;
00088         H5std_string func_name;
00089 
00090    protected:
00091         // Default value for detail_message
00092         static const H5std_string DEFAULT_MSG;
00093 };
00094 
00095 class H5_DLLCPP FileIException : public Exception {
00096    public:
00097         FileIException( const H5std_string func_name, const H5std_string message = DEFAULT_MSG);
00098         FileIException();
00099         virtual ~FileIException();
00100 };
00101 
00102 class H5_DLLCPP GroupIException : public Exception {
00103    public:
00104         GroupIException( const H5std_string func_name, const H5std_string message = DEFAULT_MSG);
00105         GroupIException();
00106         virtual ~GroupIException();
00107 };
00108 
00109 class H5_DLLCPP DataSpaceIException : public Exception {
00110    public:
00111         DataSpaceIException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG);
00112         DataSpaceIException();
00113         virtual ~DataSpaceIException();
00114 };
00115 
00116 class H5_DLLCPP DataTypeIException : public Exception {
00117    public:
00118         DataTypeIException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG);
00119         DataTypeIException();
00120         virtual ~DataTypeIException();
00121 };
00122 
00123 class H5_DLLCPP PropListIException : public Exception {
00124    public:
00125         PropListIException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG);
00126         PropListIException();
00127         virtual ~PropListIException();
00128 };
00129 
00130 class H5_DLLCPP DataSetIException : public Exception {
00131    public:
00132         DataSetIException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG);
00133         DataSetIException();
00134         virtual ~DataSetIException();
00135 };
00136 
00137 class H5_DLLCPP AttributeIException : public Exception {
00138    public:
00139         AttributeIException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG);
00140         AttributeIException();
00141         virtual ~AttributeIException();
00142 };
00143 
00144 class H5_DLLCPP ReferenceException : public Exception {
00145    public:
00146         ReferenceException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG);
00147         ReferenceException();
00148         virtual ~ReferenceException();
00149 };
00150 
00151 class H5_DLLCPP LibraryIException : public Exception {
00152    public:
00153         LibraryIException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG);
00154         LibraryIException();
00155         virtual ~LibraryIException();
00156 };
00157 
00158 class H5_DLLCPP IdComponentException : public Exception {
00159    public:
00160         IdComponentException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG);
00161         IdComponentException();
00162         virtual ~IdComponentException();
00163 };
00164 
00165 #ifndef H5_NO_NAMESPACE
00166 }
00167 #endif
00168 
00169 #endif // _H5Exception_H

Generated on Thu Apr 20 15:16:40 2006 by doxygen 1.3.2