H5Tconvert H5T_CONVERT converts nelmts elements from a source datatype, specified by src_type_id , to a destination datatype, dest_type_id . The source elements are packed in buf and on return the destination elements will be packed in buf . That is, the conversion is performed in place.
The optional background buffer is for use with compound datatypes. It is an array of nelmts values for the destination datatype which can then be merged with the converted values to recreate the compound datatype. For instance, background might be an array of structs with the a and b fields already initialized and the conversion of buf supplies the c and d field values. The parameter plist_id contains the dataset transfer property list identifier which is passed to the conversion functions. As of Release 1.2, this parameter is only used to pass along the variable-length datatype custom allocation information. Note |
---|
Programming Note for C++ Developers Using C Functions: 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 H5P_elinkSET_cbELINK_CB and H5Pset H5P_typeSET_convTYPE_cbCONV_CB and functions such as H5T_CONVERT H5Tconvert and H5Ewalk2 and H5E_WALK2. Exiting the routine in its normal fashion allows the HDF5 C Library 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. |
|