diff options
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; |