Documentation Center

  • Trial Software
  • Product Updates


Visit objects specified by object identifier


[status,opdata_out] = H5O.visit(obj_id,index_type,order,iter_func,opdata_in)


[status,opdata_out] = H5O.visit(obj_id,index_type,order,iter_func,opdata_in) is a recursive iteration function to visit the object object_id and, if object_id is a group, all objects in and below it in an HDF5 file. This provides a mechanism for an application to perform a common set of operations across all of those objects or a dynamically selected subset.

If object_id is a group identifier, that group serves as the root of a recursive iteration. If object_id is a file identifier, that file's root group serves as the root of the recursive iteration. If object_id is any other type of object, such as a dataset or named data type, there is no iteration.

Two parameters are used to establish the iteration: index_type and order. The index_type parameter specifies the index used. If the links in a group have not been indexed by the index type, they are first sorted by that index, and then the iteration will begin. If the links have been so indexed, the sorting step is unnecessary, so the iteration can begin more quickly. Valid values include the following.

'H5_INDEX_NAME'Alpha-numeric index on name
'H5_INDEX_CRT_ORDER'Index on creation order


'H5_ITER_INC'Increasing order
'H5_ITER_DEC'Decreasing order
'H5_ITER_NATIVE'Fastest available order

The callback function iter_func must have the following signature:



status value returned by iter_func is interpreted as follows.

positiveStops the iteration and returns the positive status value to the caller
negativeStops the iteration and throws an error indicating failure

See Also

Was this topic helpful?