|
TRIQS/h5 1.3.0
C++ interface to HDF5
|
Specialized functions to read/write hdf5_format tags from/to HDF5 attributes.
An hdf5_format tag is a string that describes the type of object stored in an HDF5 file. A type T which is HDF5 readable/writeable should do one of the following:
The specialized h5_write function for type T should write the format tag to file (see h5::write_hdf5_format and h5::write_hdf5_format_as_string) and the h5_read function should check that the format tag is correct (see h5::assert_hdf5_format and h5::assert_hdf5_format_as_string).
Functions | |
| template<typename T> | |
| void | h5::assert_hdf5_format (object obj, bool ignore_if_absent=false) |
| Assert that the hdf5_format tag attached to the given object is the same as the hdf5_format tag of the type T. | |
| template<typename T> | |
| void | h5::assert_hdf5_format (object obj, T const &t, bool ignore_if_absent=false) |
| Assert that the hdf5_format tag attached to the given object is the same as the hdf5_format tag of the type T using template argument deduction. | |
| void | h5::assert_hdf5_format_as_string (object obj, const char *tag_expected, bool ignore_if_absent=false) |
| Assert that the hdf5_format tag attached to the given object is the same as the given tag. | |
| template<typename T> | |
| std::string | h5::get_hdf5_format () |
| Get the hdf5_format tag of type T. | |
| template<typename T> | |
| std::string | h5::get_hdf5_format (T const &t) |
| Get the hdf5_format tag of type T using template argument deduction. | |
| std::string | h5::read_hdf5_format (object obj) |
| Read an hdf5_format tag from an HDF5 attribute with the name 'Format'. | |
| void | h5::read_hdf5_format (object obj, std::string &s) |
| Read an hdf5_format tag from an HDF5 attribute with the name 'Format'. | |
| void | h5::read_hdf5_format_from_key (group g, std::string const &key, std::string &s) |
| Read an hdf5_format tag from an HDF5 attribute with the name 'Format'. | |
| template<typename T> | |
| void | h5::write_hdf5_format (object obj) |
| Write an hdf5_format tag for type T to an HDF5 attribute with the name 'Format'. | |
| template<typename T> | |
| void | h5::write_hdf5_format (object obj, T const &t) |
| Write an hdf5_format tag for type T to an HDF5 attribute with the name 'Format' using template argument deduction. | |
| void | h5::write_hdf5_format_as_string (object obj, std::string const &s) |
| Write a std::string to an HDF5 attribute with the name 'Format'. | |
| void h5::assert_hdf5_format | ( | object | obj, |
| bool | ignore_if_absent = false ) |
#include <h5/format.hpp>
Assert that the hdf5_format tag attached to the given object is the same as the hdf5_format tag of the type T.
Throws a std::runtime_error if the tags don't match.
| T | Type for which the hdf5_format tag is to be checked. |
| obj | h5::object to be checked. |
| ignore_if_absent | If true, the assertion is ignored if the object does not have a 'Format' attribute. |
Definition at line 178 of file format.hpp.
| void h5::assert_hdf5_format | ( | object | obj, |
| T const & | t, | ||
| bool | ignore_if_absent = false ) |
#include <h5/format.hpp>
Assert that the hdf5_format tag attached to the given object is the same as the hdf5_format tag of the type T using template argument deduction.
Throws a std::runtime_error if the tags don't match.
| T | Type for which the hdf5_format tag is to be checked. |
| obj | h5::object to be checked. |
| t | Instance of type T (used for template argument deduction only). |
| ignore_if_absent | If true, the assertion is ignored if the object does not have a 'Format' attribute. |
Definition at line 194 of file format.hpp.
| void h5::assert_hdf5_format_as_string | ( | object | obj, |
| const char * | tag_expected, | ||
| bool | ignore_if_absent = false ) |
#include <h5/format.cpp>
Assert that the hdf5_format tag attached to the given object is the same as the given tag.
Throws a std::runtime_error if the tags don't match.
| obj | h5::object to be checked. |
| tag_expected | Expected hdf5_format tag. |
| ignore_if_absent | If true, the assertion is ignored if the object does not have a 'Format' attribute. |
Definition at line 52 of file format.cpp.
| std::string h5::get_hdf5_format | ( | ) |
#include <h5/format.hpp>
Get the hdf5_format tag of type T.
| T | Type for which the hdf5_format tag is to be retrieved.. |
Definition at line 83 of file format.hpp.
| std::string h5::get_hdf5_format | ( | T const & | t | ) |
#include <h5/format.hpp>
Get the hdf5_format tag of type T using template argument deduction.
| T | Type for which the hdf5_format tag is to be retrieved. |
| t | Instance of type T (used for template argument deduction only). |
Definition at line 95 of file format.hpp.
| std::string h5::read_hdf5_format | ( | object | obj | ) |
#include <h5/format.cpp>
Read an hdf5_format tag from an HDF5 attribute with the name 'Format'.
| obj | h5::object from which the attribute is read. |
Definition at line 39 of file format.cpp.
| void h5::read_hdf5_format | ( | object | obj, |
| std::string & | s ) |
#include <h5/format.cpp>
Read an hdf5_format tag from an HDF5 attribute with the name 'Format'.
| obj | h5::object from which the attribute is read. |
| s | String to be read into. |
Definition at line 32 of file format.cpp.
| void h5::read_hdf5_format_from_key | ( | group | g, |
| std::string const & | key, | ||
| std::string & | s ) |
#include <h5/format.cpp>
Read an hdf5_format tag from an HDF5 attribute with the name 'Format'.
| g | h5::group containing the HDF5 object from which the attribute is read. |
| key | Name of the object. |
| s | String to be read into. |
Definition at line 45 of file format.cpp.
|
inline |
#include <h5/format.hpp>
Write an hdf5_format tag for type T to an HDF5 attribute with the name 'Format'.
| T | Type for which the hdf5_format tag is to be written. |
| obj | h5::object to which the attribute is attached. |
Definition at line 114 of file format.hpp.
|
inline |
#include <h5/format.hpp>
Write an hdf5_format tag for type T to an HDF5 attribute with the name 'Format' using template argument deduction.
| T | Type for which the hdf5_format tag is to be written. |
| obj | h5::object to which the attribute is attached. |
| t | Instance of type T (used for template argument deduction only). |
Definition at line 127 of file format.hpp.
|
inline |
#include <h5/format.hpp>
Write a std::string to an HDF5 attribute with the name 'Format'.
| obj | h5::object to which the attribute is attached. |
| s | String to be written. |
Definition at line 105 of file format.hpp.