summaryrefslogtreecommitdiffstats
path: root/c++/src/H5DataSpace.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/H5DataSpace.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/H5DataSpace.cpp')
-rw-r--r--c++/src/H5DataSpace.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp
index 7250285..9936f93 100644
--- a/c++/src/H5DataSpace.cpp
+++ b/c++/src/H5DataSpace.cpp
@@ -538,6 +538,28 @@ void DataSpace::selectHyperslab( H5S_seloper_t op, const hsize_t *count, const h
}
//--------------------------------------------------------------------------
+// Function: DataSpace::close
+///\brief Closes this dataspace.
+///\exception H5::DataSpaceIException
+// Programmer Binh-Minh Ribler - Mar 9, 2005
+//--------------------------------------------------------------------------
+void DataSpace::close()
+{
+ if( id != H5S_ALL ) // not a constant, should call H5Sclose
+ {
+ herr_t ret_value = H5Sclose(id);
+ if( ret_value < 0 )
+ {
+ throw DataSpaceIException("DataSpace::close", "H5Sclose failed");
+ }
+ // reset the id because the dataspace that it represents is now closed
+ id = 0;
+ }
+ else // cannot close a constant
+ throw DataSpaceIException("DataSpace::close", "Cannot close a constant");
+}
+
+//--------------------------------------------------------------------------
// Function: DataSpace destructor
///\brief Properly terminates access to this dataspace.
// Programmer Binh-Minh Ribler - 2000
@@ -554,7 +576,7 @@ DataSpace::~DataSpace()
decRefCount();
}
catch (Exception close_error) {
- throw DataSpaceIException("DataSpace::copy", close_error.getDetailMsg());
+ cerr << "DataSpace::~DataSpace - " << close_error.getDetailMsg() << endl;
}
} // if
}