|
| | Handle ()=default |
| | Construct an empty owner with identifier -1 and file close kind.
|
| |
| | Handle (hid_t id, Kind kind) |
| | Adopt an HDF5 identifier with its matching close operation.
|
| |
| | Handle (const Handle &)=delete |
| |
| Handle & | operator= (const Handle &)=delete |
| |
| | Handle (Handle &&o) noexcept |
| | Transfer identifier ownership from another handle.
|
| |
| Handle & | operator= (Handle &&o) noexcept |
| | Close this handle and transfer ownership from another.
|
| |
| | ~Handle () |
| | Close any owned identifier using its stored HDF5 object kind.
|
| |
| hid_t | get () const noexcept |
| | Inspect the owned identifier without transferring ownership.
|
| |
| bool | ok () const noexcept |
| | Test whether this owner stores a nonnegative identifier.
|
| |
| | operator bool () const noexcept |
| | Test whether this owner contains an identifier.
|
| |
| void | close () noexcept |
| | Close any owned identifier and mark this owner empty.
|
| |
Owns an hid_t and closes it with the right H5*close on scope exit.
HDF5 identifiers are not RAII and leak silently: a missed H5Dclose keeps the whole file object alive, so H5Fclose "succeeds" while flushing nothing.
| void openswmm::h5io::Handle::close |
( |
| ) |
|
|
noexcept |
Close any owned identifier and mark this owner empty.
Defined OUT OF LINE on purpose. HDF5 is PRIVATE-linked into the engine with hidden symbols, so a consumer that also linked its own copy would have two HDF5 instances with separate global state — the crash the CMake comments at src/engine/CMakeLists.txt warn about. Keeping every H5* call inside the engine means a caller needs these headers but not the library, and ids never cross between instances.
Calls the matching H5*close within the engine's privately linked HDF5 instance, preventing identifiers from crossing between independent library instances. Repeated calls on an empty owner do nothing.
- Note
- HDF5 close failures are ignored and the identifier is discarded anyway.