Create, open, and close an HDF5 container. In POSIX terms an HDF5 container is the entire image of a file system and the dataset is a document within. Datasets are manipulated via h5::create / h5::read / h5::write / h5::append. File operations map directly onto HDF5 CAPI calls but are furnished with RAII and type safety. How the returned managed handles may be passed to CAPI calls is governed by the H5CPP conversion policy. h5::mute | h5::unmute are miscellaneous thread-safe calls for the rare occasions when you need to turn HDF5 CAPI error-handler output off and on — typically used when failure is information (checking existence of a dataset / path by the call-fail pattern, etc.).
- See also
- H5Fcreate H5Fopen H5Fclose H5Dopen H5Dclose gzip CAPI
◆ open() [1/2]
Open an existing HDF5 dataset by path.
Returns an RAII-managed h5::ds_t handle; the underlying CAPI id is closed via H5Dclose on scope exit. Use h5::read<T>(ds, ...) to fetch values or h5::write(ds, ...) to update them.
If the dataset's creation property list carries the h5cpp high-throughput pipeline tag (H5CPP_DAPL_HIGH_THROUGHPUT), the pipeline's per-chunk cache is initialised here from the dataset's element size, so subsequent reads/writes pick up the pre-warmed filter chain transparently.
- Parameters
-
| fd | valid open h5::fd_t file descriptor |
| path | path to the HDF5 object (file path for file open/create; dataset path for dataset open) |
| dapl | dataset access property list (h5::dapl_t) |
- Returns
- open
h5::ds_t dataset descriptor; throws h5::error on failure
- Exceptions
-
| h5::error::io::dataset::open | on H5Dopen2 failure (dataset does not exist, file not opened for read, invalid dapl). |
example:
T aread(const hid_t &ds, const std::string &name, const h5::acpl_t &acpl=h5::default_acpl)
Read an attribute by name and return its value as type T.
Definition H5Aread.hpp:76
h5::at_t open(const hid_t &parent, const std::string &path, const h5::acpl_t &acpl=h5::default_acpl)
Open an existing attribute by name on a parent HDF5 object.
Definition H5Aopen.hpp:56
- See also
- h5::open h5::read h5::write h5::fd_t h5::ds_t h5::err_t
-
H5Fcreate H5Fopen H5Fclose H5Dopen H5Dclose gzip CAPI
-
h5::create h5::read h5::write Handles, Descriptors, and Property Lists
◆ mute()
◆ unmute()
◆ create()
creates an HDF5 file with given set of properties and returns a managed h5::fd_t resource handle. Depending on active conversion policy h5::fd_t may be passed implicitly,explicitly or not at all to HDF5 CAPI calls.
- Parameters
-
| path | path to the HDF5 object (file path for file open/create; dataset path for dataset open) |
| flags | file create flags: H5F_ACC_TRUNC | H5F_ACC_EXCL | H5F_ACC_DEBUG |
| fcpl | file creation property list — controls file meta-data layout |
| fapl | file access property list — controls file driver and parallel I/O settings |
- Returns
- open
h5::fd_t file descriptor; throws h5::error on failure
- See also
- h5::open h5::read h5::write h5::fd_t h5::ds_t h5::err_t
-
H5Fcreate H5Fopen H5Fclose H5Dopen H5Dclose gzip CAPI
-
RAII pointers static_cast std::runtime_error std::unique_ptr
{
}
{
}
h5::at_t create(const hid_t &parent, const std::string &path, args_t &&... args)
Create a new attribute of element type T on a parent HDF5 object.
Definition H5Acreate.hpp:100
◆ open() [2/2]
opens an existing HDF5 file, the returned h5::fd_t descriptor automatically closes backed resource when leaving code block The h5::fd_t is a thin hid_t size object with std::unique_ptr like properties.
- Parameters
-
| path | path to the HDF5 object (file path for file open/create; dataset path for dataset open) |
| flags | file open flags: H5F_ACC_RDWR | H5F_ACC_RDONLY |
| fapl | file access property list — controls file driver and parallel I/O settings |
- Returns
- open
h5::fd_t file descriptor; throws h5::error on failure
- See also
- h5::open h5::read h5::write h5::fd_t h5::ds_t h5::err_t
-
H5Fcreate H5Fopen H5Fclose H5Dopen H5Dclose gzip CAPI
-
RAII pointers static_cast std::runtime_error std::unique_ptr