Last modified: 15 June 2009
Name: H5Iget_type
Signature:
  H5I_type_t `H5Iget_type`( hid_t `obj_id` )

Purpose:
  Retrieves the type of an object.

Description:
  `H5Iget_type` retrieves the type of the object identified by `obj_id`.

  Valid types returned by the function are

  `H5I_FILE` | File
  `H5I_GROUP` | Group
  `H5I_DATATYPE` | Datatype
  `H5I_DATASPACE` | Dataspace
  `H5I_DATASET` | Dataset
  `H5I_ATTR` | Attribute

  If no valid type can be determined or the identifier submitted is invalid, the function returns

  `H5I_BADID` | Invalid identifier

  This function is of particular value in determining the type of object closing function (`H5Dclose`, `H5Gclose`, etc.) to call after a call to `H5Rdereference`.

  Note that this function returns only the type of object that `obj_id` would identify if it were valid; it does not determine whether `obj_id` is valid identifier. Validity can be determined with a call to `H5Iis_valid`.

Parameters:

  hid_t `obj_id` | IN: Object identifier whose type is to be determined.

Returns:
  Returns the object type if successful; otherwise `H5I_BADID`.

See Also:
  - `H5Iis_valid`

Fortran90 Interface: h5iget_type_f

      SUBROUTINE h5iget_type_f(obj_id, type, hdferr)
        IMPLICIT NONE
        INTEGER(HID_T), INTENT(IN) :: obj_id  !Object identifier
        INTEGER, INTENT(OUT) :: type          !type of an object.
                                              !possible values are:
                                              !H5I_FILE_F
                                              !H5I_GROUP_F
                                              !H5I_DATATYPE_F
                                              !H5I_DATASPACE_F
                                              !H5I_DATASET_F
                                              !H5I_ATTR_F
                                              !H5I_BADID_F
        INTEGER, INTENT(OUT) :: hdferr        ! E rror code
                                              ! 0 on success, and -1 on failure
      END SUBROUTINE h5iget_type_f