Skip to content

Commit

Permalink
Name ctor for empty property lists.
Browse files Browse the repository at this point in the history
Empty property lists have a valid HID, unlike default constructed
properties which use H5P_DEFAULT.

This only matters when interfacing with HDF5 directly.
  • Loading branch information
1uc committed Dec 21, 2023
1 parent 04ae650 commit 471ce6d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/highfive/H5PropertyList.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,18 @@ class PropertyList: public PropertyListBase {
return static_cast<const PropertyList<T>&>(PropertyListBase::Default());
}

/// Return a property list created via a call to `H5Pcreate`.
///
/// An empty property is needed when one wants `getId()` to immediately
/// point at a valid HID. This is important when interfacing directly with
/// HDF5 to set properties that haven't been wrapped by HighFive.
static PropertyList<T> Empty() {
auto plist = PropertyList<T>();
plist._initializeIfNeeded();

return plist;
}

protected:
void _initializeIfNeeded();
};
Expand Down

0 comments on commit 471ce6d

Please sign in to comment.