26class HDF5RecordingData;
44 HDF5IO(
const std::string& fileName,
const bool disableSWMRMode =
false);
87 const std::string& path,
88 const std::string& name,
99 const std::string& path,
100 const std::string& name)
override;
110 const std::string& path,
111 const std::string& name)
override;
122 const std::string& path,
123 const std::string& name,
134 const std::string& path,
135 const std::string& name)
override;
152 const std::string& reference)
override;
161 const std::string& value)
override;
170 const std::vector<std::string>& values)
override;
180 const std::string& path,
181 const std::vector<std::string>& references)
override;
216 const std::string& path)
override;
223 std::unique_ptr<BaseRecordingData>
getDataSet(
224 const std::string& path)
override;
267 std::unique_ptr<H5::H5File> m_file;
271 bool m_disableSWMRMode;
314 const std::vector<SizeType>& positionOffset,
322 inline const H5::DataSet*
getDataSet()
const {
return m_dataset.get(); }
328 Status checkStatus(
int status);
333 std::unique_ptr<H5::DataSet> m_dataset;
AQNWB::Types::SizeType SizeType
Definition BaseIO.hpp:16
AQNWB::Types::SizeArray SizeArray
Definition BaseIO.hpp:15
Represents a base data type.
Definition BaseIO.hpp:35
The BaseIO class is an abstract base class that defines the interface for input/output (IO) operation...
Definition BaseIO.hpp:92
The base class to represent recording data that can be extended.
Definition BaseIO.hpp:379
The HDF5IO class provides an interface for reading and writing data to HDF5 files.
Definition HDF5IO.hpp:33
Status stopRecording() override
Stops the recording process.
Definition HDF5IO.cpp:402
Status createGroup(const std::string &path) override
Creates a new group in the file.
Definition HDF5IO.cpp:276
std::unique_ptr< BaseRecordingData > createArrayDataSet(const BaseDataType &type, const SizeArray &size, const SizeArray &chunking, const std::string &path) override
Creates an extendable dataset with a given base data type, size, chunking, and path.
Definition HDF5IO.cpp:465
Status createLink(const std::string &path, const std::string &reference) override
Creates a soft link to another location in the file.
Definition HDF5IO.cpp:303
Status createAttribute(const BaseDataType &type, const void *data, const std::string &path, const std::string &name, const SizeType &size=1) override
Creates an attribute at a given location in the file.
Definition HDF5IO.cpp:85
Status createReferenceDataSet(const std::string &path, const std::vector< std::string > &references) override
Creates a dataset that holds an array of references to groups within the file.
Definition HDF5IO.cpp:317
static H5::DataType getNativeType(BaseDataType type)
Returns the HDF5 native data type for a given base data type.
Definition HDF5IO.cpp:526
~HDF5IO()
Destructor for the HDF5IO class.
Definition HDF5IO.cpp:24
Status startRecording() override
Start SWMR write to start recording process.
Definition HDF5IO.cpp:390
static H5::DataType getH5Type(BaseDataType type)
Returns the HDF5 data type for a given base data type.
Definition HDF5IO.cpp:577
Status createReferenceAttribute(const std::string &referencePath, const std::string &path, const std::string &name) override
Sets an object reference attribute for a given location in the file.
Definition HDF5IO.cpp:221
Status close() override
Closes the file.
Definition HDF5IO.cpp:60
bool canModifyObjects() override
Checks whether the file is in a mode where objects can be added or deleted. Note, this does not apply...
Definition HDF5IO.cpp:413
std::unique_ptr< BaseRecordingData > getDataSet(const std::string &path) override
Returns a pointer to a dataset at a given path.
Definition HDF5IO.cpp:442
HDF5IO(const std::string &fileName, const bool disableSWMRMode=false)
Constructor for the HDF5IO class that takes a file name as input.
Definition HDF5IO.cpp:18
Status createStringDataSet(const std::string &path, const std::string &value) override
Creates a non-modifiable dataset with a string value.
Definition HDF5IO.cpp:352
H5O_type_t getObjectType(const std::string &path)
Returns the HDF5 type of object at a given path.
Definition HDF5IO.cpp:509
Status open() override
Opens an existing file or creates a new file for writing.
Definition HDF5IO.cpp:29
Status flush() override
Flush data to disk.
Definition HDF5IO.cpp:79
Status createGroupIfDoesNotExist(const std::string &path) override
Creates a new group if it does not exist.
Definition HDF5IO.cpp:290
bool objectExists(const std::string &path) override
Checks whether a Dataset, Group, or Link already exists at the location in the file.
Definition HDF5IO.cpp:432
Represents an HDF5 Dataset that can be extended indefinitely in blocks.
Definition HDF5IO.hpp:282
const H5::DataSet * getDataSet() const
Gets a const pointer to the HDF5 dataset.
Definition HDF5IO.hpp:322
HDF5RecordingData(const HDF5RecordingData &)=delete
Deleted copy constructor to prevent construction-copying.
Status writeDataBlock(const std::vector< SizeType > &dataShape, const std::vector< SizeType > &positionOffset, const BaseDataType &type, const void *data)
Writes a block of data to the HDF5 dataset.
Definition HDF5IO.cpp:659
~HDF5RecordingData()
Destroys the HDF5RecordingData object.
Definition HDF5IO.cpp:653
HDF5RecordingData & operator=(const HDF5RecordingData &)=delete
Deleted copy assignment operator to prevent copying.
HDF5RecordingData(std::unique_ptr< H5::DataSet > data)
Constructs an HDF5RecordingData object.
Definition HDF5IO.cpp:629
Status
Represents the status of an operation.
Definition Types.hpp:22
Namespace for all components of the HDF5 I/O backend.