moab
HDF5Common.cpp
Go to the documentation of this file.
00001 #include <HDF5Common.hpp>
00002 #include <H5Spublic.h>
00003 #include <assert.h>
00004 
00005 namespace moab {
00006 
00007 bool HDF5_can_append_hyperslabs()
00008 {
00009   hsize_t dim = 100;
00010   hid_t space = H5Screate_simple( 1, &dim, NULL );
00011   bool result = false;
00012 
00013   HDF5_Error_Func_Type fptr = 0;
00014   void* fdata = 0;
00015 #if defined(H5Eget_auto_vers) && H5Eget_auto_vers > 1
00016   if (0 <= H5Eget_auto( H5E_DEFAULT, &fptr, &fdata ))
00017     H5Eset_auto( H5E_DEFAULT, 0, 0 );
00018 #else
00019   if (0 <= H5Eget_auto( &fptr, &fdata ))
00020     H5Eset_auto( 0, 0 );
00021 #endif
00022 
00023   
00024   hsize_t start = 1, count = 5;
00025   H5Sselect_hyperslab( space, H5S_SELECT_SET, &start, 0, &count, 0 );
00026   start = 20;
00027   if (0 <= H5Sselect_hyperslab( space, H5S_SELECT_APPEND, &start, 0, &count, 0 ))
00028     result = true;
00029 
00030   if (fptr) {
00031 #if defined(H5Eset_auto_vers) && H5Eset_auto_vers > 1
00032     H5Eset_auto( H5E_DEFAULT, fptr, fdata );
00033 #else
00034     H5Eset_auto( fptr, fdata );
00035 #endif
00036   }
00037   H5Sclose( space );
00038   
00039   return result;
00040 }
00041 
00042 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines