HDF5  1.13.0
General Property List Operations (Advanced)

Functions

herr_t H5Pclose_class (hid_t plist_id)
 Closes an existing property list class. More...
 
herr_t H5Pcopy_prop (hid_t dst_id, hid_t src_id, const char *name)
 Copies a property from one list or class to another. More...
 
hid_t H5Pcreate_class (hid_t parent, const char *name, H5P_cls_create_func_t cls_create, void *create_data, H5P_cls_copy_func_t cls_copy, void *copy_data, H5P_cls_close_func_t cls_close, void *close_data)
 Creates a new property list class. More...
 

Detailed Description

Function Documentation

◆ H5Pclose_class()

herr_t H5Pclose_class ( hid_t  plist_id)

Closes an existing property list class.

Parameters
[in]classProperty list identifier
Returns
Returns a non-negative value if successful; otherwise returns a negative value.

H5Pclose_class() removes a property list class from the library. Existing property lists of this class will continue to exist, but new ones are not able to be created.

Since
1.4.0

◆ H5Pcopy_prop()

herr_t H5Pcopy_prop ( hid_t  dst_id,
hid_t  src_id,
const char *  name 
)

Copies a property from one list or class to another.

Parameters
[in]dst_idProperty list identifier
[in]src_idProperty list identifier
[in]nameName of the property to copy
Returns
Returns a non-negative value if successful; otherwise returns a negative value.

H5Pcopy_prop() copies a property from one property list or class to another.

If a property is copied from one class to another, all the property information will be first deleted from the destination class and then the property information will be copied from the source class into the destination class.

If a property is copied from one list to another, the property will be first deleted from the destination list (generating a call to the close callback for the property, if one exists) and then the property is copied from the source list to the destination list (generating a call to the copy callback for the property, if one exists).

If the property does not exist in the class or list, this call is equivalent to calling H5Pregister() or H5Pinsert() (for a class or list, as appropriate) and the create callback will be called in the case of the property being copied into a list (if such a callback exists for the property).

Since
1.6.0

◆ H5Pcreate_class()

hid_t H5Pcreate_class ( hid_t  parent,
const char *  name,
H5P_cls_create_func_t  cls_create,
void *  create_data,
H5P_cls_copy_func_t  cls_copy,
void *  copy_data,
H5P_cls_close_func_t  cls_close,
void *  close_data 
)

Creates a new property list class.

Parameters
[in]parentProperty list identifier
[in]nameName of property list class to register
[in]createCallback routine called when a property list is created
[in]create_dataPointer to user-defined class create data, to be passed along to class create callback
[in]copyCallback routine called when a property list is copied
[in]copy_dataPointer to user-defined class copy data, to be passed along to class copy callback
[in]closeCallback routine called when a property list is being closed
[in]close_dataPointer to user-defined class close data, to be passed along to class close callback
Returns
Returns an property list class identifier if successful; otherwise returns a negative value.

H5Pcreate_class() registers a new property list class with the library. The new property list class can inherit from an existing property list class, parent, 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 H5Pcreate(). 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.

H5Pclose_class() can be used to release the property list class identifier returned by this function so that resources leaks will not develop.

Since
1.4.0
H5P_cls_close_func_t
herr_t(* H5P_cls_close_func_t)(hid_t prop_id, void *close_data)
Definition: H5Ppublic.h:119
H5P_cls_create_func_t
herr_t(* H5P_cls_create_func_t)(hid_t prop_id, void *create_data)
Definition: H5Ppublic.h:116
H5P_cls_copy_func_t
herr_t(* H5P_cls_copy_func_t)(hid_t new_prop_id, hid_t old_prop_id, void *copy_data)
Definition: H5Ppublic.h:117
herr_t
int herr_t
Definition: H5public.h:128