Page tree

 

JAVA

FORTRAN

C++

C

 

Link

H5F_GET_OBJ_COUNT

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

Procedure:

H5F_GET_OBJ_COUNT(file_id, types)

Signature:

ssize_t H5Fget_obj_count( hid_t file_id, unsigned int types )

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

Parameters:
hid_t file_idIN: Identifier of a currently-open HDF5 file or H5F_OBJ_ALL for all currently-open HDF5 files.
unsigned int types    IN: Type of object for which identifiers are to be returned.

Description:

Given the identifier of an open file, file_id, and the desired object types, typesH5Fget_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 (hid_t)H5F_OBJ_ALL (FortranINT(H5F_OBJ_ALL_F,HID_T)) in file_id.

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

H5F_OBJ_FILEFiles only
H5F_OBJ_DATASETDatasets only
H5F_OBJ_GROUPGroups only
H5F_OBJ_DATATYPE  Named datatypes only
H5F_OBJ_ATTR  Attributes only
H5F_OBJ_ALLAll of the above 
(That is, H5F_OBJ_FILE | H5F_OBJ_DATASET | H5F_OBJ_GROUP | H5F_OBJ_DATATYPE | H5F_OBJ_ATTR)
H5F_OBJ_LOCALRestrict 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.

Returns:

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

Example:

Coming soon!

History:
Release    Change
1.6.5H5F_OBJ_LOCAL has been added as a qualifier on the types of objects to be counted. H5F_OBJ_LOCAL restricts the search to objects opened through current file identifier.
1.6.8 and 1.8.2  C function return type changed to ssize_t.

--- Last Modified: December 04, 2017 | 06:23 AM