1#ifndef UTOPIA_DATAIO_HDFFILE_HH
2#define UTOPIA_DATAIO_HDFFILE_HH
7#include <unordered_map>
100 "Opening file at {} with access specifier {}", path,
access);
103 throw std::runtime_error(
104 "File still bound to another HDF5 file when trying to call "
105 "'open'. Close first.");
151 throw std::invalid_argument(
"wrong type of access specifier, "
152 "see documentation for allowed "
156 _base_group = std::make_shared< HDFGroup >(*
this,
"/");
164 std::shared_ptr< HDFGroup >
178 std::shared_ptr< HDFGroup >
185 path = path.substr(1, path.size() - 1);
198 std::shared_ptr< HDFDataset >
200 std::vector< hsize_t > capacity = {},
208 path = path.substr(1, path.size() - 1);
223 _base_group->delete_group(std::forward< std::string&& >(path));
Class representing a HDF5 file.
Definition hdffile.hh:62
HDFFile & operator=(const HDFFile &other)=delete
Copy assignment operator, explicitly deleted, hence cannot be used.
void open(std::string path, std::string access)
Open a file at location 'path' with access specifier 'access'. Keep in mind that if the object refers...
Definition hdffile.hh:97
void flush()
Initiates an immediate write to disk of the data of the file.
Definition hdffile.hh:230
HDFFile(HDFFile &&other)=default
Move constructor Construct a new HDFFile object via move semantics.
HDFFile(const HDFFile &other)=delete
Copy constructor. Explicitly deleted, hence cannot be used.
std::shared_ptr< HDFGroup > get_basegroup()
Get the basegroup object via shared ptr.
Definition hdffile.hh:165
std::shared_ptr< HDFGroup > open_group(std::string path)
Open group at path 'path', creating all intermediate objects in the path. Separation character is: /.
Definition hdffile.hh:179
HDFFile()=default
Construct a new default HDFFile object.
HDFFile(std::string path, std::string access)
Construct a new HDFFile object.
Definition hdffile.hh:289
HDFFile & operator=(HDFFile &&other)=default
Move assigment operator.
virtual ~HDFFile()=default
Destroy the HDFFile object.
std::shared_ptr< HDFGroup > _base_group
Pointer to base group of the file.
Definition hdffile.hh:68
void swap(HDFFile &other)
Function for exchanging states.
Definition hdffile.hh:77
void delete_group(std::string &&path)
deletes the group pointed to by absolute path 'path'
Definition hdffile.hh:221
std::shared_ptr< HDFDataset > open_dataset(std::string path, std::vector< hsize_t > capacity={}, std::vector< hsize_t > chunksizes={}, std::size_t compresslevel=0)
open dataset
Definition hdffile.hh:199
Common base class for all HDF5 classes in the DATAIO Module i.e., for all classes that wrap HDF5-C-Li...
Definition hdfobject.hh:37
virtual bool is_valid() const
Check if the object is still valid.
Definition hdfobject.hh:143
std::shared_ptr< spdlog::logger > _log
pointer to the logger for dataio
Definition hdfobject.hh:56
hid_t get_C_id() const
Get the C id object.
Definition hdfobject.hh:120
void bind_to(hid_t id, std::function< herr_t(hid_t) > closing_func, std::string path={})
Open the object and bind it to a HDF5 object identified by 'id' with name 'path'. Object should be cr...
Definition hdfobject.hh:186
void swap(WriteTask< BGB, DW, DB, AWG, AWD > &lhs, WriteTask< BGB, DW, DB, AWG, AWD > &rhs)
Swaps the state of lhs and rhs.
Definition write_task.hh:240
Container select_entities(const Manager &mngr, const DataIO::Config &sel_cfg)
Select entities according to parameters specified in a configuration.
Definition select.hh:213
std::shared_ptr< spdlog::logger > init_logger(const std::string name, const spdlog::level::level_enum level, const bool throw_on_exist=true)
Initialize a logger with a certain name and log level.
Definition logging.hh:31
const std::string log_data_io
Definition logging.hh:19
This is the central file of the HDF5 dataIO module of Utopia and provides a class for writing to,...
This file provides a class for creating and managing groups in a HDF5 file, which then can create oth...
This file provides metafunctions for automatically determining the nature of a C/C++ types at compile...