TRIQS/h5 1.3.0
C++ interface to HDF5
|
The generic functions (h5::read, h5::write, h5::read_attribute, ...) call their more specialized counterparts (h5::h5_read, h5::h5_write, h5::h5_read_attribute, ...) which find the correct implementation using ADL.
Users can define their own specialized h5_write
and h5_read
functions for types which are not natively supported by h5. Example 2: Write/Read a custom C++ type shows how this can be done.
Functions | |
template<typename T > | |
T | h5::h5_read (group g, std::string const &key) |
Generic implementation for reading from an HDF5 dataset/subgroup. | |
template<typename T > | |
T | h5::h5_read_attribute (object obj, std::string const &name) |
Generic implementation for reading an HDF5 attribute. | |
template<typename T > | |
T | h5::h5_read_attribute_from_key (group g, std::string const &key, std::string const &name) |
Generic implementation for reading an HDF5 attribute. | |
template<typename T > | |
T | h5::read (group g, std::string const &key) |
Generic implementation for reading from an HDF5 dataset/subgroup. | |
template<typename T > | |
void | h5::read (group g, std::string const &key, T &x, auto const &...args) |
Generic implementation for reading from an HDF5 dataset/subgroup into a given variable. | |
template<typename T > | |
T | h5::read_attribute (object obj, std::string const &key) |
Generic implementation for reading an HDF5 attribute. | |
template<typename T > | |
void | h5::read_attribute (object obj, std::string const &key, T &x) |
Generic implementation for reading an HDF5 attribute into a given variable. | |
template<typename T > | |
bool | h5::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 performing the read. | |
template<typename T > | |
void | h5::write (group g, std::string const &key, T const &x, auto const &...args) |
Generic implementation for writing a variable to an HDF5 dataset/subgroup. | |
template<typename T > | |
void | h5::write_attribute (object obj, std::string const &key, T const &x) |
Generic implementation for writing a variable to an HDF5 attribute. | |
T h5::h5_read | ( | group | g, |
std::string const & | key ) |
#include <h5/generic.hpp>
Generic implementation for reading from an HDF5 dataset/subgroup.
It calls the static member function T::h5_read_construct(group, T &)
in case T
is not default constructible, otherwise it calls the specialized h5_read(group, std::string const &, T &)
with a default constructed T
object.
T | C++ type to be read. |
g | h5::group containing the dataset/subgroup from which to read from. |
key | Name of the dataset/subgroup. |
Definition at line 51 of file generic.hpp.
T h5::h5_read_attribute | ( | object | obj, |
std::string const & | name ) |
#include <h5/generic.hpp>
Generic implementation for reading an HDF5 attribute.
T
needs to be default constructible.
T | C++ type to be read. |
obj | h5::object to which the attribute is attached. |
name | Name of the attribute. |
Definition at line 120 of file generic.hpp.
T h5::h5_read_attribute_from_key | ( | group | g, |
std::string const & | key, | ||
std::string const & | name ) |
#include <h5/generic.hpp>
Generic implementation for reading an HDF5 attribute.
It calls the specialized h5_read_attribute_from_key(object, std::string const &, std::string const &, T &)
for the given T
. T
needs to be default constructible.
T | C++ type to be read. |
g | h5::group containing the HDF5 object to which the attribute is attached. |
key | Name of the object. |
name | Name of the attribute. |
Definition at line 184 of file generic.hpp.
T h5::read | ( | group | g, |
std::string const & | key ) |
#include <h5/generic.hpp>
Generic implementation for reading from an HDF5 dataset/subgroup.
It simply calls h5::h5_read<T>(group, std::string const &).
T | C++ type to be read. |
g | h5::group containing the dataset/subgroup from which to read from. |
key | Name of the dataset/subgroup. |
Definition at line 73 of file generic.hpp.
void h5::read | ( | group | g, |
std::string const & | key, | ||
T & | x, | ||
auto const &... | args ) |
#include <h5/generic.hpp>
Generic implementation for reading from an HDF5 dataset/subgroup into a given variable.
It calls the specialized h5_read(group, std::string const &, T &, auto const &...)
for the given T
.
T | C++ type to be read. |
g | h5::group containing the dataset/subgroup from which to read from. |
key | Name of the dataset/subgroup. |
x | Variable to read into. |
args | Additional arguments to be passed to the specialized h5_read(group, std::string const &, T &) function. |
Definition at line 89 of file generic.hpp.
T h5::read_attribute | ( | object | obj, |
std::string const & | key ) |
#include <h5/generic.hpp>
Generic implementation for reading an HDF5 attribute.
It simply calls h5::h5_read_attribute<T>(object, std::string const &).
T | C++ type to be read. |
obj | h5::object to which the attribute is attached. |
key | Name of the attribute. |
Definition at line 137 of file generic.hpp.
void h5::read_attribute | ( | object | obj, |
std::string const & | key, | ||
T & | x ) |
#include <h5/generic.hpp>
Generic implementation for reading an HDF5 attribute into a given variable.
It calls the specialized h5_read_attribute(object, std::string const &, T &)
for the given T
.
T | C++ type to be read. |
obj | h5::object to which the attribute is attached. |
key | Name of the attribute. |
x | Variable to read into. |
Definition at line 152 of file generic.hpp.
|
inline |
#include <h5/generic.hpp>
Check if an HDF5 dataset/subgroup with the given key exists in the given parent group before performing the read.
If the key exists, it simply calls the specialized h5_read(group, std::string const &, T &)
for the given T
, otherwise it does nothing.
T | C++ type to be read. |
g | h5::group containing the dataset/subgroup from which to read from. |
key | Name of the dataset/subgroup. |
x | Variable to read into. |
Definition at line 203 of file generic.hpp.
void h5::write | ( | group | g, |
std::string const & | key, | ||
T const & | x, | ||
auto const &... | args ) |
#include <h5/generic.hpp>
Generic implementation for writing a variable to an HDF5 dataset/subgroup.
It calls the specialized h5_write(group, std::string const &, T const &)
for the given T
.
T | C++ type to be written. |
g | h5::group in which the dataset/subgroup is created. |
key | Name of the dataset/subgroup to which the variable is written. |
x | Variable to be written. |
args | Additional arguments to be passed to the specialized h5_write(group, std::string const &, T const &) function. |
Definition at line 105 of file generic.hpp.
void h5::write_attribute | ( | object | obj, |
std::string const & | key, | ||
T const & | x ) |
#include <h5/generic.hpp>
Generic implementation for writing a variable to an HDF5 attribute.
It calls the specialized h5_write_attribute(object, std::string const &, T const &)
for the given T
.
T | C++ type to be read. |
obj | h5::object to which the attribute is attached. |
key | Name of the attribute to be created. |
x | Variable to be written. |
Definition at line 167 of file generic.hpp.