[svn-r24188] Purpose: Fixed bug introduced in r24163

Description:
    - The failure in daily test was caused by missing initialization of member
    "id" in a few constructors.  This is now fixed.
    - Added two overloaded H5Location::setComment
    - Improved some error reporting in H5Location
    - Improved error reporting in tests
Platforms tested:
    Linux/32 2.6 (jam)
    SunOS 5.11 (emu)
    Linux/64 2.6 (koala)/PGI compilers
This commit is contained in:
Binh-Minh Ribler
2013-09-22 19:39:44 -05:00
parent f9a758f442
commit f8fb310610
21 changed files with 997 additions and 561 deletions

View File

@@ -79,57 +79,29 @@ DataSet::DataSet(const DataSet& original) : AbstractDs(original), H5Object(origi
//--------------------------------------------------------------------------
// Function: DataSet overload constructor - dereference
///\brief Given a reference, ref, to an hdf5 dataset, creates a
///\brief Given a reference, ref, to an hdf5 location, creates a
/// DataSet object
///\param obj - IN: Dataset reference object is in or location of
///\param loc - IN: Dataset reference object is in or location of
/// object that the dataset is located within.
///\param ref - IN: Reference pointer
///\param ref_type - IN: Reference type - default to H5R_OBJECT
///\exception H5::DataSetIException
///\par Description
/// \c obj can be DataSet, Group, H5File, or named DataType, that
/// \c loc can be DataSet, Group, H5File, or named DataType, that
/// is a datatype that has been named by DataType::commit.
// Programmer Binh-Minh Ribler - Oct, 2006
// Modification
// Jul, 2008
// Added for application convenience.
//--------------------------------------------------------------------------
DataSet::DataSet(H5Object& obj, const void* ref, H5R_type_t ref_type) : AbstractDs(), H5Object()
DataSet::DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : AbstractDs(), H5Object(), id(0)
{
try {
id = p_dereference(obj.getId(), ref, ref_type);
} catch (ReferenceException deref_error) {
throw ReferenceException("DataSet constructor - located by object",
deref_error.getDetailMsg());
}
id = H5Location::p_dereference(loc.getId(), ref, ref_type, plist, "constructor - by dereferenced");
}
//--------------------------------------------------------------------------
// Function: DataSet overload constructor - dereference
///\brief Given a reference, ref, to an hdf5 dataset, creates a
/// DataSet object
///\param h5file - IN: Location referenced object is in
///\param ref - IN: Reference pointer
///\param ref_type - IN: Reference type - default to H5R_OBJECT
///\exception H5::DataSetIException
// Programmer Binh-Minh Ribler - Oct, 2006
// Modification
// Jul, 2008
// Added for application convenience.
//--------------------------------------------------------------------------
DataSet::DataSet(H5File& h5file, const void* ref, H5R_type_t ref_type) : AbstractDs(), H5Object()
{
try {
id = p_dereference(h5file.getId(), ref, ref_type);
} catch (ReferenceException deref_error) {
throw ReferenceException("DataSet constructor - located by HDF5 file",
deref_error.getDetailMsg());
}
}
//--------------------------------------------------------------------------
// Function: DataSet overload constructor - dereference
///\brief Given a reference, ref, to an hdf5 dataset, creates a
///\brief Given a reference, ref, to an hdf5 attribute, creates a
/// DataSet object
///\param attr - IN: Specifying location where the referenced object is in
///\param ref - IN: Reference pointer
@@ -140,14 +112,9 @@ DataSet::DataSet(H5File& h5file, const void* ref, H5R_type_t ref_type) : Abstrac
// Jul, 2008
// Added for application convenience.
//--------------------------------------------------------------------------
DataSet::DataSet(Attribute& attr, const void* ref, H5R_type_t ref_type) : AbstractDs(), H5Object()
DataSet::DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : AbstractDs(), H5Object(), id(0)
{
try {
id = p_dereference(attr.getId(), ref, ref_type);
} catch (ReferenceException deref_error) {
throw ReferenceException("DataSet constructor - located by attribute",
deref_error.getDetailMsg());
}
id = H5Location::p_dereference(attr.getId(), ref, ref_type, plist, "constructor - by dereference");
}
//--------------------------------------------------------------------------
@@ -751,9 +718,6 @@ void DataSet::p_setId(const hid_t new_id)
}
// reset object's id to the given id
id = new_id;
// increment the reference counter of the new id
//incRefCount();
}
#endif // DOXYGEN_SHOULD_SKIP_THIS