diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2001-12-05 20:26:39 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2001-12-05 20:26:39 (GMT) |
commit | 6ecbcc1717aa79dbaa00926b7a5f095a921f8991 (patch) | |
tree | 6a5a949e3ef0419d9eb9ad05c90f083a8f49d066 /c++ | |
parent | 253123994aaecc1f1fc917383b663104d6630d0f (diff) | |
download | hdf5-6ecbcc1717aa79dbaa00926b7a5f095a921f8991.zip hdf5-6ecbcc1717aa79dbaa00926b7a5f095a921f8991.tar.gz hdf5-6ecbcc1717aa79dbaa00926b7a5f095a921f8991.tar.bz2 |
[svn-r4676] Purpose:
Backward Compatibility Fix
Description:
One of H5P[gs]et_buffer's parameters changed between v1.4 and the
development branch.
Solution:
Added v1.4 compat stuff around H5P[gs]et_buffer implementation and testing
to allow v1.4.x users to continue to use their source code without
modification.
These changes are for everything except the FORTRAN wrappers - I spoke with
Elena and she will make the FORTRAN wrapper changes.
Platforms tested:
FreeBSD 4.4 (hawkwind)
Diffstat (limited to 'c++')
-rw-r--r-- | c++/src/H5DxferProp.cpp | 25 | ||||
-rw-r--r-- | c++/src/H5DxferProp.h | 8 |
2 files changed, 33 insertions, 0 deletions
diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index da67d4c..36d2405 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -19,6 +19,30 @@ DSetMemXferPropList::DSetMemXferPropList() : PropList( H5P_DATASET_XFER) {} // Copy constructor: makes a copy of the original DSetMemXferPropList object; DSetMemXferPropList::DSetMemXferPropList( const DSetMemXferPropList& orig ) : PropList( orig ) {} +#ifdef H5_WANT_H5_V1_4_COMPAT +// Sets type conversion and background buffers +void DSetMemXferPropList::setBuffer( hsize_t size, void* tconv, void* bkg ) const +{ + herr_t ret_value = H5Pset_buffer( id, size, tconv, bkg ); + if( ret_value < 0 ) + { + throw PropListIException("DSetMemXferPropList::setBuffer", + "H5Pset_buffer failed"); + } +} + +// Reads buffer settings +hsize_t DSetMemXferPropList::getBuffer( void** tconv, void** bkg ) const +{ + hsize_t buffer_size = H5Pget_buffer( id, tconv, bkg ); + if( buffer_size == 0 ) + { + throw PropListIException("DSetMemXferPropList::getBuffer", + "H5Pget_buffer returned 0 for buffer size - failure"); + } + return( buffer_size ); +} +#else /* H5_WANT_H5_V1_4_COMPAT */ // Sets type conversion and background buffers void DSetMemXferPropList::setBuffer( size_t size, void* tconv, void* bkg ) const { @@ -41,6 +65,7 @@ size_t DSetMemXferPropList::getBuffer( void** tconv, void** bkg ) const } return( buffer_size ); } +#endif /* H5_WANT_H5_V1_4_COMPAT */ // Sets the dataset transfer property list status to TRUE or FALSE void DSetMemXferPropList::setPreserve( bool status ) const diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index d868ed8..a612805 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -16,11 +16,19 @@ class DSetMemXferPropList : public PropList { // Copy constructor: creates a copy of a DSetMemXferPropList object DSetMemXferPropList( const DSetMemXferPropList& orig ); +#ifdef H5_WANT_H5_V1_4_COMPAT + // Sets type conversion and background buffers + void setBuffer( hsize_t size, void* tconv, void* bkg ) const; + + // Reads buffer settings + hsize_t getBuffer( void** tconv, void** bkg ) const; +#else /* H5_WANT_H5_V1_4_COMPAT */ // Sets type conversion and background buffers void setBuffer( size_t size, void* tconv, void* bkg ) const; // Reads buffer settings size_t getBuffer( void** tconv, void** bkg ) const; +#endif /* H5_WANT_H5_V1_4_COMPAT */ // Sets the dataset transfer property list status to TRUE or FALSE void setPreserve( bool status ) const; |