diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2006-06-05 16:17:36 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2006-06-05 16:17:36 (GMT) |
commit | 32d3e6f04f2cc68d05fd59c567c2bdf4e4a50443 (patch) | |
tree | 7dfbe078ff910c575768c51fb1c38c0f4f8c1f58 /c++/src/H5DataType.cpp | |
parent | f5a16e9bfa5ee701d6ee40ddd98cfcb03aad6e1b (diff) | |
download | hdf5-32d3e6f04f2cc68d05fd59c567c2bdf4e4a50443.zip hdf5-32d3e6f04f2cc68d05fd59c567c2bdf4e4a50443.tar.gz hdf5-32d3e6f04f2cc68d05fd59c567c2bdf4e4a50443.tar.bz2 |
[svn-r12404] Purpose: Fix typos/formats
Description:
Fixed typos and re-arranged some functions to be in sync with 1.6.
Platforms tested:
Linux 2.4 (heping)
SunOS 5.9 (shanti)
AIX 5.1 (copper)
Diffstat (limited to 'c++/src/H5DataType.cpp')
-rw-r--r-- | c++/src/H5DataType.cpp | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 815faca..af05632 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -96,18 +96,19 @@ DataType::DataType(const DataType& original) : H5Object(original) {} ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 // Modification -// Replaced resetIdComponent with decRefCount to use C library -// ID reference counting mechanism - June 1, 2004 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- void DataType::copy( const DataType& like_type ) { - // If this object is representing an hdf5 object, close it before - // copying like_type to it + // close the current data type before copying like_type to this object try { - close(); + close(); } catch (Exception close_error) { - throw FileIException("DataType::copy", close_error.getDetailMsg()); + throw DataTypeIException("DataType::copy", close_error.getDetailMsg()); } // call C routine to copy the datatype @@ -131,8 +132,8 @@ DataType& DataType::operator=( const DataType& rhs ) { if (this != &rhs) { - copy(rhs); - return(*this); + copy(rhs); + return(*this); } } @@ -468,20 +469,20 @@ void DataType::setTag( const H5std_string& tag ) const //-------------------------------------------------------------------------- H5std_string DataType::getTag() const { - char* tag_Cstr = H5Tget_tag( id ); + char* tag_Cstr = H5Tget_tag( id ); - // if the tag C-string returned is not NULL, convert it to C++ string - // and return it, otherwise, raise an exception - if( tag_Cstr != NULL ) - { - H5std_string tag = H5std_string(tag_Cstr); // convert C string to string object + // if the tag C-string returned is not NULL, convert it to C++ string + // and return it, otherwise, raise an exception + if( tag_Cstr != NULL ) + { + H5std_string tag = H5std_string(tag_Cstr); // C string to string object HDfree(tag_Cstr); // free the C string - return (tag); // return the tag - } - else - { - throw DataTypeIException(inMemFunc("getTag"), "H5Tget_tag returns NULL for tag"); - } + return (tag); // return the tag + } + else + { + throw DataTypeIException(inMemFunc("getTag"), "H5Tget_tag returns NULL for tag"); + } } //-------------------------------------------------------------------------- @@ -643,7 +644,7 @@ void DataType::close() herr_t ret_value = H5Tclose(id); if( ret_value < 0 ) { - throw DataTypeIException(inMemFunc("close"), "H5Tclose failed"); + throw DataTypeIException(inMemFunc("close"), "H5Tclose failed"); } // reset the id because the datatype that it represents is now closed id = 0; @@ -655,8 +656,10 @@ void DataType::close() ///\brief Properly terminates access to this datatype. // Programmer Binh-Minh Ribler - 2000 // Modification -// Replaced resetIdComponent with decRefCount to use C library -// ID reference counting mechanism - June 1, 2004 +// - Replaced resetIdComponent() with decRefCount() to use C +// library ID reference counting mechanism - BMR, Jun 1, 2004 +// - Replaced decRefCount with close() to let the C library +// handle the reference counting - BMR, Jun 1, 2006 //-------------------------------------------------------------------------- DataType::~DataType() { |