15inline Compression::Compression(
bool enable) {
17 m_compression_level = 9;
19 m_compression_level = 0;
24inline Compression::Compression(T level)
25 : m_compression_level(static_cast<unsigned>(level)) {}
27inline unsigned Compression::get()
const {
28 return m_compression_level;
31inline void DumpOptions::set(DumpMode mode) {
32 m_overwrite =
static_cast<bool>(mode);
35inline void DumpOptions::set(Flush mode) {
36 m_flush =
static_cast<bool>(mode);
39inline void DumpOptions::set(
const Compression& level) {
40 m_compression_level = level.get();
43template <
class T,
class... Args>
44inline void DumpOptions::set(T arg, Args... args) {
50inline void DumpOptions::setChunkSize(
const std::vector<T>& shape) {
51 m_chunk_size = std::vector<hsize_t>(shape.begin(), shape.end());
54inline void DumpOptions::setChunkSize(std::initializer_list<size_t> shape) {
55 m_chunk_size = std::vector<hsize_t>(shape.begin(), shape.end());
58inline bool DumpOptions::overwrite()
const {
62inline bool DumpOptions::flush()
const {
66inline bool DumpOptions::compress()
const {
67 return m_compression_level > 0;
70inline unsigned DumpOptions::getCompressionLevel()
const {
71 return m_compression_level;
74inline bool DumpOptions::isChunked()
const {
75 return m_chunk_size.size() > 0;
78inline std::vector<hsize_t> DumpOptions::getChunkSize()
const {
82inline size_t getSize(
const File& file,
const std::string& path) {
83 return file.getDataSet(path).getElementCount();
86inline std::vector<size_t>
getShape(
const File& file,
const std::string& path) {
87 return file.getDataSet(path).getDimensions();
91inline DataSet
dump(File& file,
92 const std::string& path,
94 const DumpOptions& options) {
95 return detail::io_impl<T>::dump(file, path, data, options);
99inline DataSet
dump(File& file,
const std::string& path,
const T& data, DumpMode mode) {
100 return detail::io_impl<T>::dump(file, path, data, DumpOptions(mode));
105 const std::string& path,
107 const std::vector<size_t>& idx,
108 const DumpOptions& options) {
109 return detail::io_impl<T>::dump_extend(file, path, data, idx, options);
114 const std::string& path,
116 const std::initializer_list<size_t>& idx,
117 const DumpOptions& options) {
118 return detail::io_impl<T>::dump_extend(file, path, data, idx, options);
123 const std::string& path,
125 const std::vector<size_t>& idx) {
126 return detail::io_impl<T>::dump_extend(file, path, data, idx, DumpOptions());
131 const std::string& path,
133 const std::initializer_list<size_t>& idx) {
134 return detail::io_impl<T>::dump_extend(file, path, data, idx, DumpOptions());
138inline T
load(
const File& file,
const std::string& path,
const std::vector<size_t>& idx) {
139 return detail::io_impl<T>::load_part(file, path, idx);
143inline T
load(
const File& file,
const std::string& path) {
144 return detail::io_impl<T>::load(file, path);
149 const std::string& path,
150 const std::string& key,
153 return detail::io_impl<T>::dumpAttribute(file, path, key, data, DumpOptions(mode));
158 const std::string& path,
159 const std::string& key,
161 const DumpOptions& options) {
162 return detail::io_impl<T>::dumpAttribute(file, path, key, data, options);
166inline T
loadAttribute(
const File& file,
const std::string& path,
const std::string& key) {
167 return detail::io_impl<T>::loadAttribute(file, path, key);
Definition H5Easy_Eigen.hpp:17
size_t getSize(const File &file, const std::string &path)
Definition H5Easy_public.hpp:82
T loadAttribute(const File &file, const std::string &path, const std::string &key)
Definition H5Easy_public.hpp:166
DataSet dump(File &file, const std::string &path, const T &data, const DumpOptions &options)
Definition H5Easy_public.hpp:91
T load(const File &file, const std::string &path, const std::vector< size_t > &idx)
Definition H5Easy_public.hpp:138
std::vector< size_t > getShape(const File &file, const std::string &path)
Definition H5Easy_public.hpp:86
Attribute dumpAttribute(File &file, const std::string &path, const std::string &key, const T &data, DumpMode mode)
Definition H5Easy_public.hpp:148