ddn.data.hdf5.packet_table

HDF5 Packet Table Wrapper

This module provides a D wrapper for HDF5 Packet Table operations with RAII semantics for automatic resource management. Packet tables are optimized for appending and reading packets of fixed-size data.

License

BSD-3-Clause

Types 1

RAII wrapper for HDF5 Packet Table handles.

This struct manages an HDF5 packet table handle and automatically closes it when the struct goes out of scope. Copy is disabled to prevent double-close issues; use move() for transferring ownership.

Packet tables are optimized for appending fixed-size records and reading them back efficiently.

Example:

// Create a packet table for integers
auto pt = PacketTable.create(file.handle(), "mydata", H5T_NATIVE_INT, 100);

// Append some data
int[5] data = [1, 2, 3, 4, 5];
pt.append(data);

// Read data back
int[5] readData;
pt.read(0, readData);

Fields
private hid_t _id
Methods
PacketTable create(hid_t locId, string name, hid_t dtypeId, hsize_t chunkSize = 100, hid_t plistId = H5P_DEFAULT)Creates a new packet table.
PacketTable open(hid_t locId, string name)Opens an existing packet table.
PacketTable move(ref PacketTable other)Moves ownership from another PacketTable instance.
void append(T)(const T[] data)Appends packets to the packet table.
void append(T)(const ref T packet)Appends a single packet to the packet table.
void read(T)(hsize_t start, T[] data)Reads packets from the packet table starting at a specific index.
T[] readAll(T)()Reads all packets from the packet table.
void getNext(T)(T[] data)Reads the next packets from the current index position.
hsize_t getNumPackets()Gets the number of packets in the packet table.
bool isVarlen()Checks if the packet table uses a variable-length datatype.
hid_t getType()Gets the datatype used by the packet table.
void resetIndex()Resets the packet table index to the first packet.
void setIndex(hsize_t index)Sets the packet table index to a specific position.
hsize_t getIndex()Gets the current packet table index position.
void close()Closes the packet table handle.
hid_t handle() constReturns the underlying HDF5 packet table handle.
bool isValid() constChecks if this packet table holds a valid handle.
Destructors
~thisDestructor that automatically closes the packet table handle.