diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2005-03-18 05:36:42 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2005-03-18 05:36:42 (GMT) |
commit | cde84a55f48f83e5e13ca6138f5224ede7b612a6 (patch) | |
tree | 29ea1e65c162bf892cf8e9f5652834339bebdb1c /c++/src/H5DataSpace.cpp | |
parent | 1e85060177b43f4cdc8ee2c5381d636e85f2ae40 (diff) | |
download | hdf5-cde84a55f48f83e5e13ca6138f5224ede7b612a6.zip hdf5-cde84a55f48f83e5e13ca6138f5224ede7b612a6.tar.gz hdf5-cde84a55f48f83e5e13ca6138f5224ede7b612a6.tar.bz2 |
[svn-r10233] 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.cpp | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index d13deed..74ea525 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -94,8 +94,8 @@ DataSpace::DataSpace( const DataSpace& original ) : IdComponent( original ) {} ///\exception H5::DataSpaceIException // Programmer Binh-Minh Ribler - 2000 // Modification -// Replaced resetIdComponent with decRefCount to use new ID -// reference counting mechanisms by QAK, Feb 20, 2005 +// Replaced resetIdComponent with decRefCount to use C library +// ID reference counting mechanism - BMR, Feb 20, 2005 //-------------------------------------------------------------------------- void DataSpace::copy( const DataSpace& like_space ) { @@ -537,37 +537,35 @@ void DataSpace::selectHyperslab( H5S_seloper_t op, const hsize_t *count, const h } } -#ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: DataSpace::p_close (private) -// Purpose: Closes the dataspace if it is not a constant. -// Exception H5::DataSpaceIException -// Description -// This function will be obsolete because its functionality -// is recently handled by the C library layer. - May, 2004 -// Programmer Binh-Minh Ribler - 2000 +// Function: DataSpace::close +///\brief Closes this dataspace. +///\exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - Mar 9, 2005 //-------------------------------------------------------------------------- -void DataSpace::p_close() const +void DataSpace::close() { - hid_t space_id = id; - if( space_id != H5S_ALL ) // not a constant, should call H5Sclose + if( id != H5S_ALL ) // not a constant, should call H5Sclose { - herr_t ret_value = H5Sclose( space_id ); + herr_t ret_value = H5Sclose(id); if( ret_value < 0 ) { - throw DataSpaceIException(0, "H5Sclose failed"); + 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"); } -#endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: DataSpace destructor ///\brief Properly terminates access to this dataspace. // Programmer Binh-Minh Ribler - 2000 // Modification -// Replaced resetIdComponent with decRefCount to use new ID -// reference counting mechanisms by QAK, Feb 20, 2005 +// Replaced resetIdComponent with decRefCount to use C library +// ID reference counting mechanism - BMR, Feb 20, 2005 //-------------------------------------------------------------------------- DataSpace::~DataSpace() { @@ -578,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 } |