Gromacs  2027.0-dev-20260904-8b74e934
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Friends
gmx::H5mdDataSetBase< ValueType > Class Template Reference

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

+ Inheritance diagram for gmx::H5mdDataSetBase< ValueType >:

Description

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

Class which manages a HDF5 data set handle and associated data.

Can be made either by opening an existing data set via its name within a container via a public constructor (typically when reading), or via H5mdDataSetBuilder<ValueType> to make a new data set (typically) when writing). The latter is implemented via a private constructor.

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

Public Member Functions

 H5mdDataSetBase (hid_t container, const char *name)
 Constructor to open an existing data set (called name, in container).
 
 ~H5mdDataSetBase () noexcept
 Destructor.
 
 H5mdDataSetBase (const H5mdDataSetBase &) noexcept=delete
 Copy constructor explicitly deleted.
 
H5mdDataSetBaseoperator= (const H5mdDataSetBase &)=delete
 Copy assignment explicitly deleted.
 
 H5mdDataSetBase (H5mdDataSetBase &&) noexcept
 Move constructor.
 
H5mdDataSetBaseoperator= (H5mdDataSetBase &&) noexcept=delete
 Move assignment explicitly deleted (not supported by sg::scope_guard).
 
hid_t id () const
 Return the HDF5 handle of the data set. More...
 
hid_t storedDataType () const
 Return the HDF5 handle of the stored (in-file) data type for the managed data set. More...
 
hid_t nativeDataType () const
 Return the HDF5 handle of the native (in-memory) data type for the managed data set. More...
 
DataSetDims dims () const
 Return the dimensions of the data set. More...
 
bool read (ArrayRef< ValueType > values, hid_t memoryDataSpace, hid_t fileDataSpace) const
 Perform a low-level operation to read data into values. More...
 
bool write (ArrayRef< const ValueType > values, hid_t memoryDataSpace, hid_t fileDataSpace) const
 Perform a low-level operation to write values into data set. More...
 

Friends

class H5mdDataSetBuilder< ValueType >
 

Member Function Documentation

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

Return the dimensions of the data set.

Exceptions
H5mdErrorif the dimensions cannot be read.
template<typename ValueType >
hid_t gmx::H5mdDataSetBase< ValueType >::id ( ) const

Return the HDF5 handle of the data set.

Warning
Must not be closed by the caller.
Deprecated:
This handle will not be exposed once I/O is implemented as class methods.
template<typename ValueType >
hid_t gmx::H5mdDataSetBase< ValueType >::nativeDataType ( ) const

Return the HDF5 handle of the native (in-memory) data type for the managed data set.

Warning
Must not be closed by the caller.
Deprecated:
This handle will not be exposed once I/O is implemented as class methods.
template<typename ValueType>
bool gmx::H5mdDataSetBase< ValueType >::read ( ArrayRef< ValueType >  values,
hid_t  memoryDataSpace,
hid_t  fileDataSpace 
) const

Perform a low-level operation to read data into values.

Note
Assumes that the caller has validated the given handles and that values is of the correct size.
Parameters
[out]valuesContainer to read data into.
[in]memoryDataSpaceData space for the memory buffer (called mem_space_id in hdf5 documentation).
[in]fileDataSpaceData space for the file buffer (called file_space_id in hdf5 documentation).
Returns
True if the read operation was successful, otherwise false.
template<typename ValueType >
hid_t gmx::H5mdDataSetBase< ValueType >::storedDataType ( ) const

Return the HDF5 handle of the stored (in-file) data type for the managed data set.

Warning
Must not be closed by the caller.
Deprecated:
This handle will not be exposed once I/O is implemented as class methods.
template<typename ValueType>
bool gmx::H5mdDataSetBase< ValueType >::write ( ArrayRef< const ValueType >  values,
hid_t  memoryDataSpace,
hid_t  fileDataSpace 
) const

Perform a low-level operation to write values into data set.

Note
Assumes that the caller has validated the given handles and that values is of the correct size.
Parameters
[in]valuesValues to write into the data set.
[in]memoryDataSpaceData space for the memory buffer (called mem_space_id in hdf5 documentation).
[in]fileDataSpaceData space for the file buffer (called file_space_id in hdf5 documentation).
Returns
True if the write operation was successful, otherwise false.

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