H5Tget_native_type
(
hid_t dtype_id
,
H5T_direction_t direction
)
H5Tget_native_type
returns the equivalent native datatype
for the datatype specified in dtype_id
.
H5Tget_native_type
is a high-level function designed
primarily to facilitate use of the H5Dread
function,
for which users otherwise must undertake a multi-step process to
determine the native datatype of a dataset prior to reading it
into memory.
It can be used not only to determine
the native datatype for atomic datatypes,
but also to determine the native datatypes of the individual components
of a compound datatype, an enumerated datatype, an array datatype, or
a variable-length datatype.
For example, if dtype_id
is a compound datatype,
the returned datatype identifier will be for
a similar compound datatype with
each element converted to the corresponding native datatype.
H5Tget_native_type
selects the matching native datatype
from the following list:
H5T_NATIVE_CHAR H5T_NATIVE_SHORT H5T_NATIVE_INT H5T_NATIVE_LONG H5T_NATIVE_LLONG H5T_NATIVE_UCHAR H5T_NATIVE_USHORT H5T_NATIVE_UINT H5T_NATIVE_ULONG H5T_NATIVE_ULLONG H5T_NATIVE_FLOAT H5T_NATIVE_DOUBLE H5T_NATIVE_LDOUBLE
The direction
parameter indicates the order
in which the library searches for a native datatype match.
Valid values for direction
are as follows:
H5T_DIR_ASCEND |
Searches the above list in ascending size of the datatype, i.e., from top to bottom. (Default) | |
H5T_DIR_DESCEND |
Searches the above list in descending size of the datatype, i.e., from bottom to top. |
H5Tget_native_type
is designed primarily for
use with integer and floating point datatypes.
String, time, bitfield, opaque, and reference datatypes are returned
as a copy of dtype_id
.
The identifier returned by H5Tget_native_type
should eventually be closed by calling H5Tclose
to release resources.
hid_t dtype_id |
Datatype identifier for the dataset datatype. |
H5T_direction_t direction |
Direction of search. |
SUBROUTINE h5tget_native_type_f(dtype_id, direction, native_dtype_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: dtype_id ! Datatype identifier INTEGER, INTENT(IN) :: direction ! Direction of search: ! H5T_DIR_ASCEND_F = 1 in inscendent order ! H5T_DIR_DESCEND_F= 2 in descendent order INTEGER(HID_T), INTENT(OUT) :: native_dtype_id ! The native datatype identifier INTEGER, INTENT(OUT) :: hdferr ! Error code: ! 0 on success and -1 on failure END SUBROUTINE h5tget_native_type_f
Release | C |
1.6.0 | Function introduced in this release. |