ddn.data.hdf5.datatype

HDF5 Datatype Wrapper

This module provides a D wrapper for HDF5 datatype operations with RAII semantics for automatic resource management.

License

BSD-3-Clause
struct Datatype

Types 1

structDatatype

RAII wrapper for HDF5 datatype handles.

This struct manages an HDF5 datatype handle and automatically closes it when the struct goes out of scope. Copy is disabled to prevent double-close issues; use dup() for explicit copying.

Example:

// Get a native integer type
auto intType = Datatype.nativeInt();

// Create a compound type
auto compType = Datatype.createCompound(16);

Fields
private hid_t _id
private bool _owned
Methods
Datatype nativeSChar()Creates a native signed char datatype.
Datatype nativeUChar()Creates a native unsigned char datatype.
Datatype nativeShort()Creates a native short datatype.
Datatype nativeUShort()Creates a native unsigned short datatype.
Datatype nativeInt()Creates a native int datatype.
Datatype nativeUInt()Creates a native unsigned int datatype.
Datatype nativeLong()Creates a native long datatype.
Datatype nativeULong()Creates a native unsigned long datatype.
Datatype nativeFloat()Creates a native float datatype.
Datatype nativeDouble()Creates a native double datatype.
Datatype createCompound(size_t size)Creates a compound datatype.
Datatype createArray(ref Datatype baseType, const hsize_t[] dims)Creates an array datatype.
Datatype createVlen(ref Datatype baseType)Creates a variable-length datatype.
Datatype move(ref Datatype other)Moves ownership from another Datatype instance.
Datatype dup()Creates a duplicate of this datatype.
void close()Explicitly closes the datatype handle.
hid_t handle() const @nogc nothrow @safeReturns the underlying HDF5 datatype handle.
bool isValid() const @nogc nothrow @safeChecks if the datatype handle is valid.
H5T_class_t typeClass()Gets the class of the datatype.
size_t size()Gets the size of the datatype in bytes.
void insertMember(string name, size_t offset, ref Datatype memberType)Inserts a member into a compound datatype.
void pack()Packs a compound datatype to minimize storage.
int numMembers()Gets the number of members in a compound datatype.
void setSize(size_t newSize)Sets the size of the datatype.
private Datatype copyNative(hid_t nativeType)
Destructors
~thisDestructor that automatically closes the datatype handle.