group_particles
Loading...
Searching...
No Matches
Functions
hdf5Utils Namespace Reference

some utility functions to read attributes from hdf5 files More...

Functions

template<typename TH5 , typename Trequ >
static Trequ read_scalar_attr (H5::Group &header, const std::string &name)
 reads scalar attribute from an hdf5 group
 
template<typename TH5 , typename Trequ >
static Trequ read_vector_attr (H5::Group &header, const std::string &name, size_t idx)
 reads element of vector attribute from an hdf5 group
 
template<typename TH5 , typename Trequ >
static size_t read_vector_attr (H5::Group &header, const std::string &name, Trequ *out)
 reads entire vector attribute from an hdf5 group
 

Detailed Description

some utility functions to read attributes from hdf5 files

Function Documentation

◆ read_scalar_attr()

template<typename TH5 , typename Trequ >
static Trequ hdf5Utils::read_scalar_attr ( H5::Group &  header,
const std::string &  name 
)
static

reads scalar attribute from an hdf5 group

Template Parameters
TH5the attribute's type in the hdf5 file
Trequthe type the attribute should be returned as
Parameters
headerthe group the attribute is attached to
namethe attribute's name
Returns
the attribute

◆ read_vector_attr() [1/2]

template<typename TH5 , typename Trequ >
static Trequ hdf5Utils::read_vector_attr ( H5::Group &  header,
const std::string &  name,
size_t  idx 
)
static

reads element of vector attribute from an hdf5 group

Template Parameters
TH5the attribute's element type in the hdf5 file
Trequthe type the attribute element should be returned as
Parameters
headerthe group the vector attribute is attached to
namethe attribute's name
idxelement index in the vector attribute
Returns
the attribute element

◆ read_vector_attr() [2/2]

template<typename TH5 , typename Trequ >
static size_t hdf5Utils::read_vector_attr ( H5::Group &  header,
const std::string &  name,
Trequ *  out 
)
static

reads entire vector attribute from an hdf5 group

Template Parameters
TH5the attribute's element type in the hdf5 file
Trequthe type the attribute's elements should be returned as
Parameters
headerthe group the vector attribute is attached to
namethe attribute's name
outoutput buffer (sufficient space must be already allocated)
Returns
number of elements in the vector attribute