9inline hid_t h5a_create2(hid_t loc_id,
10 char const*
const attr_name,
15 auto attr_id = H5Acreate2(loc_id, attr_name, type_id, space_id, acpl_id, aapl_id);
18 std::string(
"Unable to create the attribute \"") + attr_name +
"\":");
24inline void h5a_delete(hid_t loc_id,
char const*
const attr_name) {
25 if (H5Adelete(loc_id, attr_name) < 0) {
27 std::string(
"Unable to delete attribute \"") + attr_name +
"\":");
31inline hid_t h5a_open(hid_t loc_id,
char const*
const attr_name, hid_t aapl_id) {
32 const auto attr_id = H5Aopen(loc_id, attr_name, aapl_id);
35 std::string(
"Unable to open the attribute \"") + attr_name +
"\":");
42inline int h5a_get_num_attrs(hid_t loc_id) {
43 int res = H5Aget_num_attrs(loc_id);
46 std::string(
"Unable to count attributes in existing group or file"));
53inline void h5a_iterate2(hid_t loc_id,
55 H5_iter_order_t order,
59 if (H5Aiterate2(loc_id, idx_type, order, idx, op, op_data) < 0) {
64inline int h5a_exists(hid_t obj_id,
char const*
const attr_name) {
65 int res = H5Aexists(obj_id, attr_name);
68 std::string(
"Unable to check for attribute in group"));
74inline ssize_t h5a_get_name(hid_t attr_id,
size_t buf_size,
char* buf) {
75 ssize_t name_length = H5Aget_name(attr_id, buf_size, buf);
76 if (name_length < 0) {
78 std::string(
"Unable to get name of attribute"));
85inline hid_t h5a_get_space(hid_t attr_id) {
86 hid_t attr = H5Aget_space(attr_id);
89 std::string(
"Unable to get dataspace of attribute"));
95inline hsize_t h5a_get_storage_size(hid_t attr_id) {
99 return H5Aget_storage_size(attr_id);
102inline hid_t h5a_get_type(hid_t attr_id) {
103 hid_t type_id = H5Aget_type(attr_id);
104 if (type_id == H5I_INVALID_HID) {
106 std::string(
"Unable to get datatype of attribute"));
112inline herr_t h5a_read(hid_t attr_id, hid_t type_id,
void* buf) {
113 herr_t err = H5Aread(attr_id, type_id, buf);
121inline herr_t h5a_write(hid_t attr_id, hid_t type_id,
void const* buf) {
122 herr_t err = H5Awrite(attr_id, type_id, buf);
Definition H5_definitions.hpp:22
static void ToException(const std::string &prefix_msg)
Definition H5Exception_misc.hpp:43