- Created by Barbara Jones, last modified on Jul 22, 2019
H5P_CREATE_CLASS
Creates a new property list class
Procedure:
H5P_CREATE_CLASS ( parent_class, name, create, create_data, copy, copy_data, close, close_data )
Signature:
hid_t H5Pcreate_class(
hid_t parent_class,
const char *name,
H5P_cls_create_func_t create,
void *create_data,
H5P_cls_copy_func_t copy,
void *copy_data,
H5P_cls_close_func_t close,
void *close_data
)
Fortran90 Interface: h5pcreate_class_f
SUBROUTINE h5pcreate_class_f(parent, name, class, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: parent ! Parent property list class
! identifier
! Possible values include:
! H5P_NO_CLASS_F
! H5P_FILE_CREATE_F
! H5P_FILE_ACCESS_F
! H5P_DATASET_CREATE_F
! H5P_DATASET_XFER_F
! H5P_FILE_MOUNT_F
CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to create
INTEGER(HID_T), INTENT(OUT) :: class ! Property list class identifier
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success and -1 on failure
END SUBROUTINE h5pcreate_class_f
Fortran2003 Interface: h5pcreate_class_f
Signature:
SUBROUTINE h5pcreate_class_f(parent, name, class, hdferr, create, &
create_data, copy, copy_data, close, close_data)
INTEGER(HID_T) , INTENT(IN) :: parent
CHARACTER(LEN=*), INTENT(IN) :: name
INTEGER(HID_T) , INTENT(OUT) :: class
INTEGER , INTENT(OUT) :: hdferr
TYPE(C_PTR) , OPTIONAL :: create_data, copy_data, close_data
TYPE(C_FUNPTR) , OPTIONAL :: create, copy, close
Inputs:
parent - Parent property list class identifier
Possible values include:
H5P_ROOT_F
H5P_FILE_CREATE_F
H5P_FILE_ACCESS_F
H5P_DATASET_CREATE_F
H5P_DATASET_XFER_F
H5P_FILE_MOUNT_F
name - Name of property to create
Outputs:
class - Property list class identifier
hdferr - Returns 0 if successful and -1 if fails
Optional parameters:
H5P_cls_create_func_t (create) - Callback routine called when a
property list is created
create_data - User pointer to any class creation
information needed
H5P_cls_copy_func_t (copy) - Callback routine called when a property
list is copied
copy_data - User pointer to any class copy
information needed
H5P_cls_close_func_t (close) - Callback routine called when a property
list is being closed
close_data - User pointer to any class close
information needed
Parameters:
hid_t parent_class | IN: Property list class to inherit from or NULL |
const char *name | IN: Name of property list class to register |
H5P_cls_create_func_t create | IN: Callback routine called when a property list is created |
void *create_data | IN: Pointer to user-defined class create data, to be passed along to class create callback |
H5P_cls_copy_func_t copy | IN: Callback routine called when a property list is copied |
void *copy_data | IN: Pointer to user-defined class copy data, to be passed along to class copy callback |
H5P_cls_close_func_t close | IN: Callback routine called when a property list is being closed |
void *close_data | IN: Pointer to user-defined class close data, to be passed along to class close callback |
Description:
H5P_CREATE_CLASS registers a new property list class with the library. The new property list class can inherit from an existing property list class, parent_class
, or may be derived from the default “empty” class, NULL
. New classes with inherited properties from existing classes may not remove those existing properties, only add or remove their own class properties. Property list classes defined and supported in the HDF5 library distribution are listed and briefly described in H5P_CREATE. The create
routine is called when a new property list of this class is being created. The H5P_cls_create_func_t
callback function is defined as follows:
typedef herr_t(*H5P_cls_create_func_t
)(hid_tprop_id
,void *create_data
);
The parameters to this callback function are defined as follows:
hid_t prop_id | IN: The identifier of the property list being created |
void * create_data | IN: User pointer to any class creation data required |
The create
routine is called after any registered create
function is called for each property value. If the create
routine returns a negative value, the new list is not returned to the user and the property list creation routine returns an error value. The copy
routine is called when an existing property list of this class is copied. The H5P_cls_copy_func_t
callback function is defined as follows:
typedef herr_t(*H5P_cls_copy_func_t
)(hid_tprop_id
,void *copy_data
);
The parameters to this callback function are defined as follows:
hid_t prop_id | IN: The identifier of the property list created by copying |
void * copy_data | IN: User pointer to any class copy data required |
The copy
routine is called after any registered copy
function is called for each property value. If the copy
routine returns a negative value, the new list is not returned to the user and the property list copy routine returns an error value. The close
routine is called when a property list of this class is being closed. The H5P_cls_close_func_t
callback function is defined as follows:
typedef herr_t(*H5P_cls_close_func_t
)(hid_tprop_i
,void *close_data
);
The parameters to this callback function are defined as follows:
hid_t prop_id | IN: The identifier of the property list being closed |
void * close_data | IN: User pointer to any class close data required |
The close
routine is called before any registered close
function is called for each property value. If the close
routine returns a negative value, the property list close routine returns an error value but the property list is still closed.
Returns:
On success, returns a valid property list class identifier; otherwise returns a negative value.
H5P_CLOSE_CLASS can be used to release the property list class identifier returned by this function so that resources leaks will not develop.
Example:
Coming Soon!
History:
Release | Change |
---|---|
1.8.8 | Fortran updated to Fortran2003. |
--- Last Modified: July 22, 2019 | 09:58 AM