summaryrefslogtreecommitdiffstats
path: root/c++/src/H5DataType.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2006-10-22 08:22:30 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2006-10-22 08:22:30 (GMT)
commitdaa61b598616713bd39d360aeb9dbbd7ec5803cb (patch)
tree6765b17006dcfab43126e37f205c940c4201fefc /c++/src/H5DataType.cpp
parent118b1d38fa0d00d0cff94d33e753b11bd732951f (diff)
downloadhdf5-daa61b598616713bd39d360aeb9dbbd7ec5803cb.zip
hdf5-daa61b598616713bd39d360aeb9dbbd7ec5803cb.tar.gz
hdf5-daa61b598616713bd39d360aeb9dbbd7ec5803cb.tar.bz2
[svn-r12795] Purpose: Fixing bug
Description: Wrappers of H5Rcreate had incorrect prototypes. Solution: Added these overloaded functions for H5Rcreate wrapper to IdComponent: void reference(void* ref, const char* name, DataSpace& dataspace, H5R_type_t ref_type = H5R_DATASET_REGION) const; void reference(void* ref, const char* name) const; void reference(void* ref, const H5std_string& name) const; Added these overloaded functions for H5Rdereference: void dereference(IdComponent& obj, void* ref); DataSet(IdComponent& obj, void* ref); Group(IdComponent& obj, void* ref); DataType(IdComponent& obj, void* ref); The incorrect wrappers will be removed after announcing. Platform tested: Linux 2.4 (heping) AIX 5.1 (copper) SunOS 5.8 64-bit (sol)
Diffstat (limited to 'c++/src/H5DataType.cpp')
-rw-r--r--c++/src/H5DataType.cpp50
1 files changed, 26 insertions, 24 deletions
diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp
index 609e2f9..52c9bf2 100644
--- a/c++/src/H5DataType.cpp
+++ b/c++/src/H5DataType.cpp
@@ -76,6 +76,21 @@ DataType::DataType( const H5T_class_t type_class, size_t size ) : H5Object()
}
//--------------------------------------------------------------------------
+// Function: DataType overload constructor - dereference
+///\brief Given a reference to some object, returns that datatype
+///\param obj - IN: Location reference object is in
+///\param ref - IN: Reference pointer
+///\parDescription
+/// \c obj 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
+//--------------------------------------------------------------------------
+DataType::DataType(IdComponent& obj, void* ref) : H5Object()
+{
+ IdComponent::dereference(obj, ref);
+}
+
+//--------------------------------------------------------------------------
// Function: DataType default constructor
///\brief Default constructor: Creates a stub datatype
// Programmer Binh-Minh Ribler - 2000
@@ -108,7 +123,7 @@ void DataType::copy( const DataType& like_type )
close();
}
catch (Exception close_error) {
- throw DataTypeIException("DataType::copy", close_error.getDetailMsg());
+ throw DataTypeIException(inMemFunc("copy"), close_error.getDetailMsg());
}
// call C routine to copy the datatype
@@ -131,10 +146,8 @@ void DataType::copy( const DataType& like_type )
DataType& DataType::operator=( const DataType& rhs )
{
if (this != &rhs)
- {
copy(rhs);
- return(*this);
- }
+ return(*this);
}
//--------------------------------------------------------------------------
@@ -532,12 +545,9 @@ bool DataType::isVariableStr() const
//--------------------------------------------------------------------------
// Function: DataType::Reference
-///\brief Creates a reference to an HDF5 object or a dataset region.
-///\param name - IN: Name of the object to be referenced
-///\param dataspace - IN: Dataspace with selection
-///\param ref_type - IN: Type of reference; default to \c H5R_DATASET_REGION
-///\return A reference
-///\exception H5::DataTypeIException
+///\brief Important!!! - This functions may not work correctly, it
+/// will be removed in the near future. Please use similar
+/// DataType::reference instead!
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
void* DataType::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_type) const
@@ -552,16 +562,9 @@ void* DataType::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref
//--------------------------------------------------------------------------
// Function: DataType::Reference
-///\brief This is an overloaded function, provided for your convenience.
-/// It differs from the above function in that it only creates
-/// 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::DataTypeIException
-///\par Description
-// This function passes H5R_OBJECT and -1 to the protected
-// function for it to pass to the C API H5Rcreate
-// to create a reference to the named object.
+///\brief Important!!! - This functions may not work correctly, it
+/// will be removed in the near future. Please use similar
+/// DataType::reference instead!
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
void* DataType::Reference(const char* name) const
@@ -576,10 +579,9 @@ void* DataType::Reference(const char* name) const
//--------------------------------------------------------------------------
// Function: DataType::Reference
-///\brief This is an overloaded function, provided for your convenience.
-/// It differs from the above function in that it takes an
-/// \c std::string for the object's name.
-///\param name - IN: Name of the object to be referenced - \c std::string
+///\brief Important!!! - This functions may not work correctly, it
+/// will be removed in the near future. Please use similar
+/// DataType::reference instead!
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
void* DataType::Reference(const H5std_string& name) const