My Project
|
Class handling simple output to HDF5. More...
#include <HDF5File.hpp>
Public Types | |
enum class | OpenMode { APPEND , OVERWRITE , READ } |
Enumeration of file opening modes. More... | |
enum class | DataSetMode { ROOT_ONLY , PROCESS_SPLIT } |
Enumeration of dataset modes. More... | |
Public Member Functions | |
HDF5File (const std::string &fileName, OpenMode mode, Parallel::Communication comm) | |
Opens HDF5 file for I/O. More... | |
~HDF5File () | |
Destructor clears up any opened files. | |
void | write (const std::string &group, const std::string &dset, const std::vector< char > &buffer, DataSetMode mode=DataSetMode::PROCESS_SPLIT) const |
Write a char buffer to a specified location in file. More... | |
void | read (const std::string &group, const std::string &dset, std::vector< char > &buffer, DataSetMode Mode=DataSetMode::PROCESS_SPLIT) const |
Read a char buffer from a specified location in file. More... | |
std::vector< std::string > | list (const std::string &group) const |
Lists the entries in a given group. More... | |
Class handling simple output to HDF5.
|
strong |
|
strong |
Opm::HDF5File::HDF5File | ( | const std::string & | fileName, |
OpenMode | mode, | ||
Parallel::Communication | comm | ||
) |
Opens HDF5 file for I/O.
fileName | Name of file to open |
mode | Open mode for file |
std::vector< std::string > Opm::HDF5File::list | ( | const std::string & | group | ) | const |
Lists the entries in a given group.
Note: Both datasets and subgroups are returned
void Opm::HDF5File::read | ( | const std::string & | group, |
const std::string & | dset, | ||
std::vector< char > & | buffer, | ||
DataSetMode | Mode = DataSetMode::PROCESS_SPLIT |
||
) | const |
Read a char buffer from a specified location in file.
group | Group ("directory") to read data from |
dset | Data set ("file") to read data from |
buffer | Vector to store read data in |
Throws exception on failure
void Opm::HDF5File::write | ( | const std::string & | group, |
const std::string & | dset, | ||
const std::vector< char > & | buffer, | ||
DataSetMode | mode = DataSetMode::PROCESS_SPLIT |
||
) | const |
Write a char buffer to a specified location in file.
group | Group ("directory") to write data to |
dset | Data set ("file") to write data to |
buffer | Data to write |
Throws exception on failure