summaryrefslogtreecommitdiffstats
path: root/c++/src/H5ArrayType.cpp
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2017-12-01 18:41:26 (GMT)
committerLarry Knox <lrknox@hdfgroup.org>2017-12-01 18:41:26 (GMT)
commitb8c6b68c35fa2be23ef488a1d81097ff3ed55000 (patch)
treec3429ee577e454526c8704d66a84f0c45b7959a1 /c++/src/H5ArrayType.cpp
parent23a702e7bad93fc4f14eab07678c75d276e2d0ad (diff)
parent60f76980aab92f0e0730170b99a2363acd3c97fa (diff)
downloadhdf5-b8c6b68c35fa2be23ef488a1d81097ff3ed55000.zip
hdf5-b8c6b68c35fa2be23ef488a1d81097ff3ed55000.tar.gz
hdf5-b8c6b68c35fa2be23ef488a1d81097ff3ed55000.tar.bz2
Merge pull request #811 in HDFFV/hdf5 from hdf5_1_8_20 to 1.8/masterhdf5-1_8_20
* commit '60f76980aab92f0e0730170b99a2363acd3c97fa': (108 commits) Update version numbers and remove empty sections in RELEASE.txt. Restore line 1154: C2Cppfunction_map.mht to HTML_EXTRA_FILES. Update version for 1.8.20 release. Fixed documentation warnings HDFFV-10329 Correct LINK INTERFACE and VS20013 compile Switch default build mode from development to production. Increment version string to pre2. Add RELEASE.txt note for HDFFV-10274. (cherry picked from commit f7a7d0a00613cba997212fa8032091629a678797) Initialize hid_t variables in test_Attr_bug9. (cherry picked from commit 97bc393449f3fe02c5992872ab2842e12f611ef0) Fix HDFFV-10274. When deleting all (or almost all) of the messages in an object header chunk, where the total amount deleted was greater than 64K, an error would occur due to an off by one error in the code that handled that case. Fixed this and added a test case. (cherry picked from commit 1b2c2ca9a6a7d7e1fcd5c3302e203f2e2dabf0af) Fix linking of libs Changed file path to relative. iAdd NAG to supported compilers in RELEASE.txt. Add description to RELEASE.txt for HDFFV-10323 Correct issue number Set version to 1.8.20-pre1 Update supported and tested platforms in RELEASE.txt. HDFFV-10321 Merge from 1.8 Incremented lib file .so numbers: revision for all except c++ for code change; current incremented, revision and age set to 0 for c++ due to symbols added and removed. updated issues related to Fortran Incremented lib file .so numbers: revision for all except c++ for dcode change; current incremented, revision and age set to 0 for c++ due to symbols added and removed. ...
Diffstat (limited to 'c++/src/H5ArrayType.cpp')
-rw-r--r--c++/src/H5ArrayType.cpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp
index 6d2ca83..6be1a1f 100644
--- a/c++/src/H5ArrayType.cpp
+++ b/c++/src/H5ArrayType.cpp
@@ -70,6 +70,44 @@ ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims)
}
//--------------------------------------------------------------------------
+// Function: ArrayType overloaded constructor
+///\brief Creates an ArrayType instance by opening an HDF5 array datatype
+/// given its name, provided as a C character string.
+///\param loc - IN: Location of the type
+///\param type_name - IN: Array type name
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - Sept 2017
+// Description
+// In 1.8.20, this constructor was introduced and may replace the
+// existing function CommonFG::openArrayType(const char*) to
+// improve usability.
+// -BMR, Sept 2017
+//--------------------------------------------------------------------------
+ArrayType::ArrayType(const H5Location& loc, const char *type_name) : DataType()
+{
+ id = p_opentype(loc, type_name);
+}
+
+//--------------------------------------------------------------------------
+// Function: ArrayType overloaded constructor
+///\brief Creates an ArrayType instance by opening an HDF5 array datatype
+/// given its name, provided as an \c H5std_string.
+///\param loc - IN: Location of the type
+///\param type_name - IN: Array type name
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - Sept 2017
+// Description
+// In 1.8.20, this constructor was introduced and may replace the
+// existing function CommonFG::openArrayType(const H5std_string&) to
+// improve usability.
+// -BMR, Sept 2017
+//--------------------------------------------------------------------------
+ArrayType::ArrayType(const H5Location& loc, const H5std_string& type_name) : DataType()
+{
+ id = p_opentype(loc, type_name.c_str());
+}
+
+//--------------------------------------------------------------------------
// Function: ArrayType::operator=
///\brief Assignment operator
///\param rhs - IN: Reference to the existing array datatype
@@ -99,6 +137,27 @@ ArrayType& ArrayType::operator=(const ArrayType& rhs)
}
//--------------------------------------------------------------------------
+// Function: ArrayType::decode
+///\brief Returns an ArrayType object via DataType* by decoding the
+/// binary object description of this type.
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - Sept 2017
+//--------------------------------------------------------------------------
+DataType* ArrayType::decode() const
+{
+ hid_t encoded_arrtype_id = H5I_INVALID_HID;
+ try {
+ encoded_arrtype_id = p_decode();
+ }
+ catch (DataTypeIException &err) {
+ throw;
+ }
+ ArrayType *encoded_arrtype = new ArrayType;
+ encoded_arrtype->p_setId(encoded_arrtype_id);
+ return(encoded_arrtype);
+}
+
+//--------------------------------------------------------------------------
// Function: ArrayType::getArrayNDims
///\brief Returns the number of dimensions for an array datatype.
///\return Number of dimensions