Increments the reference count for an object
int H5Iinc_ref( hid_t obj_id )
SUBROUTINE h5iinc_ref_f(obj_id, ref_count, hdferr)
INTEGER(HID_T), INTENT(IN) :: obj_id !Object identifier
INTEGER, INTENT(OUT) :: ref_count !Reference count of object ID
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success, and -1 on failure
END SUBROUTINE h5iinc_ref_f
|IN: Object identifier whose reference count will be modified|
H5I_INC_REF increments the reference count of the object identified by
The reference count for an object ID is attached to the information about an object in memory and has no relation to the number of links to an object on disk.
The reference count for a newly created object will be 1. Reference counts for objects may be explicitly modified with this function or with H5I_DEC_REF. When an object ID's reference count reaches zero, the object will be closed. Calling an object ID's 'close' function decrements the reference count for the ID which normally closes the object, but if the reference count for the ID has been incremented with this function, the object will only be closed when the reference count reaches zero with further calls to H5I_DEC_REF or the object ID's 'close' function.
If the object ID was created by a collective parallel call (such as H5D_CREATE, H5G_OPEN, etc.), the reference count should be modified by all the processes which have copies of the ID. Generally this means that group, dataset, attribute, file and named datatype IDs should be modified by all the processes and that all other types of IDs are safe to modify by individual processes.
This function is of particular value when an application is maintaining multiple copies of an object ID. The object ID can be incremented when a copy is made. Each copy of the ID can then be safely closed or decremented and the HDF5 object will be closed when the reference count for that that object drops to zero.
Returns a non-negative reference count of the object ID after incrementing it if successful; otherwise a negative value is returned.
|1.6.2||Function introduced in this release.|
Fortran subroutine introduced in this release.
--- Last Modified: April 25, 2019 | 12:13 PM