ddn.data.hdf5.dataspace

HDF5 Dataspace Wrapper

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

License

BSD-3-Clause
struct Dataspace

Types 1

structDataspace

RAII wrapper for HDF5 dataspace handles.

This struct manages an HDF5 dataspace 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:

// Create a scalar dataspace
auto scalar = Dataspace.createScalar();

// Create a simple 2D dataspace
auto simple = Dataspace.createSimple([100, 200]);

Fields
private hid_t _id
Methods
Dataspace createScalar()Creates a scalar (singleton) dataspace.
Dataspace createSimple(const hsize_t[] dims, const hsize_t[] maxDims = null)Creates a simple (regular grid) dataspace.
Dataspace createNull()Creates a null (empty) dataspace.
Dataspace move(ref Dataspace other)Moves ownership from another Dataspace instance.
Dataspace dup()Creates a duplicate of this dataspace.
void close()Explicitly closes the dataspace handle.
hid_t handle() const @nogc nothrow @safeReturns the underlying HDF5 dataspace handle.
bool isValid() const @nogc nothrow @safeChecks if the dataspace handle is valid.
int ndims()Gets the number of dimensions in the dataspace.
hsize_t[] dims()Gets the dimension sizes of the dataspace.
hsize_t[] maxDims()Gets the maximum dimension sizes of the dataspace.
hssize_t npoints()Gets the total number of elements in the dataspace.
void selectHyperslab(const hsize_t[] start, const hsize_t[] count, const hsize_t[] stride = null, const hsize_t[] block = null, SelectionOp op = SelectionOp.set)Selects a hyperslab region in the dataspace.
void selectAll()Selects all elements in the dataspace.
void selectNone()Deselects all elements in the dataspace (selects none).
Destructors
~thisDestructor that automatically closes the dataspace handle.