Class dspace#

Class Documentation#

class dspace#

Helper for reading and writing dataset attributes in HDF5 files.

This lightweight wrapper exposes attribute read/write operations bound to an existing H5::DataSet instance.

Public Functions

inline explicit dspace(const H5::DataSet &datasetx)#

Construct a dataset wrapper around an existing HDF5 dataset.

Parameters:

datasetx – Underlying HDF5 dataset object.

template<typename T>
inline void write_atr(const T &data, const H5std_string &dataname)#

Write a scalar attribute to the wrapped dataset.

Template Parameters:

T – Type of the metadata value.

Parameters:
  • data – Scalar value to store as an attribute.

  • dataname – Name of the attribute.

template<typename T>
inline void read_atr(T &data, const H5std_string &dataname)#

Read a scalar attribute from the wrapped dataset.

Template Parameters:

T – Type of the metadata value.

Parameters:
  • data – Value to populate from the attribute.

  • dataname – Name of the attribute.

Public Members

H5::DataSet dataset#

Wrapped HDF5 dataset used for attribute access.