|
DOLFINx 0.12.0.0
DOLFINx C++
|
Scope guard for an HDF5 identifier. More...
#include <HDF5Interface.h>
Public Member Functions | |
| Handle (hid_t id, herr_t(*close)(hid_t)) noexcept | |
| Take ownership of an HDF5 identifier. | |
| Handle (const Handle &)=delete | |
| Handle (Handle &&h) noexcept | |
| Move constructor. | |
| ~Handle () | |
| Destructor. | |
| Handle & | operator= (const Handle &)=delete |
| Handle & | operator= (Handle &&h) noexcept |
| Move assignment. | |
| operator hid_t () const noexcept | |
| Managed identifier. | |
| hid_t | release () noexcept |
| Relinquish ownership of the identifier. | |
| void | close () |
| Close the identifier, reporting a failure. | |
Scope guard for an HDF5 identifier.
Closes the identifier on destruction, including when the enclosing scope is left by an exception. Non-positive identifiers (invalid handles, and the H5P_DEFAULT-style constants) are never closed.
|
inlinenoexcept |
Take ownership of an HDF5 identifier.
| [in] | id | Identifier to manage. |
| [in] | close | Function releasing id, e.g. H5Dclose. |
|
inline |
Close the identifier, reporting a failure.
Ownership is given up only once the identifier is closed, so a failure leaves it with the handle, to be closed again on destruction. Does nothing if no identifier is held.
| std::runtime_error | if the identifier cannot be closed. |
|
inlinenoexcept |
Relinquish ownership of the identifier.