Gromacs  2026.0-dev-20251119-5f0a571d
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Private Member Functions
gmx::H5mdFixedDataSet< ValueType > Class Template Reference

#include <gromacs/fileio/h5md/h5md_fixeddataset.h>

+ Inheritance diagram for gmx::H5mdFixedDataSet< ValueType >:
+ Collaboration diagram for gmx::H5mdFixedDataSet< ValueType >:

Description

template<typename ValueType>
class gmx::H5mdFixedDataSet< ValueType >

Class which provides an interface for reading and writing data to data sets of fixed size.

Template Parameters
ValueTypeType of values stored in data set (not limited to primitives).

Public Types

using Base = H5mdDataSetBase< ValueType >
 

Public Member Functions

 H5mdFixedDataSet (H5mdDataSetBase< ValueType > &&dataSet)
 Constructor to manage a given dataSet.
 
 H5mdFixedDataSet (hid_t container, const char *name)
 Constructor to open an existing data set (called name, in container).
 
const DataSetDimsdims () const
 Return the data set dimensions of the templated ValueType. More...
 
hsize_t numValues () const
 Return the total number of values, of ValueType, stored in the data set.
 
void readData (ArrayRef< ValueType > data) const
 Read all data from the data set into the given buffer data. More...
 
void writeData (ArrayRef< const ValueType > data) const
 Write to all values in the data set from the given buffer data. More...
 

Private Member Functions

hid_t id () const
 Return the HDF5 handle of the data set. More...
 
hid_t dataType () const
 Return the HDF5 handle of the data type for the managed data set. More...
 
hid_t nativeDataType () const
 Return the HDF5 handle of the native data type for the managed data set. More...
 

Member Function Documentation

template<typename ValueType >
const DataSetDims & gmx::H5mdFixedDataSet< ValueType >::dims ( ) const

Return the data set dimensions of the templated ValueType.

Note
For data sets of e.g. BasicVector<T> = T[3] this refers to the actual dimensions in terms of BasicVector<T>, not the base primitive T. So while data set with shape BasicVector<float>[30][50] has primitive dimensions float[30][50][3], the dimensions returned here are [30][50]. The returned dimensions are thus consistent with the size of input buffers ArrayRef<T> used for the I/O methods readData and writeData.
template<typename ValueType >
void gmx::H5mdFixedDataSet< ValueType >::readData ( ArrayRef< ValueType >  data) const

Read all data from the data set into the given buffer data.

The size of the input data buffer must match that of the data set dims(). If the data set is multidimensional one must cast the data into a 1-dimensional form of row-major order.

Parameters
[out]dataBuffer to read data into from the data set.
Exceptions
gmx::FileIOErrorif the buffer size does not match the data set.
template<typename ValueType >
void gmx::H5mdFixedDataSet< ValueType >::writeData ( ArrayRef< const ValueType >  data) const

Write to all values in the data set from the given buffer data.

The size of the input data buffer must match that of the data set dims(). If the data set is multidimensional one must cast the data into a 1-dimensional form of row-major order.

Parameters
[in]dataBuffer with values to write into the data set.
Exceptions
gmx::FileIOErrorif the buffer size does not match the data set.

The documentation for this class was generated from the following files: