22 template<
typename T,
typename U,
typename... UTail>
23 inline bool hdf5_read_vector_attribute_helper_impl(std::string
const &path, T * value, attribute_type
const &attribute_id, type_type
const &native_id,
24 std::vector<std::size_t>
const &chunk,
25 std::vector<std::size_t>
const &data_size,
28 H5Tequal(type_type(H5Tcopy(native_id)), type_type(get_native_type(U())))
30 std::size_t len = std::accumulate(chunk.begin(), chunk.end(), std::size_t(1), std::multiplies<std::size_t>());
31 std::unique_ptr<U[]> raw(
34 if (std::equal(chunk.begin(), chunk.end(), data_size.begin())) {
35 check_error(H5Aread(attribute_id, native_id, raw.get()));
36 cast(raw.get(), raw.get() + len, value);
38 throw std::logic_error(
"Not Implemented, path: " + path +
ALPS_STACKTRACE);
41 return hdf5_read_vector_attribute_helper_impl<T, UTail...>(path,
47 std::integral_constant<bool,
sizeof...(UTail) != 0>());
49 template<
typename T,
typename... UTail>
50 inline bool hdf5_read_vector_attribute_helper_impl(std::string
const &, T *, attribute_type
const &, type_type
const &,
51 std::vector<std::size_t>
const &,
52 std::vector<std::size_t>
const &,
57 bool hdf5_read_vector_attribute_helper(std::string
const &path, T * value, attribute_type
const &attribute_id, type_type
const &native_id,
58 std::vector<std::size_t>
const &chunk,
59 std::vector<std::size_t>
const &data_size) {
60 return hdf5_read_vector_attribute_helper_impl<T, ALPS_HDF5_NATIVE_INTEGRAL_TYPES>(path,
69 #define ALPS_HDF5_READ_VECTOR_ATTRIBUTE_HELPER(T) \ 70 template bool hdf5_read_vector_attribute_helper(std::string const &, T *, attribute_type const &, type_type const &, \ 71 std::vector<std::size_t> const &, \ 72 std::vector<std::size_t> const &);
#define ALPS_HDF5_READ_VECTOR_ATTRIBUTE_HELPER(T)
ALPS_FOREACH_NATIVE_HDF5_TYPE(ALPS_HDF5_READ_SCALAR)