-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
247 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#pragma once | ||
|
||
#include <H5Dpublic.h> | ||
#include <H5Ipublic.h> | ||
|
||
#include <highfive/H5Exception.hpp> | ||
|
||
namespace HighFive { | ||
namespace detail { | ||
|
||
inline hid_t h5g_create2(hid_t loc_id, | ||
const char* name, | ||
hid_t lcpl_id, | ||
hid_t gcpl_id, | ||
hid_t gapl_id) { | ||
hid_t group_id = H5Gcreate2(loc_id, name, lcpl_id, gcpl_id, gapl_id); | ||
if (group_id == H5I_INVALID_HID) { | ||
HDF5ErrMapper::ToException<GroupException>(std::string("Unable to create the group \"") + | ||
name + "\":"); | ||
} | ||
|
||
return group_id; | ||
} | ||
|
||
inline hid_t h5g_open2(hid_t loc_id, const char* name, hid_t gapl_id) { | ||
hid_t group_id = H5Gopen2(loc_id, name, gapl_id); | ||
if (group_id == H5I_INVALID_HID) { | ||
HDF5ErrMapper::ToException<GroupException>(std::string("Unable to open the group \"") + | ||
name + "\":"); | ||
} | ||
return group_id; | ||
} | ||
|
||
inline herr_t h5g_get_num_objs(hid_t loc_id, hsize_t* num_objs) { | ||
herr_t err = H5Gget_num_objs(loc_id, num_objs); | ||
if (err < 0) { | ||
HDF5ErrMapper::ToException<GroupException>( | ||
std::string("Unable to count objects in existing group or file")); | ||
} | ||
|
||
return err; | ||
} | ||
|
||
|
||
} // namespace detail | ||
} // namespace HighFive |
Oops, something went wrong.