Documentation Center

  • Trials
  • Product Updates

H5T.get_class

Data type class identifier

Syntax

class_id = H5T.get_class(type_id)

Description

class_id = H5T.get_class(type_id) returns the data type class identifier of the data type specified by type_id.

Valid class identifiers include:

H5T_INTEGER
H5T_FLOAT
H5T_STRING
H5T_BITFIELD
H5T_OPAQUE
H5T_COMPOUND
H5T_ENUM
H5T_VLEN
H5T_ARRAY

Examples

fid = H5F.open('example.h5');
dset_id = H5D.open(fid,'/g3/enum');
type_id = H5D.get_type(dset_id);
class_id = H5T.get_class(type_id);
switch(class_id)
    case H5ML.get_constant_value('H5T_INTEGER')
        fprintf('Integer\n');
    case H5ML.get_constant_value('H5T_FLOAT')
        fprintf('Floating point\n');
    case H5ML.get_constant_value('H5T_STRING')
        fprintf('String\n');
    case H5ML.get_constant_value('H5T_BITFIELD')
        fprintf('Bitfield\n');
    case H5ML.get_constant_value('H5T_OPAQUE')
        fprintf('Opaque\n');
    case H5ML.get_constant_value('H5T_COMPOUND')
        fprintf('Compound'\n');
    case H5ML.get_constant_value('H5T_ENUM')
        fprintf('Enumerated\n');
    case H5ML.get_constant_value('H5T_VLEN')
        fprintf('Variable length\n');
    case H5ML.get_constant_value('H5T_ARRAY')
        fprintf('Array\n');
end

See Also

Was this topic helpful?