summaryrefslogtreecommitdiffstats
path: root/c++
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2018-07-24 04:41:56 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2018-07-24 04:41:56 (GMT)
commit98308480f6fbb97d9a273334db714c4c967fd6c9 (patch)
treec4c4ad86525962217a3cd25508b2c6f3c489b89f /c++
parent243a36911fb80931225e0044cc654ccbfec3ed10 (diff)
parent3c6a39858fef9e7207cd7c3e3057267ec380be0b (diff)
downloadhdf5-98308480f6fbb97d9a273334db714c4c967fd6c9.zip
hdf5-98308480f6fbb97d9a273334db714c4c967fd6c9.tar.gz
hdf5-98308480f6fbb97d9a273334db714c4c967fd6c9.tar.bz2
Merge pull request #1146 in HDFFV/hdf5 from ~BMRIBLER/hdf5_bmr_cpp4:develop to develop
Code improvement New class for dataset access property list * commit '3c6a39858fef9e7207cd7c3e3057267ec380be0b': Fixed typos Entered entries for HDFFV-10150, HDFFV-10458, HDFFV-1047 Updated for C2Cppfunction_map.htm Added class DSetAccPropList Description: - Added class DSetAccPropList for the dataset access property list. - Added wrapper for H5Dget_access_plist to class DataSet // Gets the access property list of this dataset. DSetAccPropList getAccessPlist() const; Code improvement Description: Moved the new H5Object::getInfo member functions to H5Location and made them overloaded with the existing H5Location::getObjinfo. This way is cleaner than the previous approach. Platforms tested: Linux/64 (jelly) Linux/32 (jam) Darwin (osx1010test)
Diffstat (limited to 'c++')
-rw-r--r--c++/src/CMakeLists.txt2
-rw-r--r--c++/src/H5AbstractDs.cpp1
-rw-r--r--c++/src/H5ArrayType.cpp1
-rw-r--r--c++/src/H5AtomType.cpp1
-rw-r--r--c++/src/H5Attribute.cpp1
-rw-r--r--c++/src/H5CommonFG.cpp1
-rw-r--r--c++/src/H5CompType.cpp1
-rw-r--r--c++/src/H5Cpp.h1
-rw-r--r--c++/src/H5DaccProp.cpp162
-rw-r--r--c++/src/H5DaccProp.h68
-rw-r--r--c++/src/H5DataSet.cpp22
-rw-r--r--c++/src/H5DataSet.h3
-rw-r--r--c++/src/H5DataType.cpp1
-rw-r--r--c++/src/H5DcreatProp.cpp1
-rw-r--r--c++/src/H5EnumType.cpp1
-rw-r--r--c++/src/H5FaccProp.cpp10
-rw-r--r--c++/src/H5File.cpp1
-rw-r--r--c++/src/H5FloatType.cpp1
-rw-r--r--c++/src/H5Group.cpp1
-rw-r--r--c++/src/H5IntType.cpp1
-rw-r--r--c++/src/H5Library.cpp27
-rw-r--r--c++/src/H5Location.cpp197
-rw-r--r--c++/src/H5Location.h38
-rw-r--r--c++/src/H5Object.cpp125
-rw-r--r--c++/src/H5Object.h20
-rw-r--r--c++/src/H5PredType.cpp23
-rw-r--r--c++/src/H5StrType.cpp1
-rw-r--r--c++/src/H5VarLenType.cpp1
-rw-r--r--c++/src/Makefile.am22
-rw-r--r--c++/test/dsets.cpp127
-rw-r--r--c++/test/tattr.cpp12
-rw-r--r--c++/test/tfile.cpp8
-rw-r--r--c++/test/tobject.cpp18
-rw-r--r--c++/test/trefer.cpp10
-rw-r--r--c++/test/ttypes.cpp9
35 files changed, 666 insertions, 253 deletions
diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt
index 27b71b0..945b352 100644
--- a/c++/src/CMakeLists.txt
+++ b/c++/src/CMakeLists.txt
@@ -21,6 +21,7 @@ set (CPP_SOURCES
${HDF5_CPP_SRC_SOURCE_DIR}/H5DataSet.cpp
${HDF5_CPP_SRC_SOURCE_DIR}/H5DataSpace.cpp
${HDF5_CPP_SRC_SOURCE_DIR}/H5DataType.cpp
+ ${HDF5_CPP_SRC_SOURCE_DIR}/H5DaccProp.cpp
${HDF5_CPP_SRC_SOURCE_DIR}/H5DcreatProp.cpp
${HDF5_CPP_SRC_SOURCE_DIR}/H5DxferProp.cpp
${HDF5_CPP_SRC_SOURCE_DIR}/H5EnumType.cpp
@@ -58,6 +59,7 @@ set (CPP_HDRS
${HDF5_CPP_SRC_SOURCE_DIR}/H5DataSet.h
${HDF5_CPP_SRC_SOURCE_DIR}/H5DataSpace.h
${HDF5_CPP_SRC_SOURCE_DIR}/H5DataType.h
+ ${HDF5_CPP_SRC_SOURCE_DIR}/H5DaccProp.h
${HDF5_CPP_SRC_SOURCE_DIR}/H5DcreatProp.h
${HDF5_CPP_SRC_SOURCE_DIR}/H5DxferProp.h
${HDF5_CPP_SRC_SOURCE_DIR}/H5EnumType.h
diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp
index 823e873..d59a3cb 100644
--- a/c++/src/H5AbstractDs.cpp
+++ b/c++/src/H5AbstractDs.cpp
@@ -24,6 +24,7 @@
#include "H5DxferProp.h"
#include "H5LcreatProp.h"
#include "H5LaccProp.h"
+#include "H5DaccProp.h"
#include "H5Location.h"
#include "H5Object.h"
#include "H5DataSpace.h"
diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp
index 836c837..8ecb6da 100644
--- a/c++/src/H5ArrayType.cpp
+++ b/c++/src/H5ArrayType.cpp
@@ -21,6 +21,7 @@
#include "H5DcreatProp.h"
#include "H5LcreatProp.h"
#include "H5LaccProp.h"
+#include "H5DaccProp.h"
#include "H5Location.h"
#include "H5Object.h"
#include "H5DataType.h"
diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp
index a9f6f36..9408452 100644
--- a/c++/src/H5AtomType.cpp
+++ b/c++/src/H5AtomType.cpp
@@ -21,6 +21,7 @@
#include "H5DcreatProp.h"
#include "H5LcreatProp.h"
#include "H5LaccProp.h"
+#include "H5DaccProp.h"
#include "H5Location.h"
#include "H5Object.h"
#include "H5DataType.h"
diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp
index ccba623..33f992a 100644
--- a/c++/src/H5Attribute.cpp
+++ b/c++/src/H5Attribute.cpp
@@ -29,6 +29,7 @@
#include "H5DcreatProp.h"
#include "H5LcreatProp.h"
#include "H5LaccProp.h"
+#include "H5DaccProp.h"
#include "H5Location.h"
#include "H5Object.h"
#include "H5AbstractDs.h"
diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp
index 979816b..6c5fdca 100644
--- a/c++/src/H5CommonFG.cpp
+++ b/c++/src/H5CommonFG.cpp
@@ -24,6 +24,7 @@
#include "H5DcreatProp.h"
#include "H5LcreatProp.h"
#include "H5LaccProp.h"
+#include "H5DaccProp.h"
#include "H5Location.h"
#include "H5Object.h"
#include "H5Alltypes.h"
diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp
index 8252d76..ae22f18 100644
--- a/c++/src/H5CompType.cpp
+++ b/c++/src/H5CompType.cpp
@@ -22,6 +22,7 @@
#include "H5DxferProp.h"
#include "H5LcreatProp.h"
#include "H5LaccProp.h"
+#include "H5DaccProp.h"
#include "H5Location.h"
#include "H5Object.h"
#include "H5Alltypes.h"
diff --git a/c++/src/H5Cpp.h b/c++/src/H5Cpp.h
index b9da80a..01fae45 100644
--- a/c++/src/H5Cpp.h
+++ b/c++/src/H5Cpp.h
@@ -27,6 +27,7 @@
#include "H5DxferProp.h"
#include "H5LcreatProp.h"
#include "H5LaccProp.h"
+#include "H5DaccProp.h"
#include "H5Location.h"
#include "H5Object.h"
#include "H5AbstractDs.h"
diff --git a/c++/src/H5DaccProp.cpp b/c++/src/H5DaccProp.cpp
new file mode 100644
index 0000000..c6ff705
--- /dev/null
+++ b/c++/src/H5DaccProp.cpp
@@ -0,0 +1,162 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+#include <string>
+
+#include "H5Include.h"
+#include "H5Exception.h"
+#include "H5IdComponent.h"
+#include "H5DataSpace.h"
+#include "H5PropList.h"
+#include "H5LaccProp.h"
+#include "H5DaccProp.h"
+
+namespace H5 {
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+// This DOXYGEN_SHOULD_SKIP_THIS block is a work-around approach to control
+// the order of creation and deletion of the global constants. See Design Notes
+// in "H5PredType.cpp" for information.
+
+// Initialize a pointer for the constant
+DSetAccPropList* DSetAccPropList::DEFAULT_ = 0;
+
+//--------------------------------------------------------------------------
+// Function: DSetAccPropList::getConstant
+// Purpose: Creates a DSetAccPropList object representing the HDF5
+// constant H5P_DATASET_ACCESS, pointed to by
+// DSetAccPropList::DEFAULT_
+// exception H5::PropListIException
+// Description
+// If DSetAccPropList::DEFAULT_ already points to an allocated
+// object, throw a PropListIException. This scenario should
+// not happen.
+// Programmer Binh-Minh Ribler - 2015
+//--------------------------------------------------------------------------
+DSetAccPropList* DSetAccPropList::getConstant()
+{
+ // Tell the C library not to clean up, H5Library::termH5cpp will call
+ // H5close - more dependency if use H5Library::dontAtExit()
+ if (!IdComponent::H5dontAtexit_called)
+ {
+ (void) H5dont_atexit();
+ IdComponent::H5dontAtexit_called = true;
+ }
+
+ // If the constant pointer is not allocated, allocate it. Otherwise,
+ // throw because it shouldn't be.
+ if (DEFAULT_ == 0)
+ DEFAULT_ = new DSetAccPropList(H5P_DATASET_ACCESS);
+ else
+ throw PropListIException("DSetAccPropList::getConstant", "DSetAccPropList::getConstant is being invoked on an allocated DEFAULT_");
+ return(DEFAULT_);
+}
+
+//--------------------------------------------------------------------------
+// Function: DSetAccPropList::deleteConstants
+// Purpose: Deletes the constant object that DSetAccPropList::DEFAULT_
+// points to.
+// Programmer Binh-Minh Ribler - 2015
+//--------------------------------------------------------------------------
+void DSetAccPropList::deleteConstants()
+{
+ if (DEFAULT_ != 0)
+ delete DEFAULT_;
+}
+
+//--------------------------------------------------------------------------
+// Purpose Constant for dataset creation default property
+//--------------------------------------------------------------------------
+const DSetAccPropList& DSetAccPropList::DEFAULT = *getConstant();
+
+#endif // DOXYGEN_SHOULD_SKIP_THIS
+
+//--------------------------------------------------------------------------
+// Function: DSetAccPropList default constructor
+///\brief Default constructor: creates a stub dataset creation property list
+// Programmer Binh-Minh Ribler - 2000
+//--------------------------------------------------------------------------
+DSetAccPropList::DSetAccPropList() : LinkAccPropList(H5P_DATASET_ACCESS) {}
+
+//--------------------------------------------------------------------------
+// Function: DSetAccPropList copy constructor
+///\brief Copy constructor: same HDF5 object as \a original
+/// DSetAccPropList object
+// Programmer Binh-Minh Ribler - 2000
+//--------------------------------------------------------------------------
+DSetAccPropList::DSetAccPropList(const DSetAccPropList& orig) : LinkAccPropList(orig) {}
+
+//--------------------------------------------------------------------------
+// Function: DSetAccPropList overloaded constructor
+///\brief Creates a DSetAccPropList object using the id of an
+/// existing dataset creation property list.
+// Programmer Binh-Minh Ribler - 2000
+//--------------------------------------------------------------------------
+DSetAccPropList::DSetAccPropList(const hid_t plist_id) : LinkAccPropList(plist_id) {}
+
+//--------------------------------------------------------------------------
+// Function: DSetAccPropList::setChunkCache
+///\brief Sets the raw data chunk cache parameters.
+///\param rdcc_nslots - IN: Number of chunk slots in the raw data chunk cache
+///\param rdcc_nbytes - IN: Total size of the raw data chunk cache
+///\param rdcc_w0 - IN: The chunk preemption policy for this dataset
+///\exception H5::PropListIException
+///\par Description
+/// The raw data chunk cache parameters includes the number of
+/// objects in the meta data cache and the maximum number of
+/// chunks and bytes in the raw data chunk cache. Once set,
+/// these values will override the values in the file access
+/// property list.
+///
+/// For information, please refer to the H5Pset_chunk_cache API in
+/// the HDF5 C Reference Manual.
+// July 2018
+//--------------------------------------------------------------------------
+void DSetAccPropList::setChunkCache(size_t rdcc_nslots, size_t rdcc_nbytes, double rdcc_w0) const
+{
+ herr_t ret_value = H5Pset_chunk_cache(id, rdcc_nslots, rdcc_nbytes, rdcc_w0);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetAccPropList::setChunkCache", "H5Pset_chunk_cache failed");
+ }
+}
+
+//--------------------------------------------------------------------------
+// Function: DSetAccPropList::getChunkCache
+///\brief Retrieves the raw data chunk cache parameters.
+///\param rdcc_nslots - OUT: Number of chunk slots in the raw data chunk cache
+///\param rdcc_nbytes - OUT: Total size of the raw data chunk cache
+///\param rdcc_w0 - OUT: The chunk preemption policy for this dataset
+///\exception H5::PropListIException
+///\par Description
+/// For information, please refer to the H5Pget_chunk_cache API in
+/// the HDF5 C Reference Manual.
+// July 2018
+//--------------------------------------------------------------------------
+void DSetAccPropList::getChunkCache(size_t &rdcc_nslots, size_t &rdcc_nbytes, double &rdcc_w0) const
+{
+ herr_t ret_value = H5Pget_chunk_cache(id, &rdcc_nslots, &rdcc_nbytes, &rdcc_w0);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetAccPropList::getChunkCache", "H5Pget_chunk_cache failed");
+ }
+}
+
+//--------------------------------------------------------------------------
+// Function: DSetAccPropList destructor
+///\brief Noop destructor.
+// Programmer Binh-Minh Ribler - 2000
+//--------------------------------------------------------------------------
+DSetAccPropList::~DSetAccPropList() {}
+
+} // end namespace
diff --git a/c++/src/H5DaccProp.h b/c++/src/H5DaccProp.h
new file mode 100644
index 0000000..111b4f5
--- /dev/null
+++ b/c++/src/H5DaccProp.h
@@ -0,0 +1,68 @@
+// C++ informative line for the emacs editor: -*- C++ -*-
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+#ifndef __H5DSetAccPropList_H
+#define __H5DSetAccPropList_H
+
+namespace H5 {
+
+/*! \class DSetAccPropList
+ \brief Class DSetAccPropList inherits from LinkAccPropList and provides
+ wrappers for the HDF5 dataset access property functions.
+*/
+// Inheritance: LinkAccPropList -> PropList -> IdComponent
+class H5_DLLCPP DSetAccPropList : public LinkAccPropList {
+ public:
+ ///\brief Default dataset creation property list.
+ static const DSetAccPropList& DEFAULT;
+
+ // Creates a dataset creation property list.
+ DSetAccPropList();
+
+ // Sets the raw data chunk cache parameters.
+ void setChunkCache(size_t rdcc_nslots, size_t rdcc_nbytes, double rdcc_w0) const;
+
+ // Retrieves the raw data chunk cache parameters.
+ void getChunkCache(size_t &rdcc_nslots, size_t &rdcc_nbytes, double &rdcc_w0) const;
+
+ ///\brief Returns this class name.
+ virtual H5std_string fromClass () const { return("DSetAccPropList"); }
+
+ // Copy constructor - same as the original DSetAccPropList.
+ DSetAccPropList(const DSetAccPropList& orig);
+
+ // Creates a copy of an existing dataset creation property list
+ // using the property list id.
+ DSetAccPropList(const hid_t plist_id);
+
+ // Noop destructor.
+ virtual ~DSetAccPropList();
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+
+ // Deletes the global constant, should only be used by the library
+ static void deleteConstants();
+
+ private:
+ static DSetAccPropList* DEFAULT_;
+
+ // Creates the global constant, should only be used by the library
+ static DSetAccPropList* getConstant();
+
+#endif // DOXYGEN_SHOULD_SKIP_THIS
+
+}; // end of DSetAccPropList
+} // namespace H5
+
+#endif // __H5DSetAccPropList_H
diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp
index fbddd8d..db14577 100644
--- a/c++/src/H5DataSet.cpp
+++ b/c++/src/H5DataSet.cpp
@@ -30,6 +30,7 @@
#include "H5DcreatProp.h"
#include "H5LcreatProp.h"
#include "H5LaccProp.h"
+#include "H5DaccProp.h"
#include "H5Location.h"
#include "H5Object.h"
#include "H5DataType.h"
@@ -172,6 +173,27 @@ DSetCreatPropList DataSet::getCreatePlist() const
}
//--------------------------------------------------------------------------
+// Function: DataSet::getAccessPlist
+///\brief Gets the dataset access property list.
+///\return DSetAccPropList instance
+///\exception H5::DataSetIException
+// July 2018
+//--------------------------------------------------------------------------
+DSetAccPropList DataSet::getAccessPlist() const
+{
+ hid_t access_plist_id = H5Dget_access_plist(id);
+ if (access_plist_id < 0)
+ {
+ throw DataSetIException("DataSet::getAccessPlist", "H5Dget_access_plist failed");
+ }
+
+ // create and return the DSetCreatPropList object
+ DSetAccPropList access_plist;
+ f_PropList_setId(&access_plist, access_plist_id);
+ return(access_plist);
+}
+
+//--------------------------------------------------------------------------
// Function: DataSet::getStorageSize
///\brief Returns the amount of storage required for a dataset.
///\return Size of the storage or 0, for no data
diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h
index 104ccea..a0a962e 100644
--- a/c++/src/H5DataSet.h
+++ b/c++/src/H5DataSet.h
@@ -45,6 +45,9 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs {
// Gets the creation property list of this dataset.
DSetCreatPropList getCreatePlist() const;
+ // Gets the access property list of this dataset.
+ DSetAccPropList getAccessPlist() const;
+
// Returns the address of this dataset in the file.
haddr_t getOffset() const;
diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp
index 28933dd..bb27d47 100644
--- a/c++/src/H5DataType.cpp
+++ b/c++/src/H5DataType.cpp
@@ -30,6 +30,7 @@
#include "H5DxferProp.h"
#include "H5LcreatProp.h"
#include "H5LaccProp.h"
+#include "H5DaccProp.h"
#include "H5Location.h"
#include "H5Object.h"
#include "H5DataType.h"
diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp
index c704f85..bb899d7 100644
--- a/c++/src/H5DcreatProp.cpp
+++ b/c++/src/H5DcreatProp.cpp
@@ -22,6 +22,7 @@
#include "H5DcreatProp.h"
#include "H5LcreatProp.h"
#include "H5LaccProp.h"
+#include "H5DaccProp.h"
#include "H5Location.h"
#include "H5Object.h"
#include "H5DataType.h"
diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp
index 00b726c..9a4ccf1 100644
--- a/c++/src/H5EnumType.cpp
+++ b/c++/src/H5EnumType.cpp
@@ -24,6 +24,7 @@
#include "H5DataSpace.h"
#include "H5LcreatProp.h"
#include "H5LaccProp.h"
+#include "H5DaccProp.h"
#include "H5Location.h"
#include "H5Object.h"
#include "H5AbstractDs.h"
diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp
index 286f6e7..1657351 100644
--- a/c++/src/H5FaccProp.cpp
+++ b/c++/src/H5FaccProp.cpp
@@ -11,8 +11,18 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#ifdef OLD_HEADER_FILENAME
+#include <iostream.h>
+#else
+#include <iostream>
+#endif
#include <string>
+using std::cerr;
+using std::endl;
+
+//#include <string>
+
#include "H5Include.h"
#include "H5Exception.h"
#include "H5IdComponent.h"
diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp
index f5246f9..07d7e84 100644
--- a/c++/src/H5File.cpp
+++ b/c++/src/H5File.cpp
@@ -29,6 +29,7 @@
#include "H5DcreatProp.h"
#include "H5LcreatProp.h"
#include "H5LaccProp.h"
+#include "H5DaccProp.h"
#include "H5Location.h"
#include "H5Object.h"
#include "H5CommonFG.h"
diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp
index 0a2c107..5fb1cb7 100644
--- a/c++/src/H5FloatType.cpp
+++ b/c++/src/H5FloatType.cpp
@@ -22,6 +22,7 @@
#include "H5DxferProp.h"
#include "H5LcreatProp.h"
#include "H5LaccProp.h"
+#include "H5DaccProp.h"
#include "H5Location.h"
#include "H5Object.h"
#include "H5DataType.h"
diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp
index 25e67d3..0c2c4e8 100644
--- a/c++/src/H5Group.cpp
+++ b/c++/src/H5Group.cpp
@@ -29,6 +29,7 @@
#include "H5DxferProp.h"
#include "H5LcreatProp.h"
#include "H5LaccProp.h"
+#include "H5DaccProp.h"
#include "H5Location.h"
#include "H5Object.h"
#include "H5AbstractDs.h"
diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp
index dd9d042..8e19d1e 100644
--- a/c++/src/H5IntType.cpp
+++ b/c++/src/H5IntType.cpp
@@ -22,6 +22,7 @@
#include "H5DxferProp.h"
#include "H5LcreatProp.h"
#include "H5LaccProp.h"
+#include "H5DaccProp.h"
#include "H5Location.h"
#include "H5Object.h"
#include "H5DataType.h"
diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp
index 2cbdfba..fde5599 100644
--- a/c++/src/H5Library.cpp
+++ b/c++/src/H5Library.cpp
@@ -26,6 +26,7 @@
#include "H5DcreatProp.h"
#include "H5LcreatProp.h"
#include "H5LaccProp.h"
+#include "H5DaccProp.h"
#include "H5Location.h"
#include "H5Object.h"
#include "H5DataType.h"
@@ -174,47 +175,51 @@ void H5Library::initH5cpp()
int ret_value = 0;
ret_value = std::atexit(termH5cpp);
if (ret_value != 0)
- throw LibraryIException("H5Library::initH5cpp", "Registrating termH5cpp failed");
+ throw LibraryIException("H5Library::initH5cpp", "Registering termH5cpp failed");
ret_value = std::atexit(PredType::deleteConstants);
if (ret_value != 0)
- throw LibraryIException("H5Library::initH5cpp", "Registrating PredType::deleteConstants failed");
+ throw LibraryIException("H5Library::initH5cpp", "Registering PredType::deleteConstants failed");
ret_value = std::atexit(PropList::deleteConstants);
if (ret_value != 0)
- throw LibraryIException("H5Library::initH5cpp", "Registrating PropList::deleteConstants failed");
+ throw LibraryIException("H5Library::initH5cpp", "Registering PropList::deleteConstants failed");
+
+ ret_value = std::atexit(DSetAccPropList::deleteConstants);
+ if (ret_value != 0)
+ throw LibraryIException("H5Library::initH5cpp", "Registering DSetAccPropList::deleteConstants failed");
ret_value = std::atexit(LinkAccPropList::deleteConstants);
if (ret_value != 0)
- throw LibraryIException("H5Library::initH5cpp", "Registrating LinkAccPropList::deleteConstants failed");
+ throw LibraryIException("H5Library::initH5cpp", "Registering LinkAccPropList::deleteConstants failed");
ret_value = std::atexit(LinkCreatPropList::deleteConstants);
if (ret_value != 0)
- throw LibraryIException("H5Library::initH5cpp", "Registrating LinkCreatPropList::deleteConstants failed");
+ throw LibraryIException("H5Library::initH5cpp", "Registering LinkCreatPropList::deleteConstants failed");
ret_value = std::atexit(FileAccPropList::deleteConstants);
if (ret_value != 0)
- throw LibraryIException("H5Library::initH5cpp", "Registrating FileAccPropList::deleteConstants failed");
+ throw LibraryIException("H5Library::initH5cpp", "Registering FileAccPropList::deleteConstants failed");
ret_value = std::atexit(FileCreatPropList::deleteConstants);
if (ret_value != 0)
- throw LibraryIException("H5Library::initH5cpp", "Registrating FileCreatPropList::deleteConstants failed");
+ throw LibraryIException("H5Library::initH5cpp", "Registering FileCreatPropList::deleteConstants failed");
ret_value = std::atexit(DSetMemXferPropList::deleteConstants);
if (ret_value != 0)
- throw LibraryIException("H5Library::initH5cpp", "Registrating DSetMemXferPropList::deleteConstants failed");
+ throw LibraryIException("H5Library::initH5cpp", "Registering DSetMemXferPropList::deleteConstants failed");
ret_value = std::atexit(DSetCreatPropList::deleteConstants);
if (ret_value != 0)
- throw LibraryIException("H5Library::initH5cpp", "Registrating DSetCreatPropList::deleteConstants failed");
+ throw LibraryIException("H5Library::initH5cpp", "Registering DSetCreatPropList::deleteConstants failed");
ret_value = std::atexit(ObjCreatPropList::deleteConstants);
if (ret_value != 0)
- throw LibraryIException("H5Library::initH5cpp", "Registrating ObjCreatPropList::deleteConstants failed");
+ throw LibraryIException("H5Library::initH5cpp", "Registering ObjCreatPropList::deleteConstants failed");
ret_value = std::atexit(DataSpace::deleteConstants);
if (ret_value != 0)
- throw LibraryIException("H5Library::initH5cpp", "Registrating DataSpace::deleteConstants failed");
+ throw LibraryIException("H5Library::initH5cpp", "Registering DataSpace::deleteConstants failed");
}
//--------------------------------------------------------------------------
diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp
index 8df7467..2c49016 100644
--- a/c++/src/H5Location.cpp
+++ b/c++/src/H5Location.cpp
@@ -28,6 +28,7 @@ using namespace std;
#include "H5DxferProp.h"
#include "H5LcreatProp.h"
#include "H5LaccProp.h"
+#include "H5DaccProp.h"
#include "H5Location.h"
#include "H5Object.h"
#include "H5DataType.h"
@@ -903,23 +904,32 @@ Group H5Location::openGroup(const H5std_string& name) const
//--------------------------------------------------------------------------
// Function: H5Location::createDataSet
///\brief Creates a new dataset at this location.
-///\param name - IN: Name of the dataset to create
-///\param data_type - IN: Datatype of the dataset
+///\param name - IN: Name of the dataset to create
+///\param data_type - IN: Datatype of the dataset
///\param data_space - IN: Dataspace for the dataset
-///\param create_plist - IN: Creation properly list for the dataset
+///\param dcpl - IN: Dataset creation properly list
+///\param lcpl - IN: Link creation properly list
+///\param dapl - IN: Dataset access properly list
///\return DataSet instance
///\exception H5::FileIException/H5::GroupIException/H5::LocationException
-// Programmer Binh-Minh Ribler - 2000
+// 2000
+// Modification:
+// Jul 2018
+// Added LinkCreatPropList and DSetAccPropList but did not
+// follow the order in the C function: lcpl, dcpl, dapl, to
+// accommodate the existing createDataSet calls.
//--------------------------------------------------------------------------
-DataSet H5Location::createDataSet(const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist) const
+DataSet H5Location::createDataSet(const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& dcpl, const DSetAccPropList& dapl, const LinkCreatPropList& lcpl) const
{
// Obtain identifiers for C API
hid_t type_id = data_type.getId();
hid_t space_id = data_space.getId();
- hid_t create_plist_id = create_plist.getId();
+ hid_t dcpl_id = dcpl.getId();
+ hid_t lcpl_id = lcpl.getId();
+ hid_t dapl_id = dapl.getId();
// Call C routine H5Dcreate2 to create the named dataset
- hid_t dataset_id = H5Dcreate2(getId(), name, type_id, space_id, H5P_DEFAULT, create_plist_id, H5P_DEFAULT);
+ hid_t dataset_id = H5Dcreate2(getId(), name, type_id, space_id, lcpl_id, dcpl_id, dapl_id);
// If the creation of the dataset failed, throw an exception
if (dataset_id < 0)
@@ -936,11 +946,16 @@ DataSet H5Location::createDataSet(const char* name, const DataType& data_type, c
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - 2000
+// 2000
+// Modification:
+// Jul 2018
+// Added LinkCreatPropList and DSetAccPropList but did not
+// follow the order in the C function: lcpl, dcpl, dapl, to
+// accommodate the existing createDataSet calls.
//--------------------------------------------------------------------------
-DataSet H5Location::createDataSet(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist) const
+DataSet H5Location::createDataSet(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& dcpl, const DSetAccPropList& dapl, const LinkCreatPropList& lcpl) const
{
- return(createDataSet(name.c_str(), data_type, data_space, create_plist));
+ return(createDataSet(name.c_str(), data_type, data_space, dcpl, dapl, lcpl));
}
//--------------------------------------------------------------------------
@@ -949,13 +964,17 @@ DataSet H5Location::createDataSet(const H5std_string& name, const DataType& data
///\param name - IN: Name of the dataset to open
///\return DataSet instance
///\exception H5::FileIException/H5::GroupIException/H5::LocationException
-// Programmer Binh-Minh Ribler - 2000
+// 2000
+// Modification:
+// Jul 2018
+// Added DSetAccPropList argument
//--------------------------------------------------------------------------
-DataSet H5Location::openDataSet(const char* name) const
+DataSet H5Location::openDataSet(const char* name, const DSetAccPropList& dapl) const
{
// Call C function H5Dopen2 to open the specified dataset, giving
// the location id and the dataset's name
- hid_t dataset_id = H5Dopen2(getId(), name, H5P_DEFAULT);
+ hid_t dapl_id = dapl.getId();
+ hid_t dataset_id = H5Dopen2(getId(), name, dapl_id);
// If the dataset's opening failed, throw an exception
if(dataset_id < 0)
@@ -972,11 +991,14 @@ DataSet H5Location::openDataSet(const char* name) const
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - 2000
+// 2000
+// Modification:
+// Jul 2018
+// Added DSetAccPropList argument
//--------------------------------------------------------------------------
-DataSet H5Location::openDataSet(const H5std_string& name) const
+DataSet H5Location::openDataSet(const H5std_string& name, const DSetAccPropList& dapl) const
{
- return(openDataSet( name.c_str()));
+ return(openDataSet(name.c_str(), dapl));
}
//--------------------------------------------------------------------------
@@ -1356,58 +1378,154 @@ void H5Location::move(const H5std_string& src, const H5std_string& dst) const
moveLink(src.c_str(), dst.c_str(), LinkCreatPropList::DEFAULT, LinkAccPropList::DEFAULT);
}
-#if 0
//--------------------------------------------------------------------------
-// Function: H5Location::deleteLink
+// Function: H5Location::unlink
///\brief Removes the specified link from this group.
///\param name - IN: Name of the object to be removed
///\exception H5::FileIException/H5::GroupIException/H5::LocationException
// March, 2018
//--------------------------------------------------------------------------
-void H5Location::deleteLink(const char* name, const LinkAccPropList& lapl) const
+void H5Location::unlink(const char* name, const LinkAccPropList& lapl) const
{
- herr_t ret_value = H5Ldelete(getId(), name, H5P_DEFAULT);
+ herr_t ret_value = H5Ldelete(getId(), name, lapl.getId());
if (ret_value < 0)
- throwException("deleteLink", "H5Ldelete failed");
+ throwException("unlink", "H5Ldelete failed");
}
//--------------------------------------------------------------------------
-// Function: H5Location::deleteLink
+// Function: H5Location::unlink
///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function in that it takes an
/// \c H5std_string for \a name.
// March, 2018
//--------------------------------------------------------------------------
-void H5Location::deleteLink(const H5std_string& name, const LinkAccPropList& lapl) const
+void H5Location::unlink(const H5std_string& name, const LinkAccPropList& lapl) const
{
- deleteLink(name.c_str());
+ unlink(name.c_str(), lapl);
}
-#endif
//--------------------------------------------------------------------------
-// Function: H5Location::unlink
-///\brief Removes the specified link from this group.
-///\param name - IN: Name of the object to be removed
-///\exception H5::FileIException/H5::GroupIException/H5::LocationException
-// March, 2018
+// Function: H5Location::getObjinfo
+///\brief Retrieves information about an HDF5 object.
+///\param objinfo - OUT: Struct containing the object info
+///\param fields - IN: Indicates the group of information to be retrieved
+///\par Description
+/// Valid values of \a fields are as follows:
+/// \li \c H5O_INFO_BASIC (default)
+/// \li \c H5O_INFO_TIME
+/// \li \c H5O_INFO_NUM_ATTRS
+/// \li \c H5O_INFO_HDR
+/// \li \c H5O_INFO_META_SIZE
+/// \li \c H5O_INFO_ALL
+// July, 2018
//--------------------------------------------------------------------------
-void H5Location::unlink(const char* name, const LinkAccPropList& lapl) const
+void H5Location::getObjinfo(H5O_info_t& objinfo, unsigned fields) const
{
- herr_t ret_value = H5Ldelete(getId(), name, lapl.getId());
+
+ // Use C API to get information of the object
+ herr_t ret_value = H5Oget_info2(getId(), &objinfo, fields);
+
+ // Throw exception if C API returns failure
if (ret_value < 0)
- throwException("unlink", "H5Ldelete failed");
+ throwException(inMemFunc("getObjinfo"), "H5Oget_info2 failed");
}
//--------------------------------------------------------------------------
-// Function: H5Location::unlink
+// Function: H5Location::getObjinfo
+///\brief Retrieves information about an HDF5 object given its name.
+///\param name - IN: Name of the object to be queried - \c char *
+///\param objinfo - OUT: Struct containing the object info
+///\param fields - IN: Indicates the group of information to be retrieved
+/// - default to H5O_INFO_BASIC
+///\param lapl - IN: Link access property list
+///\par Description
+/// Valid values of \a fields are as follows:
+/// \li \c H5O_INFO_BASIC (default)
+/// \li \c H5O_INFO_TIME
+/// \li \c H5O_INFO_NUM_ATTRS
+/// \li \c H5O_INFO_HDR
+/// \li \c H5O_INFO_META_SIZE
+/// \li \c H5O_INFO_ALL
+// July, 2018
+//--------------------------------------------------------------------------
+void H5Location::getObjinfo(const char* name, H5O_info_t& objinfo, unsigned fields, const LinkAccPropList& lapl) const
+{
+ // Use C API to get information of the object
+ herr_t ret_value = H5Oget_info_by_name2(getId(), name, &objinfo, fields, lapl.getId());
+
+ // Throw exception if C API returns failure
+ if (ret_value < 0)
+ throwException(inMemFunc("getObjinfo"), "H5Oget_info_by_name2 failed");
+}
+
+//--------------------------------------------------------------------------
+// Function: H5Location::getObjinfo
///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a name.
-// March, 2018
+/// It differs from the above function in that it takes
+/// a reference to an \c H5std_string for \a name.
+///\param name - IN: Name of the object to be queried - \c H5std_string
+///\param objinfo - OUT: Struct containing the object info
+///\param fields - IN: Indicates the group of information to be retrieved
+/// - default to H5O_INFO_BASIC
+///\param lapl - IN: Link access property list
+// July, 2018
//--------------------------------------------------------------------------
-void H5Location::unlink(const H5std_string& name, const LinkAccPropList& lapl) const
+void H5Location::getObjinfo(const H5std_string& name, H5O_info_t& objinfo, unsigned fields, const LinkAccPropList& lapl) const
{
- unlink(name.c_str(), lapl);
+ getObjinfo(name.c_str(), objinfo, fields, lapl);
+}
+
+//--------------------------------------------------------------------------
+// Function: H5Location::getObjinfo
+///\brief Retrieves information about an HDF5 object given its index.
+///\param grp_name - IN: Group name where the object belongs - \c char *
+///\param idx_type - IN: Type of index
+///\param order - IN: Order to traverse
+///\param idx - IN: Object position
+///\param objinfo - OUT: Struct containing the object info
+///\param fields - IN: Indicates the group of information to be retrieved
+/// - default to H5O_INFO_BASIC
+///\param lapl - IN: Link access property list
+///\par Description
+/// Valid values of \a fields are as follows:
+/// \li \c H5O_INFO_BASIC (default)
+/// \li \c H5O_INFO_TIME
+/// \li \c H5O_INFO_NUM_ATTRS
+/// \li \c H5O_INFO_HDR
+/// \li \c H5O_INFO_META_SIZE
+/// \li \c H5O_INFO_ALL
+// July, 2018
+//--------------------------------------------------------------------------
+void H5Location::getObjinfo(const char* grp_name, H5_index_t idx_type,
+ H5_iter_order_t order, hsize_t idx, H5O_info_t& objinfo, unsigned fields,
+ const LinkAccPropList& lapl) const
+{
+ // Use C API to get information of the object
+ herr_t ret_value = H5Oget_info_by_idx2(getId(), grp_name, idx_type, order,
+ idx, &objinfo, fields, lapl.getId());
+
+ // Throw exception if C API returns failure
+ if (ret_value < 0)
+ throwException(inMemFunc("getObjinfo"), "H5Oget_info_by_idx2 failed");
+}
+
+//--------------------------------------------------------------------------
+// Function: H5Location::getObjinfo
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes
+/// a reference to an \c H5std_string for \a name.
+///\param name - IN: Name of the object to be queried - \c H5std_string
+///\param objinfo - OUT: Struct containing the object info
+///\param fields - IN: Indicates a group of information to be retrieved
+/// - default to H5O_INFO_BASIC
+///\param lapl - IN: Link access property list
+// July, 2018
+//--------------------------------------------------------------------------
+void H5Location::getObjinfo(const H5std_string& grp_name, H5_index_t idx_type,
+ H5_iter_order_t order, hsize_t idx, H5O_info_t& objinfo, unsigned fields,
+ const LinkAccPropList& lapl) const
+{
+ getObjinfo(grp_name.c_str(), idx_type, order, idx, objinfo, fields, lapl);
}
#ifndef H5_NO_DEPRECATED_SYMBOLS
@@ -1467,6 +1585,7 @@ void H5Location::getObjinfo(const H5std_string& name, H5G_stat_t& statbuf) const
{
getObjinfo(name.c_str(), statbuf);
}
+
#endif /* H5_NO_DEPRECATED_SYMBOLS */
//--------------------------------------------------------------------------
diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h
index 19c49ea..dc3db75 100644
--- a/c++/src/H5Location.h
+++ b/c++/src/H5Location.h
@@ -105,13 +105,18 @@ class H5_DLLCPP H5Location : public IdComponent {
Group openGroup(const char* name) const;
Group openGroup(const H5std_string& name) const;
- // Creates a new dataset in this group.
- DataSet createDataSet(const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const;
- DataSet createDataSet(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const;
+ // Creates a new dataset in this location.
+ DataSet createDataSet(const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT, const DSetAccPropList& dapl = DSetAccPropList::DEFAULT, const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT) const;
+ DataSet createDataSet(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT, const DSetAccPropList& dapl = DSetAccPropList::DEFAULT, const LinkCreatPropList& lcpl = LinkCreatPropList::DEFAULT) const;
+
+ // Deprecated to add LinkCreatPropList and DSetAccPropList - 1.10.3
+ // DataSet createDataSet(const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const;
+ // DataSet createDataSet(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const;
// Opens an existing dataset at this location.
- DataSet openDataSet(const char* name) const;
- DataSet openDataSet(const H5std_string& name) const;
+ // DSetAccPropList is added - 1.10.3
+ DataSet openDataSet(const char* name, const DSetAccPropList& dapl = DSetAccPropList::DEFAULT) const;
+ DataSet openDataSet(const H5std_string& name, const DSetAccPropList& dapl = DSetAccPropList::DEFAULT) const;
H5L_info_t getLinkInfo(const char* link_name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
H5L_info_t getLinkInfo(const H5std_string& link_name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
@@ -141,6 +146,27 @@ class H5_DLLCPP H5Location : public IdComponent {
unsigned childObjVersion(const char* objname) const;
unsigned childObjVersion(const H5std_string& objname) const;
+ // Retrieves information about an HDF5 object.
+ void getObjinfo(H5O_info_t& objinfo, unsigned fields = H5O_INFO_BASIC) const;
+
+ // Retrieves information about an HDF5 object, given its name.
+ void getObjinfo(const char* name, H5O_info_t& objinfo,
+ unsigned fields = H5O_INFO_BASIC,
+ const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
+ void getObjinfo(const H5std_string& name, H5O_info_t& objinfo,
+ unsigned fields = H5O_INFO_BASIC,
+ const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
+
+ // Retrieves information about an HDF5 object, given its index.
+ void getObjinfo(const char* grp_name, H5_index_t idx_type,
+ H5_iter_order_t order, hsize_t idx, H5O_info_t& objinfo,
+ unsigned fields = H5O_INFO_BASIC,
+ const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
+ void getObjinfo(const H5std_string& grp_name, H5_index_t idx_type,
+ H5_iter_order_t order, hsize_t idx, H5O_info_t& objinfo,
+ unsigned fields = H5O_INFO_BASIC,
+ const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
+
#ifndef H5_NO_DEPRECATED_SYMBOLS
// Returns the type of an object in this group, given the
// object's index.
@@ -149,7 +175,7 @@ class H5_DLLCPP H5Location : public IdComponent {
H5G_obj_t getObjTypeByIdx(hsize_t idx, H5std_string& type_name) const;
// Returns information about an HDF5 object, given by its name,
- // at this location.
+ // at this location. - Deprecated
void getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const;
void getObjinfo(const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf) const;
void getObjinfo(const char* name, H5G_stat_t& statbuf) const;
diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp
index a33acb3..1c22efe 100644
--- a/c++/src/H5Object.cpp
+++ b/c++/src/H5Object.cpp
@@ -25,6 +25,7 @@
#include "H5DxferProp.h"
#include "H5LcreatProp.h"
#include "H5LaccProp.h"
+#include "H5DaccProp.h"
#include "H5Location.h"
#include "H5Object.h"
#include "H5DataType.h"
@@ -227,130 +228,6 @@ int H5Object::iterateAttrs(attr_operator_t user_op, unsigned *_idx, void *op_dat
}
//--------------------------------------------------------------------------
-// Function: H5Object::getInfo
-///\brief Retrieves information about an HDF5 object.
-///\param objinfo - OUT: Struct containing the object info
-///\param fields - IN: Indicates the group of information to be retrieved
-///\par Description
-/// Valid values of \a fields are as follows:
-/// \li \c H5O_INFO_BASIC (default)
-/// \li \c H5O_INFO_TIME
-/// \li \c H5O_INFO_NUM_ATTRS
-/// \li \c H5O_INFO_HDR
-/// \li \c H5O_INFO_META_SIZE
-/// \li \c H5O_INFO_ALL
-// July, 2018
-//--------------------------------------------------------------------------
-void H5Object::getInfo(H5O_info_t& objinfo, unsigned fields) const
-{
-
- // Use C API to get information of the object
- herr_t ret_value = H5Oget_info2(getId(), &objinfo, fields);
-
- // Throw exception if C API returns failure
- if (ret_value < 0)
- throwException(inMemFunc("getInfo"), "H5Oget_info2 failed");
-}
-
-//--------------------------------------------------------------------------
-// Function: H5Object::getInfo
-///\brief Retrieves information about an HDF5 object given its name.
-///\param name - IN: Name of the object to be queried - \c char *
-///\param objinfo - OUT: Struct containing the object info
-///\param fields - IN: Indicates the group of information to be retrieved
-/// - default to H5O_INFO_BASIC
-///\param lapl - IN: Link access property list
-///\par Description
-/// Valid values of \a fields are as follows:
-/// \li \c H5O_INFO_BASIC (default)
-/// \li \c H5O_INFO_TIME
-/// \li \c H5O_INFO_NUM_ATTRS
-/// \li \c H5O_INFO_HDR
-/// \li \c H5O_INFO_META_SIZE
-/// \li \c H5O_INFO_ALL
-// July, 2018
-//--------------------------------------------------------------------------
-void H5Object::getInfo(const char* name, H5O_info_t& objinfo, unsigned fields, const LinkAccPropList& lapl) const
-{
- // Use C API to get information of the object
- herr_t ret_value = H5Oget_info_by_name2(getId(), name, &objinfo, fields, lapl.getId());
-
- // Throw exception if C API returns failure
- if (ret_value < 0)
- throwException(inMemFunc("getInfo"), "H5Oget_info_by_name2 failed");
-}
-
-//--------------------------------------------------------------------------
-// Function: H5Object::getInfo
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes
-/// a reference to an \c H5std_string for \a name.
-///\param name - IN: Name of the object to be queried - \c H5std_string
-///\param objinfo - OUT: Struct containing the object info
-///\param fields - IN: Indicates the group of information to be retrieved
-/// - default to H5O_INFO_BASIC
-///\param lapl - IN: Link access property list
-// July, 2018
-//--------------------------------------------------------------------------
-void H5Object::getInfo(const H5std_string& name, H5O_info_t& objinfo, unsigned fields, const LinkAccPropList& lapl) const
-{
- getInfo(name.c_str(), objinfo, fields, lapl);
-}
-
-//--------------------------------------------------------------------------
-// Function: H5Object::getInfo
-///\brief Retrieves information about an HDF5 object given its index.
-///\param grp_name - IN: Group name where the object belongs - \c char *
-///\param idx_type - IN: Type of index
-///\param order - IN: Order to traverse
-///\param idx - IN: Object position
-///\param objinfo - OUT: Struct containing the object info
-///\param fields - IN: Indicates the group of information to be retrieved
-/// - default to H5O_INFO_BASIC
-///\param lapl - IN: Link access property list
-///\par Description
-/// Valid values of \a fields are as follows:
-/// \li \c H5O_INFO_BASIC (default)
-/// \li \c H5O_INFO_TIME
-/// \li \c H5O_INFO_NUM_ATTRS
-/// \li \c H5O_INFO_HDR
-/// \li \c H5O_INFO_META_SIZE
-/// \li \c H5O_INFO_ALL
-// July, 2018
-//--------------------------------------------------------------------------
-void H5Object::getInfo(const char* grp_name, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t idx, H5O_info_t& objinfo, unsigned fields,
- const LinkAccPropList& lapl) const
-{
- // Use C API to get information of the object
- herr_t ret_value = H5Oget_info_by_idx2(getId(), grp_name, idx_type, order,
- idx, &objinfo, fields, lapl.getId());
-
- // Throw exception if C API returns failure
- if (ret_value < 0)
- throwException(inMemFunc("getInfo"), "H5Oget_info_by_idx2 failed");
-}
-
-//--------------------------------------------------------------------------
-// Function: H5Object::getInfo
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes
-/// a reference to an \c H5std_string for \a name.
-///\param name - IN: Name of the object to be queried - \c H5std_string
-///\param objinfo - OUT: Struct containing the object info
-///\param fields - IN: Indicates a group of information to be retrieved
-/// - default to H5O_INFO_BASIC
-///\param lapl - IN: Link access property list
-// July, 2018
-//--------------------------------------------------------------------------
-void H5Object::getInfo(const H5std_string& grp_name, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t idx, H5O_info_t& objinfo, unsigned fields,
- const LinkAccPropList& lapl) const
-{
- getInfo(grp_name.c_str(), idx_type, order, idx, objinfo, fields, lapl);
-}
-
-//--------------------------------------------------------------------------
// Function: H5Object::objVersion
///\brief Returns the header version of this HDF5 object.
///\return Object version, which can have the following values:
diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h
index 268fe58..10b3865 100644
--- a/c++/src/H5Object.h
+++ b/c++/src/H5Object.h
@@ -92,26 +92,6 @@ class H5_DLLCPP H5Object : public H5Location {
// Returns an identifier.
virtual hid_t getId() const = 0;
- // Returns information about an HDF5 object.
- void getInfo(H5O_info_t& objinfo, unsigned fields = H5O_INFO_BASIC) const;
- // Returns information about an HDF5 object, given its name.
- void getInfo(const char* name, H5O_info_t& objinfo,
- unsigned fields = H5O_INFO_BASIC,
- const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
- void getInfo(const H5std_string& name, H5O_info_t& objinfo,
- unsigned fields = H5O_INFO_BASIC,
- const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
-
- // Retrieves information about an HDF5 object, given its index.
- void getInfo(const char* grp_name, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t idx, H5O_info_t& objinfo,
- unsigned fields = H5O_INFO_BASIC,
- const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
- void getInfo(const H5std_string& grp_name, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t idx, H5O_info_t& objinfo,
- unsigned fields = H5O_INFO_BASIC,
- const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
-
// Gets the name of this HDF5 object, i.e., Group, DataSet, or
// DataType.
ssize_t getObjName(char *obj_name, size_t buf_size = 0) const;
diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp
index 3f153e5..57ba5e5 100644
--- a/c++/src/H5PredType.cpp
+++ b/c++/src/H5PredType.cpp
@@ -21,6 +21,7 @@
#include "H5DcreatProp.h"
#include "H5LcreatProp.h"
#include "H5LaccProp.h"
+#include "H5DaccProp.h"
#include "H5Location.h"
#include "H5Object.h"
#include "H5DataType.h"
@@ -914,10 +915,14 @@ September 2015:
+ PredType
+ DataSpace
+ PropList (and its subclasses below)
- + FileAccPropList
- + FileCreatPropList
+ DSetMemXferPropList
+ DSetCreatPropList
+ + DSetAccPropList
+ + FileAccPropList
+ + FileCreatPropList
+ + LinkAccPropList
+ + LinkCreatPropList
+ + ObjCreatPropList
The new method includes these main points:
@@ -1042,18 +1047,24 @@ September 2015:
4. This section shows the differences between the old and new methods
for allocating the following constants
- PropList constant, PropList::DEFAULT.
+ - DSetAccPropList constant, DSetAccPropList::DEFAULT.
- DSetCreatPropList constant, DSetCreatPropList::DEFAULT.
- DSetMemXferPropList constant, DSetMemXferPropList::DEFAULT.
- FileCreatPropList constant, FileCreatPropList::DEFAULT.
- FileAccPropList constant, FileAccPropList::DEFAULT.
+ - LinkAccPropList constant, LinkAccPropList::DEFAULT.
+ - LinkCreatPropList constant, LinkCreatPropList::DEFAULT.
+ - ObjCreatPropList constant, ObjCreatPropList::DEFAULT.
For these constants, the library has the same changes, except the
class names and the HDF5 corresponding constants. Only the items
of PropList are listed, and "PropList" can be replaced by any of
- DSetCreatPropList, DSetMemXferPropList, FileCreatPropList,
- FileAccPropList for those classes. The HDF5 C constant "H5P_DEFAULT"
- can be replaced by any of these respectively: H5P_DATASET_CREATE,
- H5P_DATASET_XFER, H5P_FILE_CREATE, and H5P_FILE_ACCESS.
+ DSetAccPropList, DSetCreatPropList, DSetMemXferPropList,
+ FileCreatPropList, FileAccPropList, LinkAccPropList, LinkCreatPropList,
+ ObjCreatPropList for those classes. The HDF5 C constant "H5P_DEFAULT"
+ can be replaced by any of these respectively: H5P_DATASET_ACCESS,
+ H5P_DATASET_CREATE, H5P_DATASET_XFER, H5P_FILE_CREATE, H5P_FILE_ACCESS,
+ H5P_LINK_ACCESS, H5P_LINK_CREATE, and H5P_OBJECT_CREATE.
Old Method:
----------
diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp
index a067d6c..0cf2a4e 100644
--- a/c++/src/H5StrType.cpp
+++ b/c++/src/H5StrType.cpp
@@ -22,6 +22,7 @@
#include "H5DxferProp.h"
#include "H5LcreatProp.h"
#include "H5LaccProp.h"
+#include "H5DaccProp.h"
#include "H5Location.h"
#include "H5Object.h"
#include "H5DataType.h"
diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp
index e70d42f..18cd831 100644
--- a/c++/src/H5VarLenType.cpp
+++ b/c++/src/H5VarLenType.cpp
@@ -21,6 +21,7 @@
#include "H5DcreatProp.h"
#include "H5LcreatProp.h"
#include "H5LaccProp.h"
+#include "H5DaccProp.h"
#include "H5Location.h"
#include "H5Object.h"
#include "H5DataType.h"
diff --git a/c++/src/Makefile.am b/c++/src/Makefile.am
index c02a9e7..ca42211 100644
--- a/c++/src/Makefile.am
+++ b/c++/src/Makefile.am
@@ -34,21 +34,23 @@ bin_SCRIPTS=h5c++
libhdf5_cpp_la_SOURCES=H5Exception.cpp H5IdComponent.cpp \
H5DataSpace.cpp H5PropList.cpp H5Library.cpp \
H5FaccProp.cpp H5FcreatProp.cpp H5LcreatProp.cpp \
- H5LaccProp.cpp H5DxferProp.cpp H5DcreatProp.cpp \
- H5Location.cpp H5AbstractDs.cpp H5Attribute.cpp \
- H5Object.cpp H5OcreatProp.cpp H5DataType.cpp \
- H5AtomType.cpp H5PredType.cpp H5EnumType.cpp \
- H5IntType.cpp H5FloatType.cpp H5StrType.cpp \
- H5ArrayType.cpp H5VarLenType.cpp H5CompType.cpp \
- H5DataSet.cpp H5CommonFG.cpp H5Group.cpp H5File.cpp
+ H5LaccProp.cpp H5DaccProp.cpp H5DxferProp.cpp \
+ H5DcreatProp.cpp H5Location.cpp H5AbstractDs.cpp \
+ H5Attribute.cpp H5Object.cpp H5OcreatProp.cpp \
+ H5DataType.cpp H5AtomType.cpp H5PredType.cpp \
+ H5EnumType.cpp H5IntType.cpp H5FloatType.cpp \
+ H5StrType.cpp H5ArrayType.cpp H5VarLenType.cpp \
+ H5CompType.cpp H5DataSet.cpp H5CommonFG.cpp H5Group.cpp \
+ H5File.cpp
# HDF5 C++ library depends on HDF5 Library.
libhdf5_cpp_la_LIBADD=$(LIBHDF5)
# Public headers
-include_HEADERS=H5Cpp.h H5AbstractDs.h H5AtomType.h H5Attribute.h \
- H5Classes.h H5CommonFG.h H5CompType.h H5DataSet.h \
- H5DataSpace.h H5DataType.h H5OcreatProp.h H5DcreatProp.h\
+include_HEADERS=H5Cpp.h H5AbstractDs.h H5AtomType.h \
+ H5Attribute.h H5Classes.h H5CommonFG.h H5CompType.h \
+ H5DataSet.h H5DataSpace.h H5DataType.h H5OcreatProp.h \
+ H5DaccProp.h H5DcreatProp.h
H5DxferProp.h H5EnumType.h H5Exception.h H5FaccProp.h \
H5FcreatProp.h H5File.h H5FloatType.h H5Group.h \
H5IdComponent.h H5Include.h H5IntType.h H5LcreatProp.h \
diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp
index e86052b..14f1bd4 100644
--- a/c++/test/dsets.cpp
+++ b/c++/test/dsets.cpp
@@ -1116,12 +1116,11 @@ static herr_t test_types(H5File& file)
/*-------------------------------------------------------------------------
- * Function: test_getinfo
+ * Function: test_getObjinfo
*
- * Purpose Tests getInfo()
+ * Purpose Tests getObjinfo()
*
* Return Success: 0
- *
* Failure: -1
*
* July, 2018
@@ -1145,16 +1144,16 @@ static herr_t test_getinfo(H5File& file)
// Get dataset header info
H5O_info_t oinfo;
HDmemset(&oinfo, 0, sizeof(oinfo));
- dataset.getInfo(oinfo, H5O_INFO_HDR);
- verify_val(oinfo.hdr.nchunks, 1, "DataSet::getInfo", __LINE__, __FILE__);
+ dataset.getObjinfo(oinfo, H5O_INFO_HDR);
+ verify_val(oinfo.hdr.nchunks, 1, "DataSet::getObjinfo", __LINE__, __FILE__);
dataset.close();
// Open the dataset we created above and then close it. This is one
// way to open an existing dataset for accessing.
dataset = file.openDataSet(DSET_DEFAULT_NAME);
HDmemset(&oinfo, 0, sizeof(oinfo));
- dataset.getInfo(oinfo, H5O_INFO_ALL);
- verify_val(oinfo.hdr.nchunks, 1, "DataSet::getInfo", __LINE__, __FILE__);
+ dataset.getObjinfo(oinfo, H5O_INFO_ALL);
+ verify_val(oinfo.hdr.nchunks, 1, "DataSet::getObjinfo", __LINE__, __FILE__);
dataset.close();
PASSED();
@@ -1177,13 +1176,124 @@ static herr_t test_getinfo(H5File& file)
/*-------------------------------------------------------------------------
+ * Function: test_chunk_cache
+ *
+ * Purpose Tests setting rdcc info on a DAPL, and interaction
+ * with the corresponding properties in the file structure.
+ *
+ * Return Success: 0
+ * Failure: number of errors
+ *
+ * July 2018
+ *-------------------------------------------------------------------------
+ */
+const int RANK1 = 1;
+const H5std_string FILE_ACCPLIST("test_accplist.h5");
+
+static herr_t test_chunk_cache(FileAccPropList fapl)
+{
+ SUBTEST("DSetAccPropList::set/getChunkCache");
+
+ try {
+ // Create a default dataset access and file access property lists
+ FileAccPropList fapl_def;
+ DSetAccPropList dapl;
+
+ // Verify that chunk cache parameters are the same
+ int mdc_nelmts = 0;
+ size_t nslots_1 = 0, nslots_4 = 0, nbytes_1 = 0, nbytes_4 = 0;
+ double w0_1 = 0.0F, w0_4 = 0.0F;
+ fapl_def.getCache(mdc_nelmts, nslots_1, nbytes_1, w0_1);
+ dapl.getChunkCache(nslots_4, nbytes_4, w0_4);
+ verify_val(nslots_1, nslots_4, "DSetAccPropList::getChunkCache", __LINE__, __FILE__);
+ verify_val(nbytes_1, nbytes_4, "DSetAccPropList::getChunkCache", __LINE__, __FILE__);
+ verify_val(w0_1, w0_4, "DSetAccPropList::getChunkCache", __LINE__, __FILE__);
+
+ // Set a link access property on dapl to verify property list inheritance
+ dapl.setNumLinks((size_t)134);
+ size_t nlinks = dapl.getNumLinks();
+ verify_val(nlinks, (size_t)134, "DSetAccPropList::getNumLinks", __LINE__, __FILE__);
+
+ // Make a copy of the external fapl
+ FileAccPropList fapl_local(fapl);
+
+ // Set new rdcc settings on fapl local
+ size_t nslots_2 = nslots_1 * 2;
+ size_t nbytes_2 = nbytes_1 * 2;
+ double w0_2 = w0_1 / (double)2.0F;
+ fapl_local.getCache(mdc_nelmts, nslots_2, nbytes_2, w0_2);
+
+ // Create a new file using default fcpl and the passed-in fapl
+ H5File file(FILE_ACCPLIST, H5F_ACC_TRUNC, FileCreatPropList::DEFAULT, fapl_local);
+
+ // Create dataset creation property list
+ DSetCreatPropList dcpl;
+
+ // Set chunk dimensions
+ hsize_t cdims[RANK1];
+ cdims[0] = 10;
+ dcpl.setChunk(RANK1, cdims);
+
+ // Create memory space
+ hsize_t mdims[RANK1];
+ mdims[0] = 10;
+ DataSpace mspace(RANK1, mdims);
+
+ // Create a dataset using that dataset creation properties
+ DataSet dataset(file.createDataSet(DSET_CHUNKED_NAME, PredType::NATIVE_INT, mspace, dcpl, dapl));
+
+ // Get the dataset access property list
+ DSetAccPropList dapl2 = dataset.getAccessPlist();
+
+ // Retrieve and verify the raw data chunk cache parameters
+ nslots_4 = nbytes_4 = 0;
+ w0_4 = 0.0F;
+ dapl2.getChunkCache(nslots_4, nbytes_4, w0_4);
+ verify_val(nslots_2, nslots_4, "DSetCreatPropList::getChunkCache", __LINE__, __FILE__);
+ verify_val(nbytes_2, nbytes_4, "DSetCreatPropList::getChunkCache", __LINE__, __FILE__);
+ verify_val(H5_DBL_ABS_EQUAL(w0_2, w0_4), 1, "DSetCreatPropList::getChunkCache", __LINE__, __FILE__);
+
+
+ // Set new values on original dapl
+ size_t nslots_3 = nslots_1 * 2;
+ size_t nbytes_3 = H5D_CHUNK_CACHE_NBYTES_DEFAULT;
+ double w0_3 = w0_2 / 2;
+ dapl.getChunkCache(nslots_3, nbytes_3, w0_3);
+
+ // Close dataset
+ dataset.close();
+
+ // Reopen dataset
+ DataSet dataset2(file.openDataSet(DSET_CHUNKED_NAME, dapl));
+
+ // Get the dataset access property list
+ DSetAccPropList dapl3 = dataset2.getAccessPlist();
+
+ // Retrieve and verify the raw data chunk cache parameters
+ dapl3.getChunkCache(nslots_4, nbytes_4, w0_4);
+ verify_val(nslots_3, nslots_4, "DSetCreatPropList::getLayout", __LINE__, __FILE__);
+ verify_val(nbytes_3, nbytes_4, "DSetCreatPropList::getLayout", __LINE__, __FILE__);
+ verify_val(H5_DBL_ABS_EQUAL(w0_3, w0_4), 1, "DSetCreatPropList::getLayout", __LINE__, __FILE__);
+
+
+ PASSED();
+ return 0;
+ } // end top try block
+
+ catch (Exception& E)
+ {
+ return -1;
+ }
+} // test_chunk_cache
+
+
+/*-------------------------------------------------------------------------
* Function: test_virtual
*
* Purpose Tests fixed, unlimited, and printf selections in the same
* VDS
*
* Return Success: 0
- *
* Failure: number of errors
*
* Programmer Binh-Minh Ribler
@@ -1305,6 +1415,7 @@ void test_dset()
nerrors += test_multiopen (file) < 0 ? 1:0;
nerrors += test_types(file) < 0 ? 1:0;
nerrors += test_virtual() < 0 ? 1:0;
+ nerrors += test_chunk_cache(fapl) < 0 ? 1:0;
// Close group "emit diagnostics".
grp.close();
diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp
index 94c811a..bdf6d80 100644
--- a/c++/test/tattr.cpp
+++ b/c++/test/tattr.cpp
@@ -521,8 +521,8 @@ static void test_attr_basic_read()
// Verify the correct number of attributes another way
H5O_info_t oinfo;
HDmemset(&oinfo, 0, sizeof(oinfo));
- dataset.getInfo(oinfo, H5O_INFO_NUM_ATTRS);
- verify_val(oinfo.num_attrs, 3, "DataSet::getInfo", __LINE__, __FILE__);
+ dataset.getObjinfo(oinfo, H5O_INFO_NUM_ATTRS);
+ verify_val(oinfo.num_attrs, 3, "DataSet::getObjinfo", __LINE__, __FILE__);
// Open an attribute for the dataset
Attribute ds_attr=dataset.openAttribute(ATTR1_NAME);
@@ -548,8 +548,8 @@ static void test_attr_basic_read()
// Verify the correct number of attributes another way
HDmemset(&oinfo, 0, sizeof(oinfo));
- group.getInfo(oinfo, H5O_INFO_NUM_ATTRS);
- verify_val(oinfo.num_attrs, 1, "Group::getInfo", __LINE__, __FILE__);
+ group.getObjinfo(oinfo, H5O_INFO_NUM_ATTRS);
+ verify_val(oinfo.num_attrs, 1, "Group::getObjinfo", __LINE__, __FILE__);
// Open an attribute for the group
Attribute gr_attr = group.openAttribute(ATTR2_NAME);
@@ -672,8 +672,8 @@ static void test_attr_compound_read()
// Verify the correct number of attributes another way
H5O_info_t oinfo;
HDmemset(&oinfo, 0, sizeof(oinfo));
- dataset.getInfo(oinfo, H5O_INFO_NUM_ATTRS);
- verify_val(oinfo.num_attrs, 1, "DataSet::getInfo", __LINE__, __FILE__);
+ dataset.getObjinfo(oinfo, H5O_INFO_NUM_ATTRS);
+ verify_val(oinfo.num_attrs, 1, "DataSet::getObjinfo", __LINE__, __FILE__);
// Open 1st attribute for the dataset
Attribute attr = dataset.openAttribute((unsigned)0);
diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp
index dd32364..a2bf1c2 100644
--- a/c++/test/tfile.cpp
+++ b/c++/test/tfile.cpp
@@ -660,8 +660,8 @@ static void test_libver_bounds_real(
// Verify object header version another way
H5O_info_t oinfo;
HDmemset(&oinfo, 0, sizeof(oinfo));
- file.getInfo(oinfo, H5O_INFO_HDR);
- verify_val(oinfo.hdr.version, oh_vers_create, "H5File::getInfo", __LINE__, __FILE__);
+ file.getObjinfo(oinfo, H5O_INFO_HDR);
+ verify_val(oinfo.hdr.version, oh_vers_create, "H5File::getObjinfo", __LINE__, __FILE__);
/*
* Reopen the file and make sure the root group still has the correct
@@ -687,8 +687,8 @@ static void test_libver_bounds_real(
// Verify object header version another way
HDmemset(&oinfo, 0, sizeof(oinfo));
- group.getInfo(oinfo, H5O_INFO_HDR);
- verify_val(oinfo.hdr.version, oh_vers_mod, "Group::getInfo", __LINE__, __FILE__);
+ group.getObjinfo(oinfo, H5O_INFO_HDR);
+ verify_val(oinfo.hdr.version, oh_vers_mod, "Group::getObjinfo", __LINE__, __FILE__);
group.close(); // close "/G1"
diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp
index bfc13a0..537716f 100644
--- a/c++/test/tobject.cpp
+++ b/c++/test/tobject.cpp
@@ -545,7 +545,7 @@ static void test_getobjectinfo_same_file()
H5O_info_t oinfo1, oinfo2; /* Object info structs */
// Output message about test being performed
- SUBTEST("Group::getInfo");
+ SUBTEST("Group::getObjinfo");
try {
// Create a new HDF5 file
@@ -561,9 +561,9 @@ static void test_getobjectinfo_same_file()
// Query the info of two groups and verify that they have the same
// file number
- grp1.getInfo(oinfo1);
- grp2.getInfo(oinfo2);
- verify_val(oinfo1.fileno, oinfo2.fileno, "file number from getInfo", __LINE__, __FILE__);
+ grp1.getObjinfo(oinfo1);
+ grp2.getObjinfo(oinfo2);
+ verify_val(oinfo1.fileno, oinfo2.fileno, "file number from getObjinfo", __LINE__, __FILE__);
// Close groups and file
grp1.close();
@@ -584,17 +584,17 @@ static void test_getobjectinfo_same_file()
// Query the info of two groups and verify that they have the same
// file number
- grp1.getInfo(oinfo1);
- grp2.getInfo(oinfo2);
- verify_val(oinfo1.fileno, oinfo2.fileno, "file number from getInfo", __LINE__, __FILE__);
+ grp1.getObjinfo(oinfo1);
+ grp2.getObjinfo(oinfo2);
+ verify_val(oinfo1.fileno, oinfo2.fileno, "file number from getObjinfo", __LINE__, __FILE__);
// Reset object info
HDmemset(&oinfo1, 0, sizeof(oinfo1));
HDmemset(&oinfo2, 0, sizeof(oinfo2));
- file1.getInfo(GROUP1NAME, oinfo1);
- file1.getInfo(GROUP2NAME, oinfo2);
+ file1.getObjinfo(GROUP1NAME, oinfo1);
+ file1.getObjinfo(GROUP2NAME, oinfo2);
verify_val(oinfo1.fileno, oinfo2.fileno, "file number from getObjectInfo", __LINE__, __FILE__);
// Close groups and files
diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp
index fa214df..562b127 100644
--- a/c++/test/trefer.cpp
+++ b/c++/test/trefer.cpp
@@ -481,19 +481,19 @@ static void test_reference_group()
fname = group.getFileName();
verify_val(fname, FILE1, "H5Group::getFileName",__LINE__,__FILE__);
- // Check object type using Group::getInfo()
+ // Check object type using Group::getObjinfo()
H5O_info_t oinfo;
HDmemset(&oinfo, 0, sizeof(oinfo));
- group.getInfo(".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)0, oinfo);
- verify_val(oinfo.type, H5O_TYPE_DATASET, "Group::getInfo",__LINE__,__FILE__);
+ group.getObjinfo(".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)0, oinfo);
+ verify_val(oinfo.type, H5O_TYPE_DATASET, "Group::getObjinfo",__LINE__,__FILE__);
// Check for out of bound query by index
try {
HDmemset(&oinfo, 0, sizeof(oinfo));
- group.getInfo(".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)9, oinfo);
+ group.getObjinfo(".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)9, oinfo);
// Should FAIL but didn't, so throw an invalid action exception
- throw InvalidActionException("Group::getInfo", "Out of bound index.");
+ throw InvalidActionException("Group::getObjinfo", "Out of bound index.");
} catch (Exception& err) {} // do nothing, failure expected
// Unlink one of the objects in the dereferenced group, and re-check
diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp
index 6d585bd..0de66d7 100644
--- a/c++/test/ttypes.cpp
+++ b/c++/test/ttypes.cpp
@@ -1097,13 +1097,12 @@ static void test_operators()
verify_val(flttyp == member_inttyp, false, "DataType::operator==", __LINE__, __FILE__);
verify_val(flttyp != member_inttyp, true, "DataType::operator==", __LINE__, __FILE__);
- // Get the NATIVE_LONG member from the compound datatype above
- IntType member_longtyp = cmptyp.getMemberIntType(2);
+ // Get the NATIVE_FLOAT member from the compound datatype above
+ IntType member_flttyp = cmptyp.getMemberIntType(1);
// Test various combinations
- verify_val(inttyp == member_longtyp, false, "DataType::operator==", __LINE__, __FILE__);
- verify_val(flttyp == member_longtyp, false, "DataType::operator==", __LINE__, __FILE__);
- verify_val(flttyp != member_longtyp, true, "DataType::operator==", __LINE__, __FILE__);
+ verify_val(inttyp == member_flttyp, false, "DataType::operator==", __LINE__, __FILE__);
+ verify_val(flttyp != member_flttyp, false, "DataType::operator==", __LINE__, __FILE__);
PASSED();
}