Exemple #1
0
herr_t H5ARRAYget_fill_value( hid_t dataset_id,
                              hid_t type_id,
                              int *status,
                              void *value)
{
  hid_t        plist_id;

  /* Get creation properties list */
  if ( (plist_id = H5Dget_create_plist(dataset_id)) < 0 )
    goto out;

  /* How the fill value is defined? */
  if ( (H5Pfill_value_defined(plist_id, status)) < 0 )
    goto out;

  if ( *status == H5D_FILL_VALUE_USER_DEFINED ) {
    if ( H5Pget_fill_value(plist_id, type_id, value) < 0 )
      goto out;
  }

  /* Terminate access to the datatype */
  if ( H5Pclose( plist_id ) < 0 )
    goto out;

  return 0;

out:
  return -1;

}
Exemple #2
0
//--------------------------------------------------------------------------
// Function:	DSetCreatPropList::getFillValue
///\brief	Retrieves a dataset fill value
///\param	fvalue_type - IN: Data type for the value passed via \a value
///\param	value - OUT: Pointer to buffer to hold the retrieved fill value
///\exception	H5::PropListIException
///\par Description
///		The fill value is returned through \a value pointer
///		and the memory is allocated by the caller.  The fill
///		value will be converted from its current data type to the
///		specified by \a fvalue_type.
// Programmer	Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DSetCreatPropList::getFillValue( const DataType& fvalue_type, void* value ) const
{
   herr_t ret_value = H5Pget_fill_value( id, fvalue_type.getId(), value );
   if( ret_value < 0 )
   {
      throw PropListIException("DSetCreatPropList::getFillValue",
                "H5Pget_fill_value failed");
   }
}