21 template<
typename T,
typename U,
typename... UTail>
22 inline bool hdf5_read_scalar_data_helper_impl(T & value, data_type
const &data_id, type_type
const &native_id, std::true_type) {
24 H5Tequal(type_type(H5Tcopy(native_id)), type_type(get_native_type(U())))
27 check_error(H5Dread(data_id, native_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &u));
31 return hdf5_read_scalar_data_helper_impl<T, UTail...>(value,
34 std::integral_constant<bool,
sizeof...(UTail) != 0>());
36 template<
typename T,
typename... UTail>
37 inline bool hdf5_read_scalar_data_helper_impl(T &, data_type
const &, type_type
const &, std::false_type) {
return false; }
40 bool hdf5_read_scalar_data_helper(T & value, data_type
const &data_id, type_type
const &native_id) {
41 return hdf5_read_scalar_data_helper_impl<T, ALPS_HDF5_NATIVE_INTEGRAL_TYPES>(value, data_id, native_id, std::true_type());
44 #define ALPS_HDF5_READ_SCALAR_DATA_HELPER(T) \ 45 template bool hdf5_read_scalar_data_helper<T>(T &, data_type const &, type_type const &); 52 template<
typename T,
typename U,
typename... UTail>
53 inline bool hdf5_read_scalar_attribute_helper_impl(T & value, attribute_type
const &attribute_id, type_type
const &native_id, std::true_type) {
55 H5Tequal(type_type(H5Tcopy(native_id)), type_type(get_native_type(U())))
58 check_error(H5Aread(attribute_id, native_id, &u));
62 return hdf5_read_scalar_attribute_helper_impl<T, UTail...>(value,
65 std::integral_constant<bool,
sizeof...(UTail) != 0>());
67 template<
typename T,
typename... UTail>
68 inline bool hdf5_read_scalar_attribute_helper_impl(T &, attribute_type
const &, type_type
const &, std::false_type) {
return false; }
71 bool hdf5_read_scalar_attribute_helper(T & value, attribute_type
const &attribute_id, type_type
const &native_id) {
72 return hdf5_read_scalar_attribute_helper_impl<T, ALPS_HDF5_NATIVE_INTEGRAL_TYPES>(value, attribute_id, native_id, std::true_type());
75 #define ALPS_HDF5_READ_SCALAR_ATTRIBUTE_HELPER(T) \ 76 template bool hdf5_read_scalar_attribute_helper<T>(T &, attribute_type const &, type_type const &);
#define ALPS_HDF5_READ_SCALAR_ATTRIBUTE_HELPER(T)
#define ALPS_HDF5_READ_SCALAR_DATA_HELPER(T)
ALPS_FOREACH_NATIVE_HDF5_TYPE(ALPS_HDF5_READ_SCALAR)