Name: H5Fget_obj_count
Last modified: 5 November 2009
Signature:
ssize_t H5Fget_obj_count( hid_t file_id, unsigned int types )

Purpose:
Returns the number of open object identifiers for an open file.

Description:
Given the identifier of an open file, file_id, and the desired object types, types, H5Fget_obj_count returns the number of open object identifiers for the file.

To retrieve a count of open identifiers for open objects in all HDF5 application files that are currently open, pass the value H5F_OBJ_ALL in file_id.

The types of objects to be counted are specified in types as follows:

H5F_OBJ_FILE Files only
H5F_OBJ_DATASET Datasets only
H5F_OBJ_GROUP Groups only
H5F_OBJ_DATATYPE   Named datatypes only
H5F_OBJ_ATTR   Attributes only
H5F_OBJ_ALL All of the above
(That is, H5F_OBJ_FILE | H5F_OBJ_DATASET | H5F_OBJ_GROUP | H5F_OBJ_DATATYPE | H5F_OBJ_ATTR)
H5F_OBJ_LOCAL Restrict search to objects opened through current file identifier.
Note: H5F_OBJ_LOCAL does not stand alone; it is effective only when used in combination with one or more of the preceding types. For example,
    H5F_OBJ_DATASET | H5F_OBJ_GROUP | H5F_OBJ_LOCAL
would count all datasets and groups opened through the current file identifier.

Multiple object types can be combined with the logical OR operator (|). For example, the expression (H5F_OBJ_DATASET|H5F_OBJ_GROUP) would call for datasets and groups.

Parameters:

Returns:
Returns the number of open objects if successful; otherwise returns a negative value.

Fortran90 Interface: h5fget_obj_count_f
SUBROUTINE h5fget_obj_count_f(file_id, obj_type, obj_count, hdferr)

  IMPLICIT NONE 
  INTEGER(HID_T), INTENT(IN)  :: file_id    ! File identifier
  INTEGER, INTENT(IN)         :: obj_type   ! Object types, possible values are:
                                            !     H5F_OBJ_FILE_F
                                            !     H5F_OBJ_GROUP_F
                                            !     H5F_OBJ_DATASET_F
                                            !     H5F_OBJ_DATATYPE_F
                                            !     H5F_OBJ_ALL_F
  INTEGER(SIZE_T), INTENT(OUT) :: obj_count ! Number of opened objects
  INTEGER, INTENT(OUT)        :: hdferr     ! Error code 
                                            ! 0 on success and -1 on failure
END SUBROUTINE h5fget_obj_count_f
    

History: