diff options
author | Quincey Koziol <koziol@lbl.gov> | 2019-06-18 14:39:00 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@lbl.gov> | 2019-06-18 14:39:00 (GMT) |
commit | 1802d4cb144fd2bccb209883481ad372fefdc349 (patch) | |
tree | 35b67097aec3383582f291805e8890a10a109e46 /src/H5S.c | |
parent | f73a190d2c2e2bfe80508599e0d76d62c358ae68 (diff) | |
parent | d20139399750246f55c902940987e0048a40c268 (diff) | |
download | hdf5-1802d4cb144fd2bccb209883481ad372fefdc349.zip hdf5-1802d4cb144fd2bccb209883481ad372fefdc349.tar.gz hdf5-1802d4cb144fd2bccb209883481ad372fefdc349.tar.bz2 |
Merge pull request #1740 in HDFFV/hdf5 from merge_hyperslab_04 to develop
* commit 'd20139399750246f55c902940987e0048a40c268':
Add H5S_SEL_ITER_SHARE_WITH_DATASPACE selection iterator creation flag, to share dataspace's selection with iterator (and with caution about not modifying or closing the dataspace while the iterator is open).
Fix misc. typos, etc. from code review
New hyperslab selection routines and new public selection iterator routines.
Diffstat (limited to 'src/H5S.c')
-rw-r--r-- | src/H5S.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -93,6 +93,14 @@ static const H5I_class_t H5I_DATASPACE_CLS[1] = {{ (H5I_free_t)H5S_close /* Callback routine for closing objects of this class */ }}; +/* Dataspace selection iterator ID class */ +static const H5I_class_t H5I_SPACE_SEL_ITER_CLS[1] = {{ + H5I_SPACE_SEL_ITER, /* ID class value */ + 0, /* Class flags */ + 0, /* # of reserved IDs for class */ + (H5I_free_t)H5S_sel_iter_close /* Callback routine for closing objects of this class */ +}}; + /* Flag indicating "top" of interface has been initialized */ static hbool_t H5S_top_package_initialize_s = FALSE; @@ -120,6 +128,10 @@ H5S__init_package(void) if(H5I_register_type(H5I_DATASPACE_CLS) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize dataspace ID class") + /* Initialize the atom group for the dataspace selction iterator IDs */ + if(H5I_register_type(H5I_SPACE_SEL_ITER_CLS) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize dataspace selection iterator ID class") + /* Mark "top" of interface as initialized, too */ H5S_top_package_initialize_s = TRUE; @@ -159,6 +171,11 @@ H5S_top_term_package(void) n++; /*H5I*/ } /* end if */ + if(H5I_nmembers(H5I_SPACE_SEL_ITER) > 0) { + (void)H5I_clear_type(H5I_SPACE_SEL_ITER, FALSE, FALSE); + n++; /*H5I*/ + } /* end if */ + /* Mark "top" of interface as closed */ if(0 == n) H5S_top_package_initialize_s = FALSE; @@ -198,11 +215,15 @@ H5S_term_package(void) if(H5_PKG_INIT_VAR) { /* Sanity checks */ HDassert(0 == H5I_nmembers(H5I_DATASPACE)); + HDassert(0 == H5I_nmembers(H5I_SPACE_SEL_ITER)); HDassert(FALSE == H5S_top_package_initialize_s); /* Destroy the dataspace object id group */ n += (H5I_dec_type_ref(H5I_DATASPACE) > 0); + /* Destroy the dataspace selection iterator object id group */ + n += (H5I_dec_type_ref(H5I_SPACE_SEL_ITER) > 0); + /* Mark interface as closed */ if(0 == n) H5_PKG_INIT_VAR = FALSE; |