SIRIUS 7.5.0
Electronic structure library and applications
|
Interface to the HDF5 library. More...
#include <hdf5_tree.hpp>
Classes | |
class | HDF5_attribute |
class | HDF5_dataset |
Auxiliary class to handle HDF5 Dataset object. More... | |
class | HDF5_dataspace |
Auxiliary class to handle HDF5 Dataspace object. More... | |
class | HDF5_group |
Auxiliary class to handle HDF5 Group object. More... | |
Public Member Functions | |
HDF5_tree (const std::string &file_name__, hdf5_access_t access__) | |
Constructor to create the HDF5 tree. More... | |
~HDF5_tree () | |
Destructor. More... | |
HDF5_tree | create_node (int idx) |
Create node by integer index. More... | |
HDF5_tree | create_node (std::string const &name) |
Create node by name. More... | |
template<typename T , int N> | |
void | write (const std::string &name, sddk::mdarray< std::complex< T >, N > const &data) |
template<typename T , int N> | |
void | write (std::string const &name__, sddk::mdarray< T, N > const &data__) |
Write a multidimensional array by name. More... | |
template<typename T , int N> | |
void | write (int name_id, sddk::mdarray< T, N > const &data) |
Write a multidimensional array by integer index. More... | |
template<typename T > | |
void | write (const std::string &name, T const *data, int size) |
Write a buffer. More... | |
template<typename T > | |
void | write (const std::string &name, T data) |
Write a scalar. More... | |
template<typename T > | |
void | write (int name_id, std::vector< T > const &vec) |
Write a vector by id. More... | |
template<typename T > | |
void | write (const std::string &name, std::vector< T > const &vec) |
Write a vector by name. More... | |
template<typename T > | |
void | write_attribute (const std::string &name, const T &data) const |
Write attribute. More... | |
template<typename T > | |
void | write_attribute (const std::string &name, const T &data, const std::string &dataset_name) const |
Write attribute. More... | |
void | write_attribute (const std::string &name, const std::string &data, hid_t base_string_type=H5T_FORTRAN_S1) const |
Write string attribute. More... | |
void | write_attribute (const std::string &name, const std::string &data, const std::string &dataset_name, hid_t base_string_type=H5T_FORTRAN_S1) const |
Write string attribute. More... | |
template<std::size_t N> | |
void | write_attribute (const std::string &name, const char(&data)[N], hid_t base_string_type=H5T_FORTRAN_S1) const |
Write string attribute. More... | |
template<std::size_t N> | |
void | write_attribute (const std::string &name, const char(&data)[N], const std::string &dataset_name, hid_t base_string_type=H5T_FORTRAN_S1) const |
Write string attribute. More... | |
template<typename T > | |
void | write_attribute (const std::string &name, const std::vector< T > &data) const |
Write array attribute. More... | |
template<typename T > | |
void | write_attribute (const std::string &name, const std::vector< T > &data, const std::string &dataset_name) const |
Write array attribute. More... | |
template<typename T > | |
void | write_attribute (const std::string &name, const std::initializer_list< T > &data) const |
Write array attribute. More... | |
template<typename T > | |
void | write_attribute (const std::string &name, const std::initializer_list< T > &data, const std::string &dataset_name) const |
Write array attribute. More... | |
template<int N> | |
void | read (const std::string &name, sddk::mdarray< std::complex< double >, N > &data) |
template<typename T , int N> | |
void | read (const std::string &name, sddk::mdarray< T, N > &data) |
template<typename T , int N> | |
void | read (int name_id, sddk::mdarray< T, N > &data) |
template<typename T > | |
void | read (std::string const &name, T *data, int size) |
Read a vector or a scalar. More... | |
template<typename T > | |
void | read (int name_id, std::vector< T > &vec) |
template<typename T > | |
void | read (std::string const &name, std::vector< T > &vec) |
HDF5_tree | operator[] (std::string const &path__) |
HDF5_tree | operator[] (int idx__) |
Private Member Functions | |
HDF5_tree (hid_t file_id__, const std::string &path__) | |
Constructor to create branches of the HDF5 tree. More... | |
hid_t | string_type (const std::string &data, hid_t base_string_type) const |
Create HDF5 string type from std::string. More... | |
template<typename T > | |
hid_t | array_type (const std::vector< T > &data) const |
Create HDF5 array type from std::vector. More... | |
template<typename T > | |
void | write (const std::string &name, T const *data, std::vector< int > const &dims) |
Write a multidimensional array. More... | |
template<typename T > | |
void | write_attribute (const std::string &name, const T *const data, hid_t type_id) const |
template<typename T > | |
void | write_attribute (const std::string &name, const T *const data, hid_t type_id, const std::string &dataset_name) const |
template<typename T > | |
void | read (const std::string &name, T *data, std::vector< int > const &dims) |
Read a multidimensional array. More... | |
Private Attributes | |
std::string | file_name_ |
HDF5 file name. More... | |
std::string | path_ |
path inside HDF5 file More... | |
hid_t | file_id_ {-1} |
HDF5 file handler. More... | |
bool | root_node_ {true} |
True if this is a root node. More... | |
Interface to the HDF5 library.
Definition at line 85 of file hdf5_tree.hpp.
|
inlineprivate |
Constructor to create branches of the HDF5 tree.
Definition at line 273 of file hdf5_tree.hpp.
|
inline |
Constructor to create the HDF5 tree.
Definition at line 377 of file hdf5_tree.hpp.
|
inline |
Destructor.
Definition at line 413 of file hdf5_tree.hpp.
|
inlineprivate |
Create HDF5 string type from std::string.
Definition at line 281 of file hdf5_tree.hpp.
|
inlineprivate |
Create HDF5 array type from std::vector.
Definition at line 293 of file hdf5_tree.hpp.
|
inlineprivate |
Write a multidimensional array.
Definition at line 301 of file hdf5_tree.hpp.
|
inlineprivate |
Write attribure to current GROUP
name | Name of the attribute |
data | Attribute data |
type_id | Attribute type ID |
Definition at line 324 of file hdf5_tree.hpp.
|
inlineprivate |
Write attribure to DATASET within the GROUP
name | Name of the attribute |
data | Attribute data |
type_id | Attribute type ID |
dataset_name | Dataset in current group to wich attach the attribute |
Definition at line 342 of file hdf5_tree.hpp.
|
inlineprivate |
Read a multidimensional array.
Definition at line 358 of file hdf5_tree.hpp.
|
inline |
Create node by integer index.
Create node at the current location using integer index as a name.
Definition at line 424 of file hdf5_tree.hpp.
|
inline |
Create node by name.
Create node with the given name at the current location.
Definition at line 431 of file hdf5_tree.hpp.
|
inline |
Definition at line 442 of file hdf5_tree.hpp.
|
inline |
Write a multidimensional array by name.
Definition at line 454 of file hdf5_tree.hpp.
|
inline |
Write a multidimensional array by integer index.
Definition at line 465 of file hdf5_tree.hpp.
|
inline |
Write a buffer.
Definition at line 473 of file hdf5_tree.hpp.
|
inline |
Write a scalar.
Definition at line 482 of file hdf5_tree.hpp.
|
inline |
Write a vector by id.
Definition at line 491 of file hdf5_tree.hpp.
|
inline |
Write a vector by name.
Definition at line 499 of file hdf5_tree.hpp.
|
inline |
Write attribute.
Definition at line 506 of file hdf5_tree.hpp.
|
inline |
Write attribute.
Definition at line 513 of file hdf5_tree.hpp.
|
inline |
Write string attribute.
Definition at line 519 of file hdf5_tree.hpp.
|
inline |
Write string attribute.
Definition at line 526 of file hdf5_tree.hpp.
|
inline |
Write string attribute.
Definition at line 534 of file hdf5_tree.hpp.
|
inline |
Write string attribute.
Definition at line 541 of file hdf5_tree.hpp.
|
inline |
Write array attribute.
Definition at line 549 of file hdf5_tree.hpp.
|
inline |
Write array attribute.
Definition at line 556 of file hdf5_tree.hpp.
|
inline |
Write array attribute.
Definition at line 563 of file hdf5_tree.hpp.
|
inline |
Write array attribute.
Definition at line 570 of file hdf5_tree.hpp.
|
inline |
Definition at line 577 of file hdf5_tree.hpp.
|
inline |
Definition at line 588 of file hdf5_tree.hpp.
|
inline |
Definition at line 598 of file hdf5_tree.hpp.
|
inline |
Read a vector or a scalar.
Definition at line 606 of file hdf5_tree.hpp.
|
inline |
Definition at line 614 of file hdf5_tree.hpp.
|
inline |
Definition at line 620 of file hdf5_tree.hpp.
|
inline |
Definition at line 625 of file hdf5_tree.hpp.
|
inline |
Definition at line 631 of file hdf5_tree.hpp.
|
private |
HDF5 file name.
Definition at line 89 of file hdf5_tree.hpp.
|
private |
path inside HDF5 file
Definition at line 92 of file hdf5_tree.hpp.
|
private |
HDF5 file handler.
Definition at line 95 of file hdf5_tree.hpp.
|
private |
True if this is a root node.
Definition at line 98 of file hdf5_tree.hpp.