static_assert(std::is_same<number, float>::value ||
std::is_same<number, double>::value ||
std::is_same<number, int>::value ||
+ std::is_same<number, bool>::value ||
std::is_same<number, unsigned int>::value ||
std::is_same<number, std::complex<float>>::value ||
std::is_same<number, std::complex<double>>::value,
{
return std::make_shared<hid_t>(H5T_NATIVE_UINT);
}
+ else if (std::is_same<number, bool>::value)
+ {
+ return std::make_shared<hid_t>(H5T_NATIVE_HBOOL);
+ }
else if (std::is_same<number, std::complex<float>>::value)
{
std::shared_ptr<hid_t> t_type =
- template <>
- inline bool
- HDF5Object::get_attribute(const std::string &attr_name) const
- {
- // The enum field generated by h5py can be casted to int
- int int_value;
- hid_t attr;
- herr_t ret;
-
- attr = H5Aopen(*hdf5_reference, attr_name.data(), H5P_DEFAULT);
- Assert(attr >= 0, ExcMessage("Error at H5Aopen"));
- ret = H5Aread(attr, H5T_NATIVE_INT, &int_value);
- (void)ret;
- Assert(ret >= 0, ExcMessage("Error at H5Aread"));
- ret = H5Aclose(attr);
- (void)ret;
- Assert(ret >= 0, ExcMessage("Error at H5Aclose"));
-
- return (int_value != 0);
- }
-
-
-
template <>
inline std::string
HDF5Object::get_attribute(const std::string &attr_name) const