From 8f181ff0c17c31ea40d0c043212af1702e4f5d11 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Thu, 7 Dec 2017 09:51:03 -0600 Subject: Miscellaneous cleanup Description: Moved items around to remove Doxygen warnings. Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test) --- c++/src/H5DataType.cpp | 102 ++++++++++++++++++++++++------------------------- c++/src/H5DataType.h | 3 +- 2 files changed, 53 insertions(+), 52 deletions(-) diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index ffa2a21..7b385d2 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -243,35 +243,6 @@ void DataType::copy(const DataSet& dset) } //-------------------------------------------------------------------------- -// Function: DataType::p_decode -// Purpose Returns an id of a type by decoding the binary object -/// description of this datatype. -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Sept 2017 -//-------------------------------------------------------------------------- -hid_t DataType::p_decode() const -{ - // Make sure that the buffer can be decoded - if (encoded_buf == NULL) - { - throw DataTypeIException("DataType::p_decode", "No encoded buffer"); - } - - // Call C function to decode the binary object description - hid_t encoded_dtype_id = H5Tdecode(encoded_buf); - - // If H5Tdecode fails, raise exception - if (encoded_dtype_id < 0) - { - throw DataTypeIException("DataType::p_decode", "H5Tdecode failed"); - } - else - { - return(encoded_dtype_id); - } -} - -//-------------------------------------------------------------------------- // Function: DataType::decode ///\brief Returns a DataType instance by decoding the binary object /// description of this datatype. @@ -391,28 +362,6 @@ bool DataType::operator==(const DataType& compared_type) const } //-------------------------------------------------------------------------- -// Function: DataType::p_commit (private) -//\brief Commits a transient datatype to a file, creating a new -// named datatype -//\param loc_id - IN: The id of either a file, group, dataset, named -// datatype, or attribute. -//\param name - IN: Name of the datatype -//\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 -// Modification: -// Copied from DataType::commit and made into private function -// to be commonly used by several overloads of DataType::commit. -// BMR - Jan, 2007 -//-------------------------------------------------------------------------- -void DataType::p_commit(hid_t loc_id, const char* name) -{ - // Call C routine to commit the transient datatype - herr_t ret_value = H5Tcommit2(loc_id, name, id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if(ret_value < 0) - throw DataTypeIException(inMemFunc("p_commit"), "H5Tcommit2 failed"); -} - -//-------------------------------------------------------------------------- // Function: DataType::commit ///\brief Commits a transient datatype to a file, creating a new /// named datatype @@ -857,6 +806,57 @@ hid_t DataType::getId() const #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- +// Function: DataType::p_commit (private) +//\brief Commits a transient datatype to a file, creating a new +// named datatype +//\param loc_id - IN: The id of either a file, group, dataset, named +// datatype, or attribute. +//\param name - IN: Name of the datatype +//\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - 2000 +// Modification: +// Copied from DataType::commit and made into private function +// to be commonly used by several overloads of DataType::commit. +// BMR - Jan, 2007 +//-------------------------------------------------------------------------- +void DataType::p_commit(hid_t loc_id, const char* name) +{ + // Call C routine to commit the transient datatype + herr_t ret_value = H5Tcommit2(loc_id, name, id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if(ret_value < 0) + throw DataTypeIException(inMemFunc("p_commit"), "H5Tcommit2 failed"); +} + +//-------------------------------------------------------------------------- +// Function: DataType::p_decode +// Purpose Returns an id of a type by decoding the binary object +/// description of this datatype. +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Sept 2017 +//-------------------------------------------------------------------------- +hid_t DataType::p_decode() const +{ + // Make sure that the buffer can be decoded + if (encoded_buf == NULL) + { + throw DataTypeIException("DataType::p_decode", "No encoded buffer"); + } + + // Call C function to decode the binary object description + hid_t encoded_dtype_id = H5Tdecode(encoded_buf); + + // If H5Tdecode fails, raise exception + if (encoded_dtype_id < 0) + { + throw DataTypeIException("DataType::p_decode", "H5Tdecode failed"); + } + else + { + return(encoded_dtype_id); + } +} + +//-------------------------------------------------------------------------- // Function: DataType::p_opentype (private) ///\brief Opens an HDF5 datatype given its name ///\param loc - IN: Location of the type diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 5e10c20..29cc990 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -150,7 +150,6 @@ class H5_DLLCPP DataType : public H5Object { // Opens a datatype and returns the id. hid_t p_opentype(const H5Location& loc, const char* dtype_name) const; - #endif // DOXYGEN_SHOULD_SKIP_THIS private: @@ -162,7 +161,9 @@ class H5_DLLCPP DataType : public H5Object { // Friend function to set DataType id. For library use only. friend void f_DataType_setId(DataType* dtype, hid_t new_id); +#ifndef DOXYGEN_SHOULD_SKIP_THIS void p_commit(hid_t loc_id, const char* name); +#endif // DOXYGEN_SHOULD_SKIP_THIS }; // end of DataType } // namespace H5 -- cgit v0.12