Gromacs  2026.0-dev-20251109-f20ba35
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::H5mdScalarFrameDataSet< ValueType > Class Template Reference

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

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

Description

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

Class which provides an interface for reading and writing scalar frame data to H5mdDataSetBase objects.

Scalar frame data is a 1d array of the templated type, e.g. float[numFrames] or RVec[numFrames]. This class is a specializion of H5mdFrameDataSet for such data sets and provides a simpler I/O interface for reading and writing single values from/into the data sets.

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

Public Member Functions

 H5mdScalarFrameDataSet (H5mdFrameDataSet< ValueType > &&dataSet)
 Constructor to manage a given dataSet. More...
 
 H5mdScalarFrameDataSet (hid_t container, const char *name)
 Constructor to open an existing data set (called name, in container). More...
 
void readFrame (hsize_t frameIndex, ValueType *value)
 Read data from frame at index into value. More...
 
void writeNextFrame (const ValueType &value)
 Write data from values into the next frame. More...
 

Constructor & Destructor Documentation

template<typename ValueType>
gmx::H5mdScalarFrameDataSet< ValueType >::H5mdScalarFrameDataSet ( H5mdFrameDataSet< ValueType > &&  dataSet)

Constructor to manage a given dataSet.

Exceptions
gmx::FileIOErrorif the data set frame dimensions is not empty.
template<typename ValueType>
gmx::H5mdScalarFrameDataSet< ValueType >::H5mdScalarFrameDataSet ( hid_t  container,
const char *  name 
)
Initial value:
{
throwUponH5mdError(!this->frameDims().empty(),
formatString("Could not create scalar frame data set: frame dimension "
"must be empty but had %lu values.",
this->frameDims().size()))
const DataSetDims & frameDims() const
Return the dimensions of a single frame of the templated type in data set.
Definition: h5md_framedataset.cpp:165

Constructor to open an existing data set (called name, in container).

Exceptions
gmx::FileIOErrorif the data set frame dimensions is not empty.

Member Function Documentation

template<typename ValueType>
void gmx::H5mdScalarFrameDataSet< ValueType >::readFrame ( hsize_t  frameIndex,
ValueType *  value 
)

Read data from frame at index into value.

Parameters
[in]frameIndexFrame index to read data from.
[out]valueValue into which to read data.
Exceptions
gmx::FileIOErrorif an error occurred when reading the data.
template<typename ValueType>
void gmx::H5mdScalarFrameDataSet< ValueType >::writeNextFrame ( const ValueType &  value)

Write data from values into the next frame.

Parameters
[in]valueValue to write.
Exceptions
gmx::FileIOErrorif an error occurred when writing the data.

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