hexed 0.4.0
 
Loading...
Searching...
No Matches
hexed::hdf5_utils Namespace Reference

Convenience wrappers for some common and verbose HDF5 operations. More...

Functions

template<typename T >
const H5::PredType & type ()
 Fetches the HDF5 DataType object that describes the type T.
 
template<>
const H5::PredType & type< double > ()
 
template<>
const H5::PredType & type< Int > ()
 
template<>
const H5::PredType & type< int > ()
 
template<typename T >
void add_attr (H5::H5Object &obj, std::string attr_name, T value)
 Adds a scalar attribute attr_name with value value to obj.
 
template<typename T >
get_attr (H5::H5Object &obj, std::string attr_name)
 Returns the value of attribute attr_name from obj.
 
template<typename T >
get_attr (std::string file_name, std::string attr_name)
 Returns the value of attribute attr_name from HDF5 file named file_name.
 
template<typename T >
void write (H5::DataSet &dset, Int row, Int col, T value)
 Writes an entry to a 2D HDF5 DataSet.
 
template<typename T >
read (H5::DataSet &dset, Int row, Int col)
 Reads an entry from a 2D HDF5 DataSet.
 
template<>
const H5::PredType & type< double > ()
 
template<>
const H5::PredType & type< Int > ()
 
template<>
const H5::PredType & type< int > ()
 

Detailed Description

Convenience wrappers for some common and verbose HDF5 operations.

Function Documentation

◆ get_attr() [1/2]

template<typename T >
T hexed::hdf5_utils::get_attr ( H5::H5Object & obj,
std::string attr_name )

Returns the value of attribute attr_name from obj.

attr_name must have been previously created with C++ type T.

◆ get_attr() [2/2]

template<typename T >
T hexed::hdf5_utils::get_attr ( std::string file_name,
std::string attr_name )

Returns the value of attribute attr_name from HDF5 file named file_name.

attr_name must have been previously created with C++ type T.