H5Idec_ref
(
hid_t obj_id
)
H5Idec_ref
decrements the reference count of the object
identified by obj_id
.
The reference count for an object identifier 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 H5Iinc_ref
.
When an object identifier’s reference count reaches zero,
the object will be closed.
Calling an object identifier’s close
function decrements the reference count
for the identifier which normally closes the object, but
if the reference count for the identifier has been incremented with
H5Iinc_ref
, the object will only be closed when the
reference count
reaches zero with further calls to this function or the
object identifier’s close
function.
If the object identifier was created by a collective parallel call
(such as H5Dcreate
, H5Gopen
, etc.),
the reference count should be modified by all the processes which
have copies of the identifier. Generally this means that
group, dataset, attribute, file, and committed datatype identifiers
should be modified by all the processes and that all other
types of identifiers are safe to modify by individual processes.
This function is of particular value when an application is maintaining multiple copies of an object identifier. The object identifier can be incremented when a copy is made. Each copy of the identifier 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.
hid_t obj_id |
IN: Object identifier whose reference count will be modified. |
SUBROUTINE h5idec_ref_f(obj_id, ref_count, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: obj_id !Object identifier INTEGER, INTENT(OUT) :: ref_count !Reference count of object identifier INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success, and -1 on failure END SUBROUTINE h5idec_ref_f
Release | C |
1.6.2 |
Function introduced in this release. Fortran subroutine introduced in this release. |