diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2001-03-10 03:59:46 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2001-03-10 03:59:46 (GMT) |
commit | 9cd9f7f5216fbc30b10426f5bd11e26d81668eac (patch) | |
tree | be3e4f25e5a870f8e98c7b1cfce3917a5dd19269 /c++/src/H5DxferProp.cpp | |
parent | cd29e12e0252ccfc969281c5dabd991b46203f05 (diff) | |
download | hdf5-9cd9f7f5216fbc30b10426f5bd11e26d81668eac.zip hdf5-9cd9f7f5216fbc30b10426f5bd11e26d81668eac.tar.gz hdf5-9cd9f7f5216fbc30b10426f5bd11e26d81668eac.tar.bz2 |
[svn-r3602]
Purpose: Usability enhancement
Description:
- Added more information about the failure to all the throw's,
i.e, member function name and more detail about the failure, where
appropriate. Also, added exception throws for private functions,
such as p_close to provide more specific details.
- Added two api functions: Exception::getFuncName() and
Exception::getCFuncName() to provide the name of the member
function where failure occurs.
- Fixed some typos, one of which caused segn. fault in some
situations (resetIdComponent was accidentally called twice
in a couple of places :)
Platforms:
arabica (sparc-sun-solaris 2.7)
Diffstat (limited to 'c++/src/H5DxferProp.cpp')
-rw-r--r-- | c++/src/H5DxferProp.cpp | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index 5792865..a3247d0 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -25,7 +25,8 @@ void DSetMemXferPropList::setBuffer( size_t size, void* tconv, void* bkg ) const herr_t ret_value = H5Pset_buffer( id, size, tconv, bkg ); if( ret_value < 0 ) { - throw PropListIException(); + throw PropListIException("DSetMemXferPropList::setBuffer", + "H5Pset_buffer failed"); } } @@ -35,7 +36,8 @@ size_t DSetMemXferPropList::getBuffer( void** tconv, void** bkg ) const size_t buffer_size = H5Pget_buffer( id, tconv, bkg ); if( buffer_size == 0 ) { - throw PropListIException(); + throw PropListIException("DSetMemXferPropList::getBuffer", + "H5Pget_buffer returned 0 for buffer size - failure"); } return( buffer_size ); } @@ -46,7 +48,8 @@ void DSetMemXferPropList::setPreserve( bool status ) const herr_t ret_value = H5Pset_preserve( id, (hbool_t) status ); if( ret_value < 0 ) { - throw PropListIException(); + throw PropListIException("DSetMemXferPropList::setPreserve", + "H5Pset_preserve failed"); } } @@ -60,7 +63,8 @@ bool DSetMemXferPropList::getPreserve() const return false; else { - throw PropListIException(); + throw PropListIException("DSetMemXferPropList::getPreserve", + "H5Pget_preserve returned negative value for status"); } } @@ -70,7 +74,8 @@ void DSetMemXferPropList::setHyperCache( bool cache, unsigned limit ) const herr_t ret_value = H5Pset_hyper_cache( id, cache, limit ); if( ret_value < 0 ) { - throw PropListIException(); + throw PropListIException("DSetMemXferPropList::setHyperCache", + "H5Pset_hyper_cache failed"); } } @@ -81,7 +86,8 @@ void DSetMemXferPropList::getHyperCache( bool& cache, unsigned& limit ) const herr_t ret_value = H5Pget_hyper_cache( id, &temp_cache, &limit ); if( ret_value < 0 ) { - throw PropListIException(); + throw PropListIException("DSetMemXferPropList::getHyperCache", + "H5Pget_hyper_cache failed"); } if( temp_cache > 0 ) cache = true; @@ -95,7 +101,8 @@ void DSetMemXferPropList::setBtreeRatios( double left, double middle, double rig herr_t ret_value = H5Pset_btree_ratios( id, left, middle, right ); if( ret_value < 0 ) { - throw PropListIException(); + throw PropListIException("DSetMemXferPropList::setBtreeRatios", + "H5Pset_btree_ratios failed"); } } @@ -105,7 +112,8 @@ void DSetMemXferPropList::getBtreeRatios( double& left, double& middle, double& herr_t ret_value = H5Pget_btree_ratios( id, &left, &middle, &right ); if( ret_value < 0 ) { - throw PropListIException(); + throw PropListIException("DSetMemXferPropList::getBtreeRatios", + "H5Pget_btree_ratios failed"); } } @@ -116,7 +124,8 @@ void DSetMemXferPropList::setVlenMemManager( H5MM_allocate_t alloc_func, void* a free_func, free_info ); if( ret_value < 0 ) { - throw PropListIException(); + throw PropListIException("DSetMemXferPropList::setVlenMemManager", + "H5Pset_vlen_mem_manager failed"); } } @@ -128,7 +137,8 @@ void DSetMemXferPropList::setVlenMemManager() const //herr_t ret_value = H5Pset_vlen_mem_manager( id, NULL, NULL, NULL, NULL ); //if( ret_value < 0 ) //{ - //throw PropListIException(); + //throw PropListIException("DSetMemXferPropList::setVlenMemManager", + //"H5Pset_vlen_mem_manager failed"); //} } @@ -138,7 +148,8 @@ void DSetMemXferPropList::getVlenMemManager( H5MM_allocate_t& alloc_func, void** herr_t ret_value = H5Pget_vlen_mem_manager( id, &alloc_func, alloc_info, &free_func, free_info ); if( ret_value < 0 ) { - throw PropListIException(); + throw PropListIException("DSetMemXferPropList::getVlenMemManager", + "H5Pget_vlen_mem_manager failed"); } } @@ -149,7 +160,8 @@ void DSetMemXferPropList::setXfer( H5D_transfer_t data_xfer_mode = H5D_XFER_INDE herr_t ret_value = H5Pset_xfer( ... ); if( ret_value < 0 ) { - throw PropListIException(); + throw PropListIException("DSetMemXferPropList::setXfer", + "H5Pset_xfer failed"); } } @@ -158,10 +170,12 @@ void DSetMemXferPropList::setXfer( H5D_transfer_t data_xfer_mode = H5D_XFER_INDE H5D_transfer_t DSetMemXferPropList::getXfer() const { H5D_transfer_t xfer = H5Pget_xfer( id ); -// remove when done - find out what the value is for ?? +// BMR - need to find out what the value is for ?? when this function +// is supported if( xfer == ?? ) { - throw PropListIException(); + throw PropListIException("DSetMemXferPropList::getXfer", + "H5Pget_xfer failed"); } return( xfer ); } |