Page tree

 

JAVA

FORTRAN

C++

C

 

Link

H5R_DEREFERENCE2

Opens the HDF5 object referenced

Procedure:

H5R_DEREFERENCE2 ( obj_id, oapl_id, ref_type, ref )

Signature:

hid_t H5Rdereference2(
        hid_t obj_id,
        hid_t oapl_id,
        H5R_type_t ref_type,
        void *ref
    )

Fortran90 Interface: h5rdereference_f

To dereference an object: 

Signature:
  SUBROUTINE h5rdereference_f(obj_id, ref, ref_obj_id, hdferr) 
    INTEGER(HID_T)    , INTENT(IN)  :: obj_id
    TYPE(hobj_ref_t_f), INTENT(IN)  :: ref
    INTEGER(HID_T)    , INTENT(OUT) :: ref_obj_id
    INTEGER           , INTENT(OUT) :: hdferr

Inputs:
  obj_id      - Valid identifier in file
  ref         - Object reference

Outputs:
  ref_obj_id  - Identifier of referenced object 
  hdferr      - Error code 
                 0 on success and -1 on failure 


To dereference a region:	
 
Signature:
  SUBROUTINE h5rdereference_f(obj_id, ref, ref_obj_id, hdferr)
    INTEGER(HID_T)         , INTENT(IN)  :: obj_id
    TYPE(hdset_reg_ref_t_f), INTENT(IN)  :: ref
    INTEGER(HID_T)         , INTENT(OUT) :: ref_obj_id
    INTEGER                , INTENT(OUT) :: hdferr 

Inputs:
  dset_id       - Valid identifier in file
  ref           - Object reference

Outputs:
  ref_obj_id    - Identifier of referenced object
  hdferr        - Error code 
                   0 on success and -1 on failure


Fortran2003 Interface: h5rdereference_f

Signature:
  SUBROUTINE h5rdereference_f(obj_id, ref_type, ref, ref_obj_id, hdferr)
    INTEGER(HID_T), INTENT(IN)  :: obj_id
    INTEGER       , INTENT(IN)  :: ref_type
    TYPE(C_PTR)   , INTENT(IN)  :: ref
    INTEGER(HID_T), INTENT(OUT) :: ref_obj_id
    INTEGER       , INTENT(OUT) :: hdferr

Inputs:
  obj_id     - Valid identifier for the file containing the
               referenced object or any object in that file.
  ref_type   - The reference type of ref.
  ref        - Object reference

Outputs:
  ref_obj_id - Identifier of referenced object
  hdferr     - Error code 
                0 on success and -1 on failure

Parameters:
hid_t obj_idIN: Valid identifier for the file containing the referenced object or any object in that file
hid_t oapl_idIN: Valid object access property list identifier for a property list to be used with the referenced object
H5R_type_t ref_type    IN: The reference type of ref
void *refIN: Reference to open

Description:

Given a reference, ref, to an object or a region in an object, H5R_DEREFERENCE2 opens that object and returns an identifier.

The parameter obj_id must be a valid identifier for the HDF5 file containing the referenced object or for any object in that HDF5 file.

The parameter oapl_id is an object access property list identifier for the referenced object. The access property list must be of the same type as the object being referenced, that is a group, dataset, or datatype property list.

The parameter ref_type specifies the reference type of the reference ref. ref_type may contain either of the following values:

  • H5R_OBJECT (0)
  • H5R_DATASET_REGION (1)

The object opened with this function should be closed when it is no longer needed so that resource leaks will not develop. Use the appropriate close function such as H5O_CLOSE or H5D_CLOSE for datasets.

Returns:

Returns identifier of referenced object if successful; otherwise returns a negative value.

Example:

        /*
         * Open the referenced object, get its name and type.
         */
        obj = H5Rdereference (dset, H5P_DEFAULT, H5R_OBJECT, &rdata[i]);
        status = H5Rget_obj_type (dset, H5R_OBJECT, &rdata[i], &objtype);

     f_ptr = C_LOC(rdata(i))
     CALL H5Rdereference_f(dset, H5R_OBJECT_F, f_ptr, obj, hdferr)
     CALL H5Rget_obj_type_f(dset, H5R_OBJECT_F, f_ptr, objtype, hdferr)
     !

History:
Release    Change
1.10.0C function H5Rdereference2 introduced in this release.

--- Last Modified: September 13, 2018 | 12:45 PM