Please, help us to better serve our user community by answering the following short survey: https://www.hdfgroup.org/website-survey/
HDF5  1.14.4.3
API Reference
 
Loading...
Searching...
No Matches

Detailed Description

Functions

herr_t H5Tinsert (hid_t parent_id, const char *name, size_t offset, hid_t member_id)
 Adds a new member to a compound datatype.
 
herr_t H5Tpack (hid_t type_id)
 Recursively removes padding from within a compound datatype.
 
size_t H5Tget_member_offset (hid_t type_id, unsigned membno)
 Retrieves the offset of a field of a compound datatype.
 
H5T_class_t H5Tget_member_class (hid_t type_id, unsigned membno)
 Returns datatype class of compound datatype member.
 
hid_t H5Tget_member_type (hid_t type_id, unsigned membno)
 Returns the datatype of the specified member.
 

Function Documentation

◆ H5Tget_member_class()

H5T_class_t H5Tget_member_class ( hid_t  type_id,
unsigned  membno 
)

Returns datatype class of compound datatype member.

Parameters
[in]type_idDatatype identifier
[in]membnoZero-based index of the field or element
Returns
Returns the datatype class, a non-negative value, if successful; otherwise returns a negative value.

Given a compound datatype, dtype_id, H5Tget_member_class() returns the datatype class of the member specified by member_no.

Valid class identifiers, as defined in H5Tpublic.h, are:

typedef enum H5T_class_t {
H5T_NO_CLASS = -1,
H5T_FLOAT = 1,
H5T_TIME = 2,
H5T_STRING = 3,
H5T_OPAQUE = 5,
H5T_ENUM = 8,
H5T_VLEN = 9,
H5T_ARRAY = 10,
H5T_class_t
Definition H5Tpublic.h:30
@ H5T_STRING
Definition H5Tpublic.h:35
@ H5T_FLOAT
Definition H5Tpublic.h:33
@ H5T_ARRAY
Definition H5Tpublic.h:42
@ H5T_REFERENCE
Definition H5Tpublic.h:39
@ H5T_ENUM
Definition H5Tpublic.h:40
@ H5T_COMPOUND
Definition H5Tpublic.h:38
@ H5T_NO_CLASS
Definition H5Tpublic.h:31
@ H5T_TIME
Definition H5Tpublic.h:34
@ H5T_NCLASSES
Definition H5Tpublic.h:44
@ H5T_BITFIELD
Definition H5Tpublic.h:36
@ H5T_OPAQUE
Definition H5Tpublic.h:37
@ H5T_INTEGER
Definition H5Tpublic.h:32
@ H5T_VLEN
Definition H5Tpublic.h:41
Since
1.4.0

◆ H5Tget_member_offset()

size_t H5Tget_member_offset ( hid_t  type_id,
unsigned  membno 
)

Retrieves the offset of a field of a compound datatype.

Parameters
[in]type_idDatatype identifier
[in]membnoZero-based index of the field or element
Returns
Returns the byte offset of the field if successful; otherwise returns 0 (zero).

H5Tget_member_offset() retrieves the byte offset of the beginning of a field within a compound datatype with respect to the beginning of the compound datatype datum.

Note that zero is a valid offset and that this function will fail only if a call to H5Tget_member_class() fails with the same arguments.

Version
1.6.4 member_no parameter type changed to unsigned.
Since
1.0.0

◆ H5Tget_member_type()

hid_t H5Tget_member_type ( hid_t  type_id,
unsigned  membno 
)

Returns the datatype of the specified member.

Parameters
[in]type_idDatatype identifier
[in]membnoZero-based index of the field or element
Returns
Returns the identifier of a copy of the datatype of the field if successful; otherwise returns a negative value.

H5Tget_member_type() returns the datatype of the specified member. The caller should invoke H5Tclose() to release resources associated with the type.

Version
1.6.4 membno parameter type changed to unsigned.
Since
1.0.0

◆ H5Tinsert()

herr_t H5Tinsert ( hid_t  parent_id,
const char *  name,
size_t  offset,
hid_t  member_id 
)

Adds a new member to a compound datatype.

Parameters
[in]parent_idDatatype identifier
[in]nameName of the field to insert
[in]offsetOffset in memory structure of the field to insert
[in]member_idDatatype identifier of the field to insert
Returns
Returns a non-negative value if successful; otherwise, returns a negative value.

H5Tinsert() adds another member to the compound datatype, specified type_id.

The new member has a name which must be unique within the compound datatype. The offset argument defines the start of the member in an instance of the compound datatype, and member_id is the datatype identifier of the new member.

Note
Members of a compound datatype do not have to be atomic datatypes; a compound datatype can have a member which is a compound datatype.
Since
1.0.0

◆ H5Tpack()

herr_t H5Tpack ( hid_t  type_id)

Recursively removes padding from within a compound datatype.

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

H5Tpack() recursively removes padding from within a compound datatype to make it more efficient (space-wise) to store that data.

Since
1.0.0