8#ifndef UTOPIA_DATAIO_HDFUTILITIES_HH
9#define UTOPIA_DATAIO_HDFUTILITIES_HH
82 throw std::runtime_error(
"Object " + std::string(
object_name) +
": " +
83 "Error in validity check");
113 std::size_t
seg_pos = (path.find(
"/") == 0) ? 1 : 0;
119 while (
seg_pos != std::string::npos)
163 throw std::runtime_error(
"Error when checking path " + path);
188template < HDFCategory category >
218template <
class Object >
223 object.get_path() +
"'";
233template <
typename Object >
241 else if constexpr (std::decay_t< Object >::category ==
259template <
typename Object >
267 else if constexpr (std::decay_t< Object >::category ==
Container select_entities(const Manager &mngr, const DataIO::Config &sel_cfg)
Select entities according to parameters specified in a configuration.
Definition select.hh:213
hid_t open_dataspace(Object &&object)
Depending on object category, opens a dataset or attribute dataspace.
Definition hdfutilities.hh:235
bool check_validity(htri_t valid, const std::string_view object_name)
Check for validity of a hdf5 htri_t type or similar.
Definition hdfutilities.hh:73
std::string generate_object_name(const Object &object)
Use category and path variable of object to make a string that identifies the object it is applied to...
Definition hdfutilities.hh:220
auto path_is_valid(hid_t id, std::string path)
Check if the path given relative to the object identified by 'id' exists and points to a valid hdf5 o...
Definition hdfutilities.hh:150
htri_t path_exists(hid_t loc_id, std::string path, hid_t link_property_list=H5P_DEFAULT)
Checks iteratively if each segment of a path exists.
Definition hdfutilities.hh:107
std::string category_to_string()
Turn category enum into a string that names it.
Definition hdfutilities.hh:190
hid_t open_type(Object &&object)
Depending on object category, invokes H5Dget_type or H5Aget_type.
Definition hdfutilities.hh:261
HDFCategory
Enumerate the different HDF5 object types for use in HDFObject class.
Definition hdfutilities.hh:173