1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-15 06:17:05 +01:00

Optional RW mode for Hdf5Reader

This commit is contained in:
2018-11-21 18:36:50 +00:00
parent d77bc88170
commit 41032fef44
3 changed files with 5 additions and 5 deletions

View File

@ -61,9 +61,9 @@ Group & Hdf5Writer::getGroup(void)
}
// Reader implementation ///////////////////////////////////////////////////////
Hdf5Reader::Hdf5Reader(const std::string &fileName)
Hdf5Reader::Hdf5Reader(const std::string &fileName, const bool readOnly)
: fileName_(fileName)
, file_(fileName.c_str(), H5F_ACC_RDWR)
, file_(fileName.c_str(), readOnly ? H5F_ACC_RDONLY : H5F_ACC_RDWR)
{
group_ = file_.openGroup("/");
readSingleAttribute(dataSetThres_, HDF5_GRID_GUARD "dataset_threshold",

View File

@ -54,7 +54,7 @@ namespace Grid
class Hdf5Reader: public Reader<Hdf5Reader>
{
public:
Hdf5Reader(const std::string &fileName);
Hdf5Reader(const std::string &fileName, const bool readOnly = true);
virtual ~Hdf5Reader(void) = default;
bool push(const std::string &s);
void pop(void);