Skip to content

Commit

Permalink
Update member in HDF5RecordingData
Browse files Browse the repository at this point in the history
  • Loading branch information
oruebel committed Sep 19, 2024
1 parent 476d7c7 commit 131a914
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions src/hdf5/HDF5IO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -653,15 +653,15 @@ HDF5RecordingData::HDF5RecordingData(std::unique_ptr<H5::DataSet> data)
this->nDimensions = nDimensions;
this->position = std::vector<SizeType>(
nDimensions, 0); // Initialize position with 0 for each dimension
this->dSet = std::make_unique<H5::DataSet>(*data);
this->m_dataset = std::make_unique<H5::DataSet>(*data);
}

// HDF5RecordingData

HDF5RecordingData::~HDF5RecordingData()
{
// Safety
dSet->flush(H5F_SCOPE_GLOBAL);
this->m_dataset->flush(H5F_SCOPE_GLOBAL);
}

Status HDF5RecordingData::writeDataBlock(
Expand Down Expand Up @@ -690,10 +690,10 @@ Status HDF5RecordingData::writeDataBlock(
}

// Adjust dataset dimensions if necessary
dSet->extend(dSetDims.data());
this->m_dataset->extend(dSetDims.data());

// Set size to new size based on updated dimensionality
DataSpace fSpace = dSet->getSpace();
DataSpace fSpace = this->m_dataset->getSpace();
fSpace.getSimpleExtentDims(dSetDims.data());
for (int i = 0; i < nDimensions; ++i) {
size[i] = dSetDims[i];
Expand All @@ -716,7 +716,7 @@ Status HDF5RecordingData::writeDataBlock(

// Write the data
DataType nativeType = HDF5IO::getNativeType(type);
dSet->write(data, nativeType, mSpace, fSpace);
this->m_dataset->write(data, nativeType, mSpace, fSpace);

// Update position for simple extension
for (int i = 0; i < dataShape.size(); ++i) {
Expand All @@ -734,5 +734,5 @@ Status HDF5RecordingData::writeDataBlock(

const H5::DataSet* HDF5RecordingData::getDataSet()
{
return dSet.get();
return this->m_dataset.get();
};
8 changes: 4 additions & 4 deletions src/hdf5/HDF5IO.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,13 @@ class HDF5RecordingData : public BaseRecordingData

private:
/**
* @brief Pointer to an extendable HDF5 dataset
* @brief Return status of HDF5 operations.
*/
std::unique_ptr<H5::DataSet> dSet;
Status checkStatus(int status);

/**
* @brief Return status of HDF5 operations.
* @brief Pointer to an extendable HDF5 dataset
*/
Status checkStatus(int status);
std::unique_ptr<H5::DataSet> m_dataset;
};
} // namespace AQNWB::HDF5

0 comments on commit 131a914

Please sign in to comment.