diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2020-11-17 13:47:52 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-17 13:47:52 (GMT) |
commit | 5d0be1b196570ac2c08ffe0b61ac6a45b6ab7f3f (patch) | |
tree | dbe8a76bcb211babe9900647eb1f515d8623ad9b /c++ | |
parent | ec48fb8dfdb4f2f59f22a5efb6b950aafcac449d (diff) | |
download | hdf5-5d0be1b196570ac2c08ffe0b61ac6a45b6ab7f3f.zip hdf5-5d0be1b196570ac2c08ffe0b61ac6a45b6ab7f3f.tar.gz hdf5-5d0be1b196570ac2c08ffe0b61ac6a45b6ab7f3f.tar.bz2 |
Manual sync with develop (#95)
Brings all features from develop. Note that RELEASE.txt has not been
updated (will be done in a future PR).
Diffstat (limited to 'c++')
-rw-r--r-- | c++/src/H5FaccProp.cpp | 46 | ||||
-rw-r--r-- | c++/src/H5FaccProp.h | 6 |
2 files changed, 52 insertions, 0 deletions
diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp index 0f7184c..b60ff8f 100644 --- a/c++/src/H5FaccProp.cpp +++ b/c++/src/H5FaccProp.cpp @@ -691,6 +691,52 @@ FileAccPropList::getGcReferences() const } //-------------------------------------------------------------------------- +// Function: FileAccPropList::setFileLocking +///\brief Sets file locking flags. +///\param use_file_locking - IN: Flag that determines if file locks should +// be used or not. +///\param ignore_when_disabled - IN: Flag that determines if file locks +// should be be used when disabled on the file system or not. +///\exception H5::PropListIException +///\par Description +/// For information, please refer to the H5Pset_file_locking API in +/// the HDF5 C Reference Manual. +// Programmer Dana Robinson - 2020 +//-------------------------------------------------------------------------- +void +FileAccPropList::setFileLocking(hbool_t use_file_locking, hbool_t ignore_when_disabled) const +{ + herr_t ret_value = H5Pset_file_locking(id, use_file_locking, ignore_when_disabled); + + if (ret_value < 0) { + throw PropListIException("FileAccPropList::setFileLocking", "H5Pset_file_locking failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: FileAccPropList::getFileLocking +///\brief Gets file locking flags. +///\param use_file_locking - OUT: Flag that determines if file locks +// should be used or not. +///\param ignore_when_disabled - OUT: Flag that determines if file locks +// should be be used when disabled on the file system or not. +///\exception H5::PropListIException +///\par Description +/// For information, please refer to the H5Pget_file_locking API in +/// the HDF5 C Reference Manual. +// Programmer Dana Robinson - 2020 +//-------------------------------------------------------------------------- +void +FileAccPropList::getFileLocking(hbool_t &use_file_locking, hbool_t &ignore_when_disabled) const +{ + herr_t ret_value = H5Pget_file_locking(id, &use_file_locking, &ignore_when_disabled); + + if (ret_value < 0) { + throw PropListIException("FileAccPropList::getFileLocking", "H5Pget_file_locking failed"); + } +} + +//-------------------------------------------------------------------------- // Function: FileAccPropList::setLibverBounds ///\brief Sets bounds on versions of library format to be used when creating /// or writing objects. diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index d1a5051..10bf728 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -122,6 +122,12 @@ class H5_DLLCPP FileAccPropList : public PropList { // Returns garbage collecting references setting. unsigned getGcReferences() const; + // Sets file locking parameters. + void setFileLocking(hbool_t use_file_locking, hbool_t ignore_when_disabled) const; + + // Gets file locking parameters. + void getFileLocking(hbool_t &use_file_locking, hbool_t &ignore_when_disabled) const; + // Sets bounds on versions of library format to be used when creating // or writing objects. void setLibverBounds(H5F_libver_t libver_low, H5F_libver_t libver_high) const; |