25#ifndef LIBH5_GENERIC_HPP
26#define LIBH5_GENERIC_HPP
55 if constexpr (std::is_default_constructible_v<T>) {
60 return T::h5_read_construct(g, key);
91 void read(
group g, std::string
const &key, T &x,
auto const &...args) {
107 template <
typename T>
108 void write(
group g, std::string
const &key, T
const &x,
auto const &...args) {
124 template <
typename T>
141 template <
typename T>
156 template <
typename T>
171 template <
typename T>
190 template <
typename T>
210 template <
typename T>
A handle to an HDF5 group.
bool has_key(std::string const &key) const
Check if a link with the given key exists in the group.
Provides a handle to an HDF5 group and various methods to simplify the creation/opening of subgroups,...
T h5_read(group g, std::string const &key)
Generic implementation for reading from an HDF5 dataset/subgroup.
T h5_read_attribute_from_key(group g, std::string const &key, std::string const &name)
Generic implementation for reading an HDF5 attribute.
bool try_read(group g, std::string const &key, T &x)
Check if an HDF5 dataset/subgroup with the given key exists in the given parent group before performi...
void write_attribute(object obj, std::string const &key, T const &x)
Generic implementation for writing a variable to an HDF5 attribute.
T read(group g, std::string const &key)
Generic implementation for reading from an HDF5 dataset/subgroup.
T read_attribute(object obj, std::string const &key)
Generic implementation for reading an HDF5 attribute.
void write(group g, std::string const &key, T const &x, auto const &...args)
Generic implementation for writing a variable to an HDF5 dataset/subgroup.
T h5_read_attribute(object obj, std::string const &name)
Generic implementation for reading an HDF5 attribute.
void h5_write(group g, std::string const &name, T const &x)
Write a scalar to an HDF5 dataset.
void h5_write_attribute(object, std::string const &, std::string const &)
Write a std::string to an HDF5 attribute.