6 #ifndef ECHELON_GROUP_HPP 7 #define ECHELON_GROUP_HPP 9 #include <echelon/object.hpp> 10 #include <echelon/type.hpp> 11 #include <echelon/attribute_repository.hpp> 12 #include <echelon/dataset.hpp> 13 #include <echelon/scalar_dataset.hpp> 14 #include <echelon/object_reference.hpp> 15 #include <echelon/link.hpp> 17 #include <echelon/hdf5/group.hpp> 18 #include <echelon/hdf5/type_factory.hpp> 31 using hdf5::unlimited;
47 auto_chunking_ = value;
60 compression_level_ = value;
69 shuffle_filter_ = value;
82 chunk_shape_ = std::move(value);
91 return auto_chunking_;
98 return compression_level_;
105 return shuffle_filter_;
116 bool auto_chunking_ =
false;
117 int compression_level_ = -1;
118 bool shuffle_filter_ =
false;
119 std::vector<hsize_t> chunk_shape_ = {};
145 group create_group(
const std::string& name);
162 dataset create_dataset(
const std::string& name,
const type& datatype,
184 dataset create_dataset(
const std::string& name,
const type& datatype,
185 const std::vector<hsize_t>& dims,
const std::vector<hsize_t>& max_dims,
205 template <
typename T>
209 return create_dataset(name,
type(hdf5::get_hdf5_type<T>()), dims, options);
233 template <
typename T>
235 const std::vector<hsize_t>& max_dims,
238 return create_dataset(name,
type(hdf5::get_hdf5_type<T>()), dims, max_dims, options);
259 template <
typename T>
262 return create_scalar_dataset(name,
type(hdf5::get_hdf5_type<T>()));
276 template <
typename T>
292 object operator[](
const std::string& name)
const;
299 void remove(
const std::string& name)
const;
309 group require_group(
const std::string& name);
341 dataset require_dataset(
const std::string& name,
const type& datatype,
376 template <
typename T>
380 return require_dataset(name,
type(hdf5::get_hdf5_type<T>()), dims, options);
431 template <
typename T>
434 return require_scalar_dataset(name,
type(hdf5::get_hdf5_type<T>()));
463 template <
typename T>
466 return require_scalar_dataset(name, value);
474 void iterate_links(
const std::function<
void(
const link&)>& op)
const;
481 void visit_links(
const std::function<
void(
const link&)>& visitor)
const;
489 void visit_objects(
const std::function<
void(
const object&)>& visitor)
const;
501 explicit operator bool()
const;
503 friend class constructor_access;
506 enum class creation_mode
512 explicit group(
const file& loc,
const std::string& name =
"/");
514 dataset create_dataset(
const std::string& name,
const type& datatype,
515 const std::vector<hsize_t>& dims,
const std::vector<hsize_t>& max_dims,
echelon's core namespace
Definition: attribute.cpp:10
A handle to a group object.
Definition: group.hpp:125
A handle to an HDF5 scalar dataset.
Definition: scalar_dataset.hpp:23
Attribute manager, which should be embedded into a parent object, which supports attributes.
Definition: attribute_repository.hpp:27
dataset_options & shuffle_filter(bool value)
Enables/disables the shuffle filter.
Definition: group.hpp:67
dataset create_dataset(const std::string &name, const std::vector< hsize_t > &dims, const std::vector< hsize_t > &max_dims, const dataset_options &options=dataset_options())
Creates a new dataset within this group.
Definition: group.hpp:234
dataset require_dataset(const std::string &name, const std::vector< hsize_t > &dims, const dataset_options &options=dataset_options())
Returns the requested dataset, if it already exists, otherwise a new dataset is created.
Definition: group.hpp:377
dataset_options & auto_chunking(bool value)
Enables/Disables auto-chunking.
Definition: group.hpp:45
scalar_dataset create_scalar_dataset(const std::string &name)
Creates a new scalar dataset within this group.
Definition: group.hpp:260
A handle to an HDF5 type.
Definition: type.hpp:21
A handle to an HDF5 group object.
Definition: hdf5/group.hpp:161
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: group.hpp:464
bool auto_chunking() const
auto-chunking option
Definition: group.hpp:89
scalar_dataset create_scalar_dataset(const std::string &name, const T &value)
Creates a new scalar dataset within this group and initializes it with a given value.
Definition: group.hpp:277
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: group.hpp:432
Polymorphic handle to an HDF5 object.
Definition: object.hpp:25
dataset_options & chunk_shape(std::vector< hsize_t > value)
Sets the chunk shape of the dataset.
Definition: group.hpp:80
const std::vector< hsize_t > & chunk_shape() const
chunk shape
Definition: group.hpp:110
A link (directed edge) between two HDF5 objects.
Definition: link.hpp:20
bool shuffle_filter() const
shuffle filter option
Definition: group.hpp:103
int compression_level() const
gzip compression level
Definition: group.hpp:96
A handle to a file object.
Definition: file.hpp:27
dataset create_dataset(const std::string &name, const std::vector< hsize_t > &dims, const dataset_options &options=dataset_options())
Creates a new dataset within this group.
Definition: group.hpp:206
Additional options for the dataset creation.
Definition: group.hpp:36
A reference to an HDF5 object.
Definition: object_reference.hpp:24
A handle to an echelon dataset.
Definition: dataset.hpp:33
dataset_options & compression_level(int value)
Sets the gzip compression level (0 - 9) of the dataset.
Definition: group.hpp:58