Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Content Layer
id1195548671
Content Column
width50.00001%
id1195578110
classrm_pagetree_col mobile-hide
Content Block
id1195578111
 
Content Column
width50.00001%
id1195548673
classhdf-rm-main-column
Content Block
id1195548672

Include Content
render-without-blockstrue
page.rm-navbar
HTML Wrap
classhdf-print-only

Page Title

HTML Wrap
classhdf-rm-summary-block

Hdf rm anchor
AnchorNamesummary

Excerpt

Provides the mechanism by which a user application may set an action for H5O_COPY to take after checking all suggested paths for a matching committed datatype but before starting the global search of the destination file

HTML Wrap
classhdf-rm-content-block

 

Hdf rm anchor
AnchorNamesignature

Signature:
HTML Wrap
classhdf-rm-section
HTML Wrap
classhdf-togglebox hdf-c

HTML Add Class
hdf-togglebutton-visible
hdf-togglebutton-visible
selector.hdf-togglebutton.hdf-c

HTML
<pre><code class="language-c">typedef H5O_mcdt_search_ret_t ( *H5O_mcdt_search_cb_t )( void *op_data )</code></pre>

Hdf rm anchor
AnchorNameparameters

Parameters:
HTML Wrap
classhdf-rm-section
void *op_dataIN/OUT: Pointer to user-defined input data. This is a pass-through of the data that was passed to H5P_SET_MCDT_SEARCH_CB.

Hdf rm anchor
AnchorNamedescription

Description:
HTML Wrap
classhdf-rm-section

H5O_MCDT_SEARCH_CB_T is the callback function that H5O_COPY will invoke if the callback is set and when the merge committed datatype feature is enabled in the object copy property list (see H5P_SET_COPY_OBJECT).

After searching the list of suggested committed datatype paths, H5O_COPY will invoke this callback before searching all committed datatypes in the destination file. This allows a user application to add a customized step to the search process. The callback function is set with H5P_SET_MCDT_SEARCH_CB and the search process is described in H5P_ADD_MERGE_COMMITTED_DTYPE_PATH.

Valid return values from this callback function are as follows (defined in the enumerated datatype H5O_mcdt_search_ret_t in H5Opublic.h):

H5O_MCDT_SEARCH_ERRORAborts H5O_COPY
H5O_MCDT_SEARCH_CONTContinues the global search of all committed datatypes in the destination file
H5O_MCDT_SEARCH_STOPStops the search, but continues copying
Warning

If the callback’s return value is H5O_MCDT_SEARCH_ERROR, H5O_COPY will abort and the destination file may be left in an inconsistent or corrupted state.

Hdf rm anchor
AnchorNamereturns

Returns:
HTML Wrap
classhdf-rm-section

Returns one of the H5O_MCDT_SEARCH_* values described above.

Warning

Failure Modes:

H5O_mcdtMCDT_searchSEARCH_cbCB_t T failure modes are dependent on the implementation of the callback function.


Hdf rm anchor
AnchorNameexample

Example:
HTML Wrap
classhdf-rm-section
Info

This example defines a callback function in the object copy property list to discontinue the global search if a matching committed datatype cannot be found among the suggested paths.

/* The user-defined callback function */
static H5O_mcdt_search_ret_t
mcdt_search_cb(void *_udata)
{
    H5O_mcdt_search_ret_t action = *((H5O_mcdt_search_ret_t *)_udata);

    return(action);
}

int main(void) {
    hid_t ocpypl_id = H5Pcreate(H5P_OBJECT_COPY);

    /* Enable the merging committed datatype feature. */
    H5Pset_copy_object(ocpypl_id, H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG);

    /* Add the path to search for a matching committed datatype. */
    H5Padd_merge_committed_dtype_path(ocpypl_id, "/group/committed_dtypeA");

    /*
     * Set the callback function to discontinue the global search
     * if H5Ocopy cannot find a matching committed datatype from the
     * above suggested path.
     */
    action = H5O_MCDT_SEARCH_STOP;
    H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cb, &action);

    /* Do the copy. */
    H5Ocopy(...ocpypl_id...);
    ...
    ...
}
Comment
HTML Wrap
classhdf-togglebox hdf-c

Bitbucket Server file
repoSlughdf5
branchIdrefs/heads/1.10/master
projectKeyHDFFV
filepathexamples/h5_subset.c
showLineNumberstrue
lineStart32
progLangcpp
lineEnd42
applicationLink5ac7b370-7412-3c8c-ad20-807a68261336

HTML Wrap
classhdf-togglebox hdf-fortran hdf-togglebox-hidden

Bitbucket Server file
repoSlughdf5
branchIdrefs/heads/1.10/master
projectKeyHDFFV
filepathfortran/examples/compound.f90
showLineNumberstrue
lineStart25
progLangplain
lineEnd35
applicationLink5ac7b370-7412-3c8c-ad20-807a68261336

Hdf rm anchor
AnchorNamehistory

History:
HTML Wrap
classhdf-rm-section
Release    Change
1.8.9C function type introduced in this release.