summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2016-10-04 21:50:54 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2016-10-04 21:50:54 (GMT)
commitd93cb9ca25b5a5e987c6b9023f6868d47dd93a9a (patch)
tree26ef4d2123aefaa2173f45b9501fccc0a97c9c37
parent620bfd58ae44dcf876303efb99482019ebbb9b6a (diff)
downloadhdf5-d93cb9ca25b5a5e987c6b9023f6868d47dd93a9a.zip
hdf5-d93cb9ca25b5a5e987c6b9023f6868d47dd93a9a.tar.gz
hdf5-d93cb9ca25b5a5e987c6b9023f6868d47dd93a9a.tar.bz2
Added C++ wrappers (get/setCoreWriteTracking()) for new
H5Pset/get_core_write_tracking() API calls.
-rw-r--r--c++/src/H5FaccProp.cpp41
-rw-r--r--c++/src/H5FaccProp.h6
-rw-r--r--c++/test/tfile.cpp2
3 files changed, 48 insertions, 1 deletions
diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp
index 972f915..653b6cc 100644
--- a/c++/src/H5FaccProp.cpp
+++ b/c++/src/H5FaccProp.cpp
@@ -241,6 +241,47 @@ void FileAccPropList::getCore (size_t& increment, hbool_t& backing_store) const
}
//--------------------------------------------------------------------------
+// Function: FileAccPropList::setCoreWriteTracking
+///\brief Modifies core driver write tracking properties on this file
+/// access property list.
+///\param is_enabled - IN: Whether the write tracking feature should
+/// be enabled or not.
+///\param page_size - IN: Sets the page size used with the write tracking
+/// feature. When set to a value greater than 1, this allows
+/// page-sized aggregation of tracked writes.
+///\exception H5::PropListIException
+///\par Description
+/// For more details on the use of the write tracking feature, refer to
+/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetCoreWriteTracking
+// Programmer: Dana Robinson - Fall 2016
+//--------------------------------------------------------------------------
+void FileAccPropList::setCoreWriteTracking (hbool_t is_enabled, size_t page_size) const
+{
+ herr_t ret_value = H5Pset_core_write_tracking (id, is_enabled, page_size);
+ if (ret_value < 0)
+ {
+ throw PropListIException ("FileAccPropList::setCoreWriteTracking", "H5Pset_core_write_tracking failed");
+ }
+}
+
+//--------------------------------------------------------------------------
+// Function: FileAccPropList::getCoreWriteTracking
+///\brief Queries core file driver write tracking properties.
+///\param is_enabled - OUT: Whether or not the write tracking feature is
+/// enabled.
+///\param page_size - OUT: The page size used when aggregating tracked writes.
+///\exception H5::PropListIException
+// Programmer: Dana Robinson - Fall 2016
+//--------------------------------------------------------------------------
+void FileAccPropList::getCoreWriteTracking (hbool_t& is_enabled, size_t& page_size) const
+{
+ herr_t ret_value = H5Pget_core_write_tracking(id, &is_enabled, &page_size);
+ if( ret_value < 0 )
+ {
+ throw PropListIException("FileAccPropList::getCoreWriteTracking", "H5Pget_core_write_tracking failed");
+ }
+}
+//--------------------------------------------------------------------------
// Function: FileAccPropList::setFamily
///\brief Sets this file access property list to use the family driver.
///\param memb_size - IN: Size in bytes of each file member
diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h
index 831488c..1020c46 100644
--- a/c++/src/H5FaccProp.h
+++ b/c++/src/H5FaccProp.h
@@ -58,6 +58,12 @@ class H5_DLLCPP FileAccPropList : public PropList {
// Queries H5FD_CORE driver properties.
void getCore (size_t& increment, hbool_t& backing_store) const;
+ // Sets write tracking for the core driver.
+ void setCoreWriteTracking (hbool_t is_enabled, size_t page_size) const;
+
+ // Queries the core driver write tracking property.
+ void getCoreWriteTracking (hbool_t& is_enabled, size_t& page_size) const;
+
// Sets this file access properties list to the family driver.
void setFamily( hsize_t memb_size, const FileAccPropList& memb_plist ) const;
diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp
index 0eabfb9..f322ff7 100644
--- a/c++/test/tfile.cpp
+++ b/c++/test/tfile.cpp
@@ -565,7 +565,7 @@ static void test_file_attribute()
dattr.write(PredType::NATIVE_INT, dattr_data);
// Test flushing out the data from the attribute object
- dattr.flush(H5F_SCOPE_GLOBAL);
+ dattr.flush(H5F_SCOPE_GLOBAL);
// Get and verify the number of all objects in the file
// Current: 1 file, 2 file attr, 1 ds, and 1 ds attr.