HDF5 C++ API Reference Manual

 

 

 

Main Page | Namespace List | Class Hierarchy | Class List | File List | Class 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 [email protected]. *
00014  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
00015 
00016 #ifndef _H5Exception_H
00017 #define _H5Exception_H
00018 
00019 #include <string>
00020 
00021 #ifndef H5_NO_NAMESPACE
00022 namespace H5 {
00023 #ifndef H5_NO_STD
00024     using namespace std;
00025 #endif  // H5_NO_STD
00026 #endif
00027 
00028 class H5_DLLCPP Exception {
00029    public:
00030         // Creates an exception with a function name where the failure occurs
00031         // and an optional detailed message
00032         Exception(const string func_name, const string message = DEFAULT_MSG);
00033 
00034         // Returns a character string that describes the error specified by
00035         // a major error number.
00036         string getMajorString( H5E_major_t major_num ) const;
00037 
00038         // Returns a character string that describes the error specified by
00039         // a minor error number.
00040         string getMinorString( H5E_minor_t minor_num ) const;
00041 
00042         // Returns the detailed message set at the time the exception is thrown
00043         string getDetailMsg() const;
00044         const char* getCDetailMsg() const;      // C string of detailed message
00045         string getFuncName() const;     // function name as a string object
00046         const char* getCFuncName() const;       // function name as a char string
00047 
00048         // Turns on the automatic error printing.
00049         static void setAutoPrint( H5E_auto_t& func, void* client_data);
00050 
00051         // Turns off the automatic error printing.
00052         static void dontPrint();
00053 
00054         // Retrieves the current settings for the automatic error stack
00055         // traversal function and its data.
00056         static void getAutoPrint( H5E_auto_t& func, void** client_data);
00057 
00058         // Clears the error stack for the current thread.
00059         static void clearErrorStack();
00060 
00061         // Walks the error stack for the current thread, calling the
00062         // specified function.
00063         static void walkErrorStack( H5E_direction_t direction,
00064                                 H5E_walk_t func, void* client_data);
00065 
00066         // Prints the error stack in a default manner.
00067         virtual void printError( FILE* stream = NULL ) const;
00068 
00069         // Default constructor
00070         Exception();
00071 
00072         // copy constructor
00073         Exception( const Exception& orig);
00074 
00075         // virtual Destructor
00076         virtual ~Exception();
00077 
00078    private:
00079 // Because 'string' is not instantiated at compilation time, this
00080 // warning is displayed when building DLL; but the class is exported
00081 // so the warning is harmless
00082 #if defined(WIN32)
00083 #pragma warning(disable: 4251)
00084 #endif
00085         string detail_message;
00086         string func_name;
00087 
00088    protected:
00089         // Default value for detail_message
00090         static const string DEFAULT_MSG;
00091 };
00092 
00093 class H5_DLLCPP FileIException : public Exception {
00094    public:
00095         FileIException( const string func_name, const string message = DEFAULT_MSG);
00096         FileIException();
00097         virtual ~FileIException();
00098 };
00099 
00100 class H5_DLLCPP GroupIException : public Exception {
00101    public:
00102         GroupIException( const string func_name, const string message = DEFAULT_MSG);
00103         GroupIException();
00104         virtual ~GroupIException();
00105 };
00106 
00107 class H5_DLLCPP DataSpaceIException : public Exception {
00108    public:
00109         DataSpaceIException(const string func_name, const string message = DEFAULT_MSG);
00110         DataSpaceIException();
00111         virtual ~DataSpaceIException();
00112 };
00113 
00114 class H5_DLLCPP DataTypeIException : public Exception {
00115    public:
00116         DataTypeIException(const string func_name, const string message = DEFAULT_MSG);
00117         DataTypeIException();
00118         virtual ~DataTypeIException();
00119 };
00120 
00121 class H5_DLLCPP PropListIException : public Exception {
00122    public:
00123         PropListIException(const string func_name, const string message = DEFAULT_MSG);
00124         PropListIException();
00125         virtual ~PropListIException();
00126 };
00127 
00128 class H5_DLLCPP DataSetIException : public Exception {
00129    public:
00130         DataSetIException(const string func_name, const string message = DEFAULT_MSG);
00131         DataSetIException();
00132         virtual ~DataSetIException();
00133 };
00134 
00135 class H5_DLLCPP AttributeIException : public Exception {
00136    public:
00137         AttributeIException(const string func_name, const string message = DEFAULT_MSG);
00138         AttributeIException();
00139         virtual ~AttributeIException();
00140 };
00141 
00142 class H5_DLLCPP ReferenceException : public Exception {
00143    public:
00144         ReferenceException(const string func_name, const string message = DEFAULT_MSG);
00145         ReferenceException();
00146         virtual ~ReferenceException();
00147 };
00148 
00149 class H5_DLLCPP LibraryIException : public Exception {
00150    public:
00151         LibraryIException(const string func_name, const string message = DEFAULT_MSG);
00152         LibraryIException();
00153         virtual ~LibraryIException();
00154 };
00155 
00156 class H5_DLLCPP IdComponentException : public Exception {
00157    public:
00158         IdComponentException(const string func_name, const string message = DEFAULT_MSG);
00159         IdComponentException();
00160         virtual ~IdComponentException();
00161 };
00162 
00163 #ifndef H5_NO_NAMESPACE
00164 }
00165 #endif
00166 
00167 #endif // _H5Exception_H

Generated on Mon Oct 31 04:59:47 2005 by  doxygen 1.4.2