|
H5CPP
v1.14.0
Modern C++ templates for HDF5 serial and parallel I/O
|
|
Open or create HDF5 files. RAII-managed handles close automatically on scope exit.
H5CPP exposes two free functions for the HDF5 file lifecycle — h5::open and h5::create — both returning an h5::fd_t RAII handle. There is no explicit h5::close(fd): let the handle go out of scope and H5Fclose runs automatically.
h5::fd_t is the entry point for everything else — datasets, attributes, and groups all open relative to an fd_t. See Object handles for the broader handle taxonomy and the conversion rules to/from raw hid_t.
h5::fd_t destruct, or static_cast<::hid_t> to consume)Both calls take optional property lists to tune low-level behaviour (cache size, MPI communicator, file driver, …); the defaults work for the common cases.
h5::fd_t follows the rule-of-five RAII contract from Object handles. Copies share the underlying HDF5 reference (via H5Iinc_ref); moves transfer ownership without bumping the refcount; destruction calls H5Fclose only when the last reference goes away.
Practical implication: passing an h5::fd_t by value to a function is cheap (refcount bump, no copy of file data) and the file stays open for as long as any handle exists.
h5::*_t taxonomyh5::fd_t ↔ hid_tfcpl_t / fapl_t referenceh5::error::io::file::* hierarchy