static attribute create(handle const& loc, const char* name, datatype const& type, dataspace const& space) { hid_t id = H5Acreate(loc.getId(), name, type, space, H5P_DEFAULT, H5P_DEFAULT); assert(id >= 0); return attribute(std::move(id)); }
attribute get_attribute(handle const& loc, const char* obj_name, const char* attr_name) { hid_t id = H5Aopen_by_name(loc.getId(), obj_name, attr_name, H5P_DEFAULT, H5P_DEFAULT); if (id < 0) throw std::runtime_error("H5Aopen_by_name failed"); return attribute(std::move(id)); }