summaryrefslogtreecommitdiffstats
path: root/c++/src/H5DataType.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2005-07-10 11:26:56 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2005-07-10 11:26:56 (GMT)
commitb14a4fd95f5c71f31ec344e13a7c398015da41e6 (patch)
treed51925c61682fdf2e3e9422abb08ca753749ab9b /c++/src/H5DataType.cpp
parent6aa7ea9331f4181f29d6a19bf9d53fc330c3ff88 (diff)
downloadhdf5-b14a4fd95f5c71f31ec344e13a7c398015da41e6.zip
hdf5-b14a4fd95f5c71f31ec344e13a7c398015da41e6.tar.gz
hdf5-b14a4fd95f5c71f31ec344e13a7c398015da41e6.tar.bz2
[svn-r11060] Purpose: Fix bug (reported by user)
Description: The use of FileCreatPropList::DEFAULT sometimes caused failure in the reference counting area. This occurs to all the default property lists, which also include FileAccPropList::DEFAULT, DSetCreatPropList::DEFAULT, and DSetMemXferPropList::DEFAULT. H5P_DEFAULT was used to create these default prop lists and because its value is 0, the id of these prop lists are 0, which is rejected by the H5I functions during the reference counting. Solution: The main action to fix the above problem was to use H5P_FILE_CREATE H5P_FILE_ACCESS H5P_DATASET_CREATE H5P_DATASET_XFER to define the default property lists accordingly. Yet, when this fix was applied, some bug in reference counting was revealed. It appeared that some ids were not incremented but were passed in for decrementing. The following actions were then taken to fix and improve the current use of reference counting H5I functions. * added private func IdComponent::p_valid_id to verify that the id is a valid id and can be passed into an H5I function * used p_valid_id to validate an id before calling an H5I functions in the reference-counting member functions incRefCount, decRefCount, and getCounter * changed to use member function incRefCount, decRefCount, and getCounter instead of the C APIs H5Iinc_ref, H5Idec_ref, and H5Iget_ref throughout IdComponent. In addition, overloadings were added for incRefCount, decRefCount, and getCounter to take an id different than the id of the current instance; they can be convenient during debugging. Platforms tested: Linux 2.4 (heping) SunOS 5.8 64-bit (sol) AIX 5.1 (copper)
Diffstat (limited to 'c++/src/H5DataType.cpp')
-rw-r--r--c++/src/H5DataType.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp
index 6e5d584..1d2a519 100644
--- a/c++/src/H5DataType.cpp
+++ b/c++/src/H5DataType.cpp
@@ -96,7 +96,7 @@ DataType::DataType(const DataType& original) : H5Object(original)
// Programmer Binh-Minh Ribler - 2000
// Modification
// Replaced resetIdComponent with decRefCount to use C library
-// ID reference counting mechanism - BMR, Feb 20, 2005
+// ID reference counting mechanism - June 1, 2004
//--------------------------------------------------------------------------
void DataType::copy( const DataType& like_type )
{
@@ -538,7 +538,7 @@ bool DataType::isVariableStr() const
///\param dataspace - IN: Dataspace with selection
///\param ref_type - IN: Type of reference; default to \c H5R_DATASET_REGION
///\return A reference
-///\exception H5::ReferenceIException
+///\exception H5::IdComponentException
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
void* DataType::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_type) const
@@ -553,7 +553,7 @@ void* DataType::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref
/// a reference to an HDF5 object, not to a dataset region.
///\param name - IN: Name of the object to be referenced
///\return A reference
-///\exception H5::ReferenceIException
+///\exception H5::IdComponentException
///\par Description
// This function passes H5R_OBJECT and -1 to the protected
// function for it to pass to the C API H5Rcreate
@@ -575,7 +575,7 @@ void* DataType::Reference(const char* name) const
/// \li \c H5G_GROUP Object is a group.
/// \li \c H5G_DATASET Object is a dataset.
/// \li \c H5G_TYPE Object is a named datatype
-///\exception H5::ReferenceIException
+///\exception H5::IdComponentException
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
H5G_obj_t DataType::getObjType(void *ref, H5R_type_t ref_type) const
@@ -589,7 +589,7 @@ H5G_obj_t DataType::getObjType(void *ref, H5R_type_t ref_type) const
///\param ref - IN: Reference to get region of
///\param ref_type - IN: Type of reference to get region of - default
///\return DataSpace instance
-///\exception H5::ReferenceIException
+///\exception H5::IdComponentException
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
DataSpace DataType::getRegion(void *ref, H5R_type_t ref_type) const
@@ -628,7 +628,7 @@ void DataType::close()
// Programmer Binh-Minh Ribler - 2000
// Modification
// Replaced resetIdComponent with decRefCount to use C library
-// ID reference counting mechanism - BMR, Feb 20, 2005
+// ID reference counting mechanism - June 1, 2004
//--------------------------------------------------------------------------
DataType::~DataType()
{