aqnwb 0.1.0
Loading...
Searching...
No Matches
Data.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4
5#include "io/BaseIO.hpp"
7
8namespace AQNWB::NWB
9{
13class Data : public RegisteredType
14{
15public:
16 // Register Data class as a registered type
17 REGISTER_SUBCLASS(Data, "hdmf-common")
18
19
25 Data(const std::string& path, std::shared_ptr<IO::BaseIO> io);
26
30 ~Data() {}
31
40 void initialize(std::unique_ptr<IO::BaseRecordingData>&& dataset);
41
45 inline bool isInitialized() { return m_dataset != nullptr; }
46
47 std::unique_ptr<IO::BaseRecordingData> m_dataset;
48
49 // Define the data fields to expose for lazy read access
50 DEFINE_FIELD(readData, DatasetField, std::any, "", The main data)
51
54 std::string,
55 "neurodata_type",
56 The name of the type)
57
60 std::string,
61 "namespace",
62 The name of the namespace)
63};
64} // namespace AQNWB::NWB
#define REGISTER_SUBCLASS(T, NAMESPACE)
Macro to register a subclass with the RegisteredType class registry.
Definition RegisteredType.hpp:321
#define DEFINE_FIELD(name, storageObjectType, default_type, fieldPath, description)
Defines a lazy-loaded field accessor function.
Definition RegisteredType.hpp:355
~Data()
Destructor.
Definition Data.hpp:30
bool isInitialized()
Check whether the m_dataset has been initialized.
Definition Data.hpp:45
void initialize(std::unique_ptr< IO::BaseRecordingData > &&dataset)
Initialize the dataset for the Data object.
Definition Data.cpp:15
std::unique_ptr< IO::ReadDataWrapper< AttributeField, VTYPE > > readNeurodataType() const
std::unique_ptr< IO::ReadDataWrapper< AttributeField, VTYPE > > readNamespace() const
std::unique_ptr< IO::BaseRecordingData > m_dataset
Definition Data.hpp:47
Data(const std::string &path, std::shared_ptr< IO::BaseIO > io)
Constructor.
Definition Data.cpp:10
std::unique_ptr< IO::ReadDataWrapper< DatasetField, VTYPE > > readData() const
RegisteredType(const std::string &path, std::shared_ptr< IO::BaseIO > io)
Constructor.
Definition RegisteredType.cpp:8
Namespace for all classes related to the NWB data standard.
Definition TimeSeries.hpp:12
constexpr auto AttributeField
Alias for AQNWB::Types::StorageObjectType::Attribute.
Definition RegisteredType.hpp:22
constexpr auto DatasetField
Alias for AQNWB::Types::StorageObjectType::Dataset.
Definition RegisteredType.hpp:27