summaryrefslogtreecommitdiffstats
path: root/c++/src/H5Exception.h
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2018-05-10 18:04:28 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2018-05-10 18:04:28 (GMT)
commitc32b7387083d574bfa5fc31fffc45cbf21b6a1f0 (patch)
tree665af0c032ce6dda6d110da87e4a66d05b016bb2 /c++/src/H5Exception.h
parentffd98d490f04952e01629c6378c4528459db9f9a (diff)
downloadhdf5-c32b7387083d574bfa5fc31fffc45cbf21b6a1f0.zip
hdf5-c32b7387083d574bfa5fc31fffc45cbf21b6a1f0.tar.gz
hdf5-c32b7387083d574bfa5fc31fffc45cbf21b6a1f0.tar.bz2
C++ API improvement
Description: - Reorganized some exception classes to reflect the HDF5 object hierarchy and provide extendibility. DataSetIException -> LocationException -> Exception DataTypeIException -> LocationException -> Exception GroupIException -> LocationException -> Exception AttributeIException -> LocationException -> Exception FileIException -> GroupIException -> LocationException -> Exception - Added throwException() to these subclasses and use it in H5Location and H5Object member functions to throw an exception that is specific to the object that invokes the member function. Applications that catch the base exception can continue to do the same. - Many cleanup for inconsistencies in comments/headers. Platforms tested: Linux/64 (jelly) Linux/64 (platypus) Darwin (osx1010test)
Diffstat (limited to 'c++/src/H5Exception.h')
-rw-r--r--c++/src/H5Exception.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h
index 7315e11..e15d81c 100644
--- a/c++/src/H5Exception.h
+++ b/c++/src/H5Exception.h
@@ -91,20 +91,27 @@ class H5_DLLCPP Exception {
H5std_string func_name;
};
-class H5_DLLCPP FileIException : public Exception {
+class H5_DLLCPP LocationException : public Exception {
public:
- FileIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
- FileIException();
- virtual ~FileIException() throw();
+ LocationException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
+ LocationException();
+ virtual ~LocationException() throw();
};
-class H5_DLLCPP GroupIException : public Exception {
+class H5_DLLCPP GroupIException : public LocationException {
public:
GroupIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
GroupIException();
virtual ~GroupIException() throw();
};
+class H5_DLLCPP FileIException : public GroupIException {
+ public:
+ FileIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
+ FileIException();
+ virtual ~FileIException() throw();
+};
+
class H5_DLLCPP DataSpaceIException : public Exception {
public:
DataSpaceIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
@@ -112,7 +119,7 @@ class H5_DLLCPP DataSpaceIException : public Exception {
virtual ~DataSpaceIException() throw();
};
-class H5_DLLCPP DataTypeIException : public Exception {
+class H5_DLLCPP DataTypeIException : public LocationException {
public:
DataTypeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
DataTypeIException();
@@ -126,14 +133,14 @@ class H5_DLLCPP PropListIException : public Exception {
virtual ~PropListIException() throw();
};
-class H5_DLLCPP DataSetIException : public Exception {
+class H5_DLLCPP DataSetIException : public LocationException {
public:
DataSetIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
DataSetIException();
virtual ~DataSetIException() throw();
};
-class H5_DLLCPP AttributeIException : public Exception {
+class H5_DLLCPP AttributeIException : public LocationException {
public:
AttributeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
AttributeIException();
@@ -154,13 +161,6 @@ class H5_DLLCPP LibraryIException : public Exception {
virtual ~LibraryIException() throw();
};
-class H5_DLLCPP LocationException : public Exception {
- public:
- LocationException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
- LocationException();
- virtual ~LocationException() throw();
-};
-
class H5_DLLCPP IdComponentException : public Exception {
public:
IdComponentException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);