H5Iregister_type
(
size_t hash_size
,
unsigned reserved
,
H5I_free_t free_func
)
H5Iregister_type
allocates space for a new ID type and
returns an identifier for it.
The hash_size
parameter indicates the minimum size
of the hash table used to store IDs in the new type.
The reserved
parameter indicates the number
of IDs in this new type to be reserved.
Reserved IDs are valid IDs which are not associated with
any storage within the library.
The free_func
parameter is a function pointer
to a function which returns an herr_t and
accepts a void *.
The purpose of this function is to deallocate memory
for a single ID.
It will be called by H5Iclear_type
and H5Idestroy_type
on each ID.
This function is NOT called by H5Iremove_verify
.
The void * will be the same pointer which was passed
in to the H5Iregister
function.
The free_func
function should
return 0 on success and -1 on failure.
If a C routine that takes a function pointer as an argument is called from within C++ code, the C routine should be returned from normally.
Examples of this kind of routine include callbacks such as
H5Pset_elink_cb
and H5Pset_type_conv_cb
and functions such as H5Tconvert
and
H5Ewalk2
.
Exiting the routine in its normal fashion allows the HDF5 C Library to clean up its work properly. In other words, if the C++ application jumps out of the routine back to the C++ “catch” statement, the library is not given the opportunity to close any temporary data structures that were set up when the routine was called. The C++ application should save some state as the routine is started so that any problem that occurs might be diagnosed.
size_t hash_size |
IN: Size of the hash table (in entries) used to store IDs for the new type |
unsigned reserved |
IN: Number of reserved IDs for the new type |
H5I_free_t free_func |
IN: Function used to deallocate space for a single ID |