QMCPACK
h5data_proxy< hyperslab_proxy< CT, RANK > > Struct Template Reference
+ Collaboration diagram for h5data_proxy< hyperslab_proxy< CT, RANK > >:

Public Types

using data_type = hyperslab_proxy< CT, RANK >
 

Public Member Functions

 h5data_proxy (const data_type &a)
 
bool read (data_type &ref, hid_t grp, const std::string &aname, hid_t xfer_plist=H5P_DEFAULT)
 
bool write (const data_type &ref, hid_t grp, const std::string &aname, hid_t xfer_plist=H5P_DEFAULT) const
 

Detailed Description

template<typename CT, unsigned RANK>
struct qmcplusplus::h5data_proxy< hyperslab_proxy< CT, RANK > >

Definition at line 155 of file hdf_hyperslab.h.

Member Typedef Documentation

◆ data_type

using data_type = hyperslab_proxy<CT, RANK>

Definition at line 157 of file hdf_hyperslab.h.

Constructor & Destructor Documentation

◆ h5data_proxy()

h5data_proxy ( const data_type a)
inline

Definition at line 159 of file hdf_hyperslab.h.

159 {}

Member Function Documentation

◆ read()

bool read ( data_type ref,
hid_t  grp,
const std::string &  aname,
hid_t  xfer_plist = H5P_DEFAULT 
)
inline

Definition at line 161 of file hdf_hyperslab.h.

References hyperslab_proxy< CT, RANK >::adaptShape(), hyperslab_proxy< CT, RANK >::checkContainerCapacity(), hyperslab_proxy< CT, RANK >::checkUserRankSizes(), h5_space_type< T, RANK >::dims, hyperslab_proxy< CT, RANK >::file_space, h5_space_type< element_type, RANK >::get_address(), qmcplusplus::h5d_read(), h5_space_type< T, RANK >::rank, hyperslab_proxy< CT, RANK >::ref_, hyperslab_proxy< CT, RANK >::selected_space, hyperslab_proxy< CT, RANK >::slab_offset, and hyperslab_proxy< CT, RANK >::slab_rank.

162  {
163  std::vector<hsize_t> sizes_file;
164  getDataShape<typename data_type::element_type>(grp, aname, sizes_file);
165  ref.adaptShape(sizes_file);
166  ref.checkUserRankSizes();
167  if (!ref.checkContainerCapacity())
168  container_traits<CT>::resize(ref.ref_, ref.selected_space.dims, ref.slab_rank);
169  return h5d_read(grp, aname.c_str(), ref.file_space.rank, ref.file_space.dims, ref.selected_space.dims,
170  ref.slab_offset.data(),
172  xfer_plist);
173  }
static void resize(CT &ref, I *n, int d)
resize container
static auto get_address(element_type *a)
return the address
Definition: hdf_dataspace.h:53
bool h5d_read(hid_t grp, const std::string &aname, T *first, hid_t xfer_plist)
return true, if successful
static auto getElementPtr(CT &ref)
get the linear storage pointer of a container

◆ write()

bool write ( const data_type ref,
hid_t  grp,
const std::string &  aname,
hid_t  xfer_plist = H5P_DEFAULT 
) const
inline

Definition at line 175 of file hdf_hyperslab.h.

References hyperslab_proxy< CT, RANK >::checkContainerCapacity(), hyperslab_proxy< CT, RANK >::checkUserRankSizes(), h5_space_type< T, RANK >::dims, hyperslab_proxy< CT, RANK >::file_space, h5_space_type< element_type, RANK >::get_address(), qmcplusplus::h5d_write(), h5_space_type< T, RANK >::rank, hyperslab_proxy< CT, RANK >::ref_, hyperslab_proxy< CT, RANK >::selected_space, and hyperslab_proxy< CT, RANK >::slab_offset.

176  {
177  ref.checkUserRankSizes();
178  if (!ref.checkContainerCapacity())
179  throw std::runtime_error("Not large enough container capacity!\n");
180  return h5d_write(grp, aname.c_str(), ref.file_space.rank, ref.file_space.dims, ref.selected_space.dims,
181  ref.slab_offset.data(),
183  xfer_plist);
184  }
static auto get_address(element_type *a)
return the address
Definition: hdf_dataspace.h:53
static auto getElementPtr(CT &ref)
get the linear storage pointer of a container
bool h5d_write(hid_t grp, const std::string &aname, hsize_t ndims, const hsize_t *dims, const T *first, hid_t xfer_plist)

The documentation for this struct was generated from the following file: