6 #ifndef ECHELON_HDF5_FILE_HPP 7 #define ECHELON_HDF5_FILE_HPP 9 #include <echelon/hdf5/group.hpp> 10 #include <echelon/hdf5/link.hpp> 11 #include <echelon/hdf5/precursor/file.hpp> 112 template <
typename T>
116 return root_group_.create_dataset<T>(name, dims, options);
137 template <
typename T>
140 return root_group_.create_scalar_dataset<T>(name);
154 template <
typename T>
157 return root_group_.create_scalar_dataset(name, value);
166 object operator[](
const std::string& name)
const;
173 void remove(
const std::string& name)
const;
214 const std::vector<hsize_t>& dims,
const dataset_options& options = {});
246 template <
typename T>
250 return root_group_.require_dataset<T>(name, dims, options);
301 template <
typename T>
304 return root_group_.require_scalar_dataset<T>(name);
333 template <
typename T>
336 return root_group_.require_scalar_dataset(name, value);
351 void visit_links(
const std::function<
void(
const link&)>& visitor)
const;
359 void visit_objects(
const std::function<
void(
const object&)>& visitor)
const;
373 explicit operator bool()
const;
375 hdf5::precursor::file file_wrapper_;
404 group mount(
const file& mounted_file,
const file& mount_point);
412 void unmount(
const group& mount_point);
echelon's core namespace
Definition: attribute.cpp:10
A handle to an HDF5 dataset.
Definition: hdf5/dataset.hpp:62
scalar_dataset require_scalar_dataset(const std::string &name, const T &value)
Returns the requested scalar dataset, if it already exists, otherwise a new scalar dataset is created...
Definition: hdf5/file.hpp:334
Raise an error, if the file already exists.
scalar_dataset create_scalar_dataset(const std::string &name, const type &datatype)
Creates a new HDF5 scalar dataset within the root group.
Definition: hdf5/file.cpp:41
void visit_objects(const std::function< void(const object &)> &visitor) const
Visits every object, which is reachable from the root group (including the root group) ...
Definition: hdf5/file.cpp:82
A handle to an HDF5 group object.
Definition: hdf5/group.hpp:161
object operator[](const std::string &name) const
Accessor function for the root group.
Definition: hdf5/file.cpp:46
A handle to an HDF5 file object.
Definition: hdf5/file.hpp:26
scalar_dataset require_scalar_dataset(const std::string &name, const type &datatype)
Returns the requested scalar dataset, if it already exists, otherwise a new scalar dataset is created...
Definition: hdf5/file.cpp:67
create_mode
Definition: hdf5/file.hpp:35
object_reference ref() const
A HDF5 object reference to the root group.
Definition: hdf5/file.cpp:87
void iterate_links(const std::function< void(const link &)> &op) const
Iterates over every link within the root group.
Definition: hdf5/file.cpp:72
dataset create_dataset(const std::string &name, const type &datatype, const std::vector< hsize_t > &dims, const dataset_options &options={})
Creates a new HDF5 dataset within the root group.
Definition: hdf5/file.cpp:35
A link (directed edge) between two HDF5 objects.
Definition: hdf5/link.hpp:18
scalar_dataset create_scalar_dataset(const std::string &name, const T &value)
Creates a new HDF5 scalar dataset within the root group and initializes it with a given value...
Definition: hdf5/file.hpp:155
group create_group(const std::string &name)
Creates a new HDF5 group within the root group.
Definition: hdf5/file.cpp:30
A handle to an HDF5 type.
Definition: hdf5/type.hpp:23
Attribute manager, which should be embedded into a parent object, which supports attributes.
Definition: hdf5/attribute_repository.hpp:52
group require_group(const std::string &name)
Returns the requested group, if it already exists, otherwise a new group is created.
Definition: hdf5/file.cpp:56
dataset require_dataset(const std::string &name, const type &datatype, const std::vector< hsize_t > &dims, const dataset_options &options={})
Returns the requested dataset, if it already exists, otherwise a new dataset is created.
Definition: hdf5/file.cpp:61
open_mode
Definition: hdf5/file.hpp:43
A reference to an HDF5 object.
Definition: hdf5/object_reference.hpp:25
const native_handle_type & native_handle() const
The underlying HDF5 low-level handle.
Definition: hdf5/file.cpp:92
dataset require_dataset(const std::string &name, const std::vector< hsize_t > &dims, const dataset_options &options={})
Returns the requested dataset, if it already exists, otherwise a new dataset is created.
Definition: hdf5/file.hpp:247
scalar_dataset require_scalar_dataset(const std::string &name)
Returns the requested scalar dataset, if it already exists, otherwise the scalar dataset is created...
Definition: hdf5/file.hpp:302
A handle to an HDF5 scalar dataset.
Definition: hdf5/scalar_dataset.hpp:27
scalar_dataset create_scalar_dataset(const std::string &name)
Creates a new HDF5 scalar dataset within the root group.
Definition: hdf5/file.hpp:138
Additional options for the dataset creation.
Definition: hdf5/group.hpp:72
Truncate any pre-existing file.
dataset create_dataset(const std::string &name, const std::vector< hsize_t > &dims, const dataset_options &options={})
Creates a new HDF5 dataset within the root group.
Definition: hdf5/file.hpp:113
attribute_repository< group > attributes() const
The attributes, which are attached to the root group.
Definition: hdf5/file.cpp:102
hdf5::precursor::file native_handle_type
Type of the underlying HDF5 low-level handle.
Definition: hdf5/file.hpp:31
void visit_links(const std::function< void(const link &)> &visitor) const
Visits every link, which is reachable from the root group.
Definition: hdf5/file.cpp:77
file()=default
Initializes the handle with its null state.