summaryrefslogtreecommitdiffstats
path: root/c++/src/H5DataType.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2013-09-23 00:39:44 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2013-09-23 00:39:44 (GMT)
commitf8fb310610ca222ca44fabf4311e3af24d660b9d (patch)
tree82f9bd3dd2390345711158fc3d70f9f4202d9073 /c++/src/H5DataType.cpp
parentf9a758f442bcbf7f09ef5b1699dd6e187f059ee2 (diff)
downloadhdf5-f8fb310610ca222ca44fabf4311e3af24d660b9d.zip
hdf5-f8fb310610ca222ca44fabf4311e3af24d660b9d.tar.gz
hdf5-f8fb310610ca222ca44fabf4311e3af24d660b9d.tar.bz2
[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
Diffstat (limited to 'c++/src/H5DataType.cpp')
-rw-r--r--c++/src/H5DataType.cpp59
1 files changed, 16 insertions, 43 deletions
diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp
index 8a62471..be05623 100644
--- a/c++/src/H5DataType.cpp
+++ b/c++/src/H5DataType.cpp
@@ -49,6 +49,13 @@ namespace H5 {
#endif
//--------------------------------------------------------------------------
+// Function: DataType default constructor
+///\brief Default constructor: Creates a stub datatype
+// Programmer Binh-Minh Ribler - 2000
+//--------------------------------------------------------------------------
+DataType::DataType() : H5Object(), id(0) {}
+
+//--------------------------------------------------------------------------
// Function: DataType overloaded constructor
///\brief Creates a datatype using an existing datatype's id
///\param existing_id - IN: Id of the existing datatype
@@ -88,32 +95,6 @@ DataType::DataType( const H5T_class_t type_class, size_t size ) : H5Object()
// Function: DataType overload constructor - dereference
///\brief Given a reference, ref, to an hdf5 group, creates a
/// DataType object
-///\param obj - IN: Specifying location referenced object is in
-///\param ref - IN: Reference pointer
-///\param ref_type - IN: Reference type - default to H5R_OBJECT
-///\exception H5::ReferenceException
-///\par Description
-/// \c obj can be DataSet, Group, 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.
-//--------------------------------------------------------------------------
-DataType::DataType(H5Object& obj, const void* ref, H5R_type_t ref_type) : H5Object()
-{
- try {
- id = p_dereference(obj.getId(), ref, ref_type);
- } catch (ReferenceException deref_error) {
- throw ReferenceException("DataType constructor - located by an H5Object",
- deref_error.getDetailMsg());
- }
-}
-
-//--------------------------------------------------------------------------
-// Function: DataType overload constructor - dereference
-///\brief Given a reference, ref, to an hdf5 group, creates a
-/// DataType object
///\param h5file - IN: Location referenced object is in
///\param ref - IN: Reference pointer
///\param ref_type - IN: Reference type - default to H5R_OBJECT
@@ -123,14 +104,11 @@ DataType::DataType(H5Object& obj, const void* ref, H5R_type_t ref_type) : H5Obje
// Jul, 2008
// Added for application convenience.
//--------------------------------------------------------------------------
-DataType::DataType(H5File& h5file, const void* ref, H5R_type_t ref_type) : H5Object()
+DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(0)
{
- try {
- id = p_dereference(h5file.getId(), ref, ref_type);
- } catch (ReferenceException deref_error) {
- throw ReferenceException("DataType constructor - located by an H5File",
- deref_error.getDetailMsg());
- }
+ /* H5Location::dereference(loc, ref, ref_type, plist);
+ */
+ id = H5Location::p_dereference(loc.getId(), ref, ref_type, plist, "constructor - by dereference");
}
//--------------------------------------------------------------------------
@@ -146,24 +124,19 @@ DataType::DataType(H5File& h5file, const void* ref, H5R_type_t ref_type) : H5Obj
// Jul, 2008
// Added for application convenience.
//--------------------------------------------------------------------------
-DataType::DataType(Attribute& attr, const void* ref, H5R_type_t ref_type) : H5Object()
+DataType::DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(0)
{
- try {
- id = p_dereference(attr.getId(), ref, ref_type);
+ id = H5Location::p_dereference(attr.getId(), ref, ref_type, plist, "constructor - by dereference");
+ /* try {
+ id = p_dereference(attr.getId(), ref, ref_type, plist);
} catch (ReferenceException deref_error) {
throw ReferenceException("DataType constructor - located by an Attribute",
deref_error.getDetailMsg());
}
+ */
}
//--------------------------------------------------------------------------
-// Function: DataType default constructor
-///\brief Default constructor: Creates a stub datatype
-// Programmer Binh-Minh Ribler - 2000
-//--------------------------------------------------------------------------
-DataType::DataType() : H5Object(), id(0) {}
-
-//--------------------------------------------------------------------------
// Function: DataType copy constructor
///\brief Copy constructor: makes a copy of the original DataType object.
// Programmer Binh-Minh Ribler - 2000