summaryrefslogtreecommitdiffstats
path: root/c++/src/H5DataType.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2005-03-14 19:32:26 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2005-03-14 19:32:26 (GMT)
commit49fa4563ef21009a05c11da5e05d0e71d2c24366 (patch)
tree73f57a583375fef27b3616e0febaa786394c7ae5 /c++/src/H5DataType.cpp
parent7e6577fdea9f78e4b140f2b1c7684c9cec7d9a7e (diff)
downloadhdf5-49fa4563ef21009a05c11da5e05d0e71d2c24366.zip
hdf5-49fa4563ef21009a05c11da5e05d0e71d2c24366.tar.gz
hdf5-49fa4563ef21009a05c11da5e05d0e71d2c24366.tar.bz2
[svn-r10212] Purpose: Added more wrappers
Description: Added the following to the C++ library + overloaded functions: string CommonFG::getObjnameByIdx(hsize_t idx) H5T_order_t AtomType::getOrder() + wrappers for H5*close + wrappers for H5Arename, H5Aget_storage_size, and H5Dget_storage_size Platforms tested: Linux 2.4 (heping) AIX 5.1 (copper) SunOS 5.8 64-bit (sol)
Diffstat (limited to 'c++/src/H5DataType.cpp')
-rw-r--r--c++/src/H5DataType.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp
index 68c8b5d..e370531 100644
--- a/c++/src/H5DataType.cpp
+++ b/c++/src/H5DataType.cpp
@@ -598,6 +598,29 @@ DataSpace DataType::getRegion(void *ref, H5R_type_t ref_type) const
}
//--------------------------------------------------------------------------
+// Function: DataType::close
+///\brief Closes the datatype if it is not a predefined type.
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - Mar 9, 2005
+//--------------------------------------------------------------------------
+void DataType::close()
+{
+ // If this datatype is not a predefined type, call H5Tclose on it.
+ if( is_predtype == false )
+ {
+ herr_t ret_value = H5Tclose(id);
+ if( ret_value < 0 )
+ {
+ throw DataTypeIException("DataType::close", "H5Tclose failed");
+ }
+ // reset the id because the datatype that it represents is now closed
+ id = 0;
+ }
+ else // cannot close a predefined type
+ throw DataTypeIException("DataType::close", "Cannot close a predefined type");
+}
+
+//--------------------------------------------------------------------------
// Function: DataType destructor
///\brief Properly terminates access to this datatype.
// Programmer Binh-Minh Ribler - 2000