aqnwb 0.4.0
Loading...
Searching...
No Matches
BaseIO.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <algorithm>
4#include <any>
5#include <cstdint>
6#include <iostream>
7#include <memory>
8#include <string>
9#include <typeindex>
10#include <unordered_map>
11#include <unordered_set>
12#include <variant>
13#include <vector>
14
15#include "Types.hpp"
16
17#define DEFAULT_STR_SIZE 256
18#define DEFAULT_ARRAY_SIZE 1
19
24
29namespace AQNWB::IO
30{
33class BaseIO;
34} // namespace AQNWB::IO
35
36namespace AQNWB::IO
37{
38
47{
48public:
67
73 // cppcheck-suppress noExplicitConstructor
74 BaseDataType(Type t = T_I32, SizeType s = 1);
75
78
79 // handy accessors
80 static const BaseDataType U8;
81 static const BaseDataType U16;
82 static const BaseDataType U32;
83 static const BaseDataType U64;
84 static const BaseDataType I8;
85 static const BaseDataType I16;
86 static const BaseDataType I32;
87 static const BaseDataType I64;
88 static const BaseDataType F32;
89 static const BaseDataType F64;
90 static const BaseDataType DSTR;
91 static BaseDataType STR(
92 SizeType size);
93
94 // Define the equality operator
95 bool operator==(const BaseDataType& other) const
96 {
97 return type == other.type && typeSize == other.typeSize;
98 }
99
100 // Variant data type for representing a single scalar with BaseDataType values
102
103 // Variant data type for representing any 1D vector with BaseDataType values
105
117 const BaseDataType& dataType)
118 {
119 switch (dataType.type) {
120 case T_U8:
121 return std::vector<uint8_t> {};
122 case T_U16:
123 return std::vector<uint16_t> {};
124 case T_U32:
125 return std::vector<uint32_t> {};
126 case T_U64:
127 return std::vector<uint64_t> {};
128 case T_I8:
129 return std::vector<int8_t> {};
130 case T_I16:
131 return std::vector<int16_t> {};
132 case T_I32:
133 return std::vector<int32_t> {};
134 case T_I64:
135 return std::vector<int64_t> {};
136 case T_F32:
137 return std::vector<float> {};
138 case T_F64:
139 return std::vector<double> {};
140 case T_STR:
141 case V_STR:
142 return std::vector<std::string> {};
143 }
144 return std::monostate {};
145 }
146
156 {
157 const BaseDataVectorVariant expectedValues =
159 if (std::holds_alternative<std::monostate>(expectedValues)) {
160 return false;
161 }
162
163 const SizeType expectedTypeIndex = expectedValues.index();
164 return std::visit([expectedTypeIndex](const auto& values)
165 { return values.index() == expectedTypeIndex; },
166 value.value);
167 }
168
179 {
180 const BaseDataVectorVariant expectedBuffer =
182 return !std::holds_alternative<std::monostate>(expectedBuffer)
183 && buffer.index() == expectedBuffer.index();
184 }
185
194 static BaseDataType fromTypeId(const std::type_index& typeIndex)
195 {
196 if (typeIndex == typeid(uint8_t)) {
197 return BaseDataType(U8);
198 } else if (typeIndex == typeid(uint16_t)) {
199 return BaseDataType(U16);
200 } else if (typeIndex == typeid(uint32_t)) {
201 return BaseDataType(U32);
202 } else if (typeIndex == typeid(uint64_t)) {
203 return BaseDataType(U64);
204 } else if (typeIndex == typeid(int8_t)) {
205 return BaseDataType(I8);
206 } else if (typeIndex == typeid(int16_t)) {
207 return BaseDataType(I16);
208 } else if (typeIndex == typeid(int32_t)) {
209 return BaseDataType(I32);
210 } else if (typeIndex == typeid(int64_t)) {
211 return BaseDataType(I64);
212 } else if (typeIndex == typeid(float)) {
213 return BaseDataType(F32);
214 } else if (typeIndex == typeid(double)) {
215 return BaseDataType(F64);
216 } else {
217 throw std::runtime_error("Unsupported data type");
218 }
219 }
220};
221
222class DataBlockGeneric;
223
228enum class SearchMode
229{
239};
240
244enum class FileMode
245{
250
258
266};
267
277{
278public:
282 virtual ~BaseArrayDataSetConfig() = default;
283
288 virtual bool isLink() const { return false; }
289
306 virtual Status getProperties(const BaseIO* io,
307 SizeArray& shape,
308 SizeArray& chunking,
309 BaseDataType& dataType) const = 0;
310};
311
321{
322public:
331 const SizeArray& shape,
332 const SizeArray& chunking);
333
337 virtual ~ArrayDataSetConfig() override = default;
338
343 inline BaseDataType getType() const { return m_type; }
344
349 inline const SizeArray& getShape() const { return m_shape; }
350
355 inline const SizeArray& getChunking() const { return m_chunking; }
356
371 SizeArray& shape,
372 SizeArray& chunking,
373 BaseDataType& dataType) const override
374 {
375 (void)io; // Unused parameter (not needed for ArrayDataSetConfig)
376 shape = m_shape;
377 chunking = m_chunking;
378 dataType = m_type;
379 return Status::Success;
380 }
381
382protected:
383 // The data type of the dataset
385 // The shape of the dataset
387 // The chunking of the dataset
389};
390
400{
401public:
406 explicit LinkArrayDataSetConfig(const std::string& targetPath);
407
411 virtual ~LinkArrayDataSetConfig() override = default;
412
417 inline const std::string& getTargetPath() const { return m_targetPath; }
418
423 inline bool isLink() const override { return true; }
424
434 bool targetExists(const BaseIO& io) const;
435
447 SizeArray getTargetShape(const BaseIO& io) const;
448
460 SizeArray getTargetChunking(const BaseIO& io) const;
461
474 BaseDataType getTargetDataType(const BaseIO& io) const;
475
499 const BaseIO& io,
500 const std::vector<BaseDataType>& allowedTypes = {},
501 const std::vector<SizeType>& allowedDimensionalities = {},
502 const std::vector<std::string>& requiredAttributes = {}) const;
503
519 SizeArray& shape,
520 SizeArray& chunking,
521 BaseDataType& dataType) const override
522 {
523 if (!io) {
524 return Status::Failure;
525 }
526 try {
527 shape = getTargetShape(*io);
528 chunking = getTargetChunking(*io);
529 dataType = getTargetDataType(*io);
530 } catch (const std::runtime_error&) {
531 return Status::Failure;
532 }
533 return Status::Success;
534 }
535
536private:
537 // The path to the target dataset to link to
538 std::string m_targetPath;
539};
540
551{
552public:
556 BaseIO(const std::string& filename);
557
561 BaseIO(const BaseIO&) = delete;
562
566 BaseIO& operator=(const BaseIO&) = delete;
567
571 virtual ~BaseIO();
572
577 virtual std::string getFileName() const { return m_filename; }
578
587 virtual StorageObjectType getStorageObjectType(std::string path) const = 0;
588
593 virtual Status open() = 0;
594
600 virtual Status open(FileMode mode) = 0;
601
606 virtual Status close() = 0;
607
612 virtual Status flush() = 0;
613
620 virtual bool objectExists(const std::string& path) const = 0;
621
630 virtual bool attributeExists(const std::string& path) const = 0;
631
649 virtual std::vector<std::pair<std::string, StorageObjectType>>
650 getStorageObjects(const std::string& path,
651 const StorageObjectType& objectType =
652 StorageObjectType::Undefined) const = 0;
653
679 virtual std::unordered_map<std::string, std::string> findTypes(
680 const std::string& starting_path,
681 const std::unordered_set<std::string>& types,
682 SearchMode search_mode,
683 bool exclude_starting_path = false) const;
684
707 virtual std::string findObject(const std::string& name,
708 const std::string& starting_path = "/") const;
709
728 std::string getFullTypeName(const std::string& path) const;
729
745 virtual DataBlockGeneric readDataset(const std::string& dataPath,
746 const SizeArray& start = {},
747 const SizeArray& count = {},
748 const SizeArray& stride = {},
749 const SizeArray& block = {}) = 0;
750
762 virtual DataBlockGeneric readAttribute(const std::string& dataPath) const = 0;
763
770 virtual std::string readReferenceAttribute(
771 const std::string& dataPath) const = 0;
772
783 const void* data,
784 const std::string& path,
785 const std::string& name,
786 const SizeType& size = 1) = 0;
787
796 virtual Status createAttribute(const std::string& data,
797 const std::string& path,
798 const std::string& name,
799 const bool overwrite = false) = 0;
800
811 virtual Status createAttribute(const std::vector<std::string>& data,
812 const std::string& path,
813 const std::string& name,
814 const bool overwrite = false) = 0;
815
823 virtual Status createReferenceAttribute(const std::string& referencePath,
824 const std::string& path,
825 const std::string& name) = 0;
826
832 virtual Status createGroup(const std::string& path) = 0;
833
843 virtual Status createLink(const std::string& path,
844 const std::string& reference) = 0;
845
852 virtual Status createStringDataSet(const std::string& path,
853 const std::string& value) = 0;
854
862 const std::string& path, const std::vector<std::string>& values) = 0;
863
872 const std::string& path, const std::vector<std::string>& references) = 0;
873
878 virtual Status startRecording();
879
884 virtual Status stopRecording();
885
893 virtual bool canModifyObjects() { return true; }
894
903 virtual std::unique_ptr<BaseRecordingData> createArrayDataSet(
904 const BaseArrayDataSetConfig& config, const std::string& path) = 0;
905
915 std::shared_ptr<BaseRecordingData> getDataSet(const std::string& path,
916 bool reset = false);
917
922
927 const std::unordered_map<std::string, std::shared_ptr<BaseRecordingData>>&
928 getRecordingDataCache() const;
929
937 virtual SizeArray getStorageObjectShape(const std::string& path) const = 0;
938
946 virtual SizeArray getStorageObjectChunking(const std::string& path) const = 0;
947
956 const std::string& path) const = 0;
957
965 Status createCommonNWBAttributes(const std::string& path,
966 const std::string& objectNamespace,
967 const std::string& neurodataType = "");
968
973 inline bool isOpen() const { return m_opened; }
974
979 inline bool isReadyToOpen() const { return m_readyToOpen; }
980
985 inline std::shared_ptr<RecordingObjects> getRecordingObjects() const
986 {
987 return m_recording_objects;
988 }
989
990protected:
994 const std::string m_filename;
995
1001 virtual Status createGroupIfDoesNotExist(const std::string& path) = 0;
1002
1007
1012
1018 virtual std::shared_ptr<BaseRecordingData> getDataSetImpl(
1019 const std::string& path) = 0;
1020
1025 std::shared_ptr<RecordingObjects> m_recording_objects;
1026
1030 std::unordered_map<std::string, std::shared_ptr<BaseRecordingData>>
1032};
1033
1040{
1041public:
1046
1051
1056
1060 virtual ~BaseRecordingData();
1061
1071 Status writeDataBlock(const SizeArray& dataShape,
1072 const BaseDataType& type,
1073 const void* data);
1074
1083 virtual Status writeDataBlock(const SizeArray& dataShape,
1084 const SizeArray& positionOffset,
1085 const BaseDataType& type,
1086 const void* data) = 0;
1087
1098 virtual Status writeDataBlock(const SizeArray& dataShape,
1099 const SizeArray& positionOffset,
1100 const BaseDataType& type,
1101 const std::vector<std::string>& data) = 0;
1102
1107 inline SizeType getNumDimensions() const { return m_shape.size(); }
1108
1113 inline const SizeArray& getShape() const { return m_shape; }
1114
1119 inline const SizeArray& getPosition() const { return m_position; }
1120
1121protected:
1126
1131};
1132
1133} // namespace AQNWB::IO
AQNWB::Types::StorageObjectType StorageObjectType
Definition BaseIO.hpp:20
AQNWB::Types::Status Status
Definition BaseIO.hpp:21
AQNWB::Types::SizeArray SizeArray
Definition BaseIO.hpp:22
AQNWB::Types::SizeType SizeType
Definition Channel.hpp:8
virtual ~ArrayDataSetConfig() override=default
Virtual destructor to ensure proper cleanup in derived classes.
SizeArray m_chunking
Definition BaseIO.hpp:388
SizeArray m_shape
Definition BaseIO.hpp:386
BaseDataType m_type
Definition BaseIO.hpp:384
const SizeArray & getShape() const
Returns the shape of the dataset.
Definition BaseIO.hpp:349
const SizeArray & getChunking() const
Returns the chunking of the dataset.
Definition BaseIO.hpp:355
Status getProperties(const BaseIO *io, SizeArray &shape, SizeArray &chunking, BaseDataType &dataType) const override
Gets the shape, chunking, and data type from the configuration.
Definition BaseIO.hpp:370
ArrayDataSetConfig(const BaseDataType &type, const SizeArray &shape, const SizeArray &chunking)
Constructs an ArrayDataSetConfig object with the specified type, shape, and chunking.
Definition BaseIO.cpp:37
BaseDataType getType() const
Returns the data type of the dataset.
Definition BaseIO.hpp:343
Base class for array dataset configuration.
Definition BaseIO.hpp:277
virtual ~BaseArrayDataSetConfig()=default
Virtual destructor to ensure proper cleanup in derived classes.
virtual Status getProperties(const BaseIO *io, SizeArray &shape, SizeArray &chunking, BaseDataType &dataType) const =0
Gets the shape, chunking, and data type from the configuration.
virtual bool isLink() const
Checks if this configuration represents a link.
Definition BaseIO.hpp:288
Represents a base data type.
Definition BaseIO.hpp:47
static const BaseDataType F32
Accessor for 32-bit floating point.
Definition BaseIO.hpp:88
bool isCompatibleVector(const BaseDataVectorVariant &buffer) const
Check whether a vector buffer has a type compatible with this data type.
Definition BaseIO.hpp:178
AQNWB::Types::VectorDataVariant BaseDataVectorVariant
Definition BaseIO.hpp:104
static const BaseDataType I64
Accessor for signed 64-bit integer.
Definition BaseIO.hpp:87
static BaseDataType STR(SizeType size)
Accessor for string with specified size.
Definition BaseIO.cpp:19
static const BaseDataType U32
Accessor for unsigned 32-bit integer.
Definition BaseIO.hpp:82
bool isCompatibleCellValue(const Types::CellValue &value) const
Check whether a CellValue has a type compatible with this data type.
Definition BaseIO.hpp:155
static const BaseDataType DSTR
Accessor for dynamic string.
Definition BaseIO.hpp:90
Type
Enumeration of different data types.
Definition BaseIO.hpp:53
@ V_STR
Variable length string.
Definition BaseIO.hpp:65
@ T_I32
Signed 32-bit integer.
Definition BaseIO.hpp:60
@ T_I64
Signed 64-bit integer.
Definition BaseIO.hpp:61
@ T_I8
Signed 8-bit integer.
Definition BaseIO.hpp:58
@ T_U32
Unsigned 32-bit integer.
Definition BaseIO.hpp:56
@ T_U64
Unsigned 64-bit integer.
Definition BaseIO.hpp:57
@ T_U8
Unsigned 8-bit integer.
Definition BaseIO.hpp:54
@ T_F32
32-bit floating point
Definition BaseIO.hpp:62
@ T_STR
String.
Definition BaseIO.hpp:64
@ T_F64
64-bit floating point
Definition BaseIO.hpp:63
@ T_U16
Unsigned 16-bit integer.
Definition BaseIO.hpp:55
@ T_I16
Signed 16-bit integer.
Definition BaseIO.hpp:59
static const BaseDataType U64
Accessor for unsigned 64-bit integer.
Definition BaseIO.hpp:83
static const BaseDataType U16
Accessor for unsigned 16-bit integer.
Definition BaseIO.hpp:81
static const BaseDataType F64
Accessor for 64-bit floating point.
Definition BaseIO.hpp:89
static BaseDataVectorVariant createEmptyVectorVariant(const BaseDataType &dataType)
Create an empty BaseDataVectorVariant matching the given type.
Definition BaseIO.hpp:116
static const BaseDataType U8
Accessor for unsigned 8-bit integer.
Definition BaseIO.hpp:80
static const BaseDataType I32
Accessor for signed 32-bit integer.
Definition BaseIO.hpp:86
static const BaseDataType I16
Accessor for signed 16-bit integer.
Definition BaseIO.hpp:85
BaseDataType(Type t=T_I32, SizeType s=1)
Constructs a BaseDataType object with the specified type and size.
Definition BaseIO.cpp:13
Type type
The data type.
Definition BaseIO.hpp:76
SizeType typeSize
The size of the data type.
Definition BaseIO.hpp:77
static BaseDataType fromTypeId(const std::type_index &typeIndex)
Get the BaseDataType from a std::type_index.
Definition BaseIO.hpp:194
AQNWB::Types::ScalarDataVariant BaseDataVariant
Definition BaseIO.hpp:101
bool operator==(const BaseDataType &other) const
Definition BaseIO.hpp:95
static const BaseDataType I8
Accessor for signed 8-bit integer.
Definition BaseIO.hpp:84
The BaseIO class is an abstract base class that defines the interface for input/output (IO) operation...
Definition BaseIO.hpp:551
virtual bool objectExists(const std::string &path) const =0
Checks whether a Dataset, Group, or Link already exists at the location in the file.
virtual StorageObjectType getStorageObjectType(std::string path) const =0
Get the storage type (Group, Dataset, Attribute) of the object at path.
virtual bool attributeExists(const std::string &path) const =0
Checks whether an Attribute exists at the location in the file.
virtual std::string findObject(const std::string &name, const std::string &starting_path="/") const
Find the first object in the file whose path ends with the given name.
Definition BaseIO.cpp:328
std::unordered_map< std::string, std::shared_ptr< BaseRecordingData > > m_recordingDataCache
Cache of BaseRecordingData objects to retain recording state.
Definition BaseIO.hpp:1031
std::string getFullTypeName(const std::string &path) const
Get the full name of the type from the attribute in the file.
Definition BaseIO.cpp:172
BaseIO & operator=(const BaseIO &)=delete
Assignment operator is deleted to prevent copying.
virtual Status createReferenceAttribute(const std::string &referencePath, const std::string &path, const std::string &name)=0
Sets an object reference attribute for a given location in the file.
virtual Status createStringDataSet(const std::string &path, const std::string &value)=0
Creates a non-modifiable dataset with a string value.
virtual std::shared_ptr< BaseRecordingData > getDataSetImpl(const std::string &path)=0
Implementation of getDataSet to be provided by derived classes.
virtual Status close()=0
Closes the file.
Definition BaseIO.cpp:423
virtual std::unique_ptr< BaseRecordingData > createArrayDataSet(const BaseArrayDataSetConfig &config, const std::string &path)=0
Creates an extendable dataset with the given configuration and path.
BaseIO(const std::string &filename)
Constructor for the BaseIO class.
Definition BaseIO.cpp:151
bool isOpen() const
Returns true if the file is open.
Definition BaseIO.hpp:973
virtual Status stopRecording()
Stops the recording process.
Definition BaseIO.cpp:406
virtual Status createAttribute(const BaseDataType &type, const void *data, const std::string &path, const std::string &name, const SizeType &size=1)=0
Creates an attribute at a given location in the file.
virtual Status createAttribute(const std::string &data, const std::string &path, const std::string &name, const bool overwrite=false)=0
Creates a string attribute at a given location in the file.
void clearRecordingDataCache()
Clears the recording data cache.
Definition BaseIO.cpp:317
virtual SizeArray getStorageObjectChunking(const std::string &path) const =0
Gets the chunking configuration of a dataset.
virtual ~BaseIO()
Destructor the BaseIO class.
Definition BaseIO.cpp:159
virtual std::unordered_map< std::string, std::string > findTypes(const std::string &starting_path, const std::unordered_set< std::string > &types, SearchMode search_mode, bool exclude_starting_path=false) const
Finds all datasets and groups of the given types in the HDF5 file.
Definition BaseIO.cpp:202
virtual Status createGroup(const std::string &path)=0
Creates a new group in the file.
Status createCommonNWBAttributes(const std::string &path, const std::string &objectNamespace, const std::string &neurodataType="")
Convenience function for creating NWB related attributes.
Definition BaseIO.cpp:161
virtual Status createLink(const std::string &path, const std::string &reference)=0
Creates a soft link to another location in the file.
const std::string m_filename
The name of the file.
Definition BaseIO.hpp:994
bool m_readyToOpen
Whether the file is ready to be opened.
Definition BaseIO.hpp:1006
virtual Status flush()=0
Flush data to disk.
std::shared_ptr< RecordingObjects > getRecordingObjects() const
Returns the recording objects container for this IO object.
Definition BaseIO.hpp:985
const std::unordered_map< std::string, std::shared_ptr< BaseRecordingData > > & getRecordingDataCache() const
Gets the recording data cache.
Definition BaseIO.cpp:323
bool isReadyToOpen() const
Returns true if the file is able to be opened.
Definition BaseIO.hpp:979
virtual std::vector< std::pair< std::string, StorageObjectType > > getStorageObjects(const std::string &path, const StorageObjectType &objectType=StorageObjectType::Undefined) const =0
Gets the list of storage objects (groups, datasets, attributes) inside a group.
virtual BaseDataType getStorageObjectDataType(const std::string &path) const =0
Gets the BaseDataType of a dataset or attribute.
virtual Status createAttribute(const std::vector< std::string > &data, const std::string &path, const std::string &name, const bool overwrite=false)=0
Creates an array of variable length strings attribute at a given location in the file.
virtual Status createGroupIfDoesNotExist(const std::string &path)=0
Creates a new group if it does not already exist.
virtual DataBlockGeneric readAttribute(const std::string &dataPath) const =0
Reads a attribute and determines the data type.
virtual std::string getFileName() const
Returns the full path to the file.
Definition BaseIO.hpp:577
std::shared_ptr< BaseRecordingData > getDataSet(const std::string &path, bool reset=false)
Returns a cached pointer to a BaseRecordingData dataset at a given path.
Definition BaseIO.cpp:301
virtual Status startRecording()
Starts the recording process.
Definition BaseIO.cpp:394
virtual std::string readReferenceAttribute(const std::string &dataPath) const =0
Reads a reference attribute and returns the path to the referenced object.
virtual DataBlockGeneric readDataset(const std::string &dataPath, const SizeArray &start={}, const SizeArray &count={}, const SizeArray &stride={}, const SizeArray &block={})=0
Reads a dataset and determines the data type.
virtual bool canModifyObjects()
Returns true if the file is in a mode where objects can be added or deleted. Note,...
Definition BaseIO.hpp:893
BaseIO(const BaseIO &)=delete
Copy constructor is deleted to prevent construction-copying.
virtual Status open(FileMode mode)=0
Opens an existing file or creates a new file for writing.
virtual SizeArray getStorageObjectShape(const std::string &path) const =0
Returns the size of the dataset or attribute for each dimension.
virtual Status open()=0
Opens the file for writing.
virtual Status createReferenceDataSet(const std::string &path, const std::vector< std::string > &references)=0
Creates a dataset that holds an array of references to groups within the file.
virtual Status createStringDataSet(const std::string &path, const std::vector< std::string > &values)=0
Creates a dataset that holds an array of string values.
std::shared_ptr< RecordingObjects > m_recording_objects
The recording objects collection to manage the recording state for recording associated with this IO ...
Definition BaseIO.hpp:1025
bool m_opened
Whether the file is currently open.
Definition BaseIO.hpp:1011
The base class to represent recording data that can be extended.
Definition BaseIO.hpp:1040
SizeType getNumDimensions() const
Get the number of dimensions in the dataset.
Definition BaseIO.hpp:1107
virtual Status writeDataBlock(const SizeArray &dataShape, const SizeArray &positionOffset, const BaseDataType &type, const std::vector< std::string > &data)=0
Writes a block of string data (any number of dimensions).
Status writeDataBlock(const SizeArray &dataShape, const BaseDataType &type, const void *data)
Writes a block of data using the stored position information. This is not intended to be overwritten ...
Definition BaseIO.cpp:435
BaseRecordingData()
Default constructor.
Definition BaseIO.cpp:390
SizeArray m_position
The current position in the dataset.
Definition BaseIO.hpp:1130
virtual Status writeDataBlock(const SizeArray &dataShape, const SizeArray &positionOffset, const BaseDataType &type, const void *data)=0
Writes a block of data (any number of dimensions).
const SizeArray & getPosition() const
Get the current position in the dataset.
Definition BaseIO.hpp:1119
SizeArray m_shape
The size of the dataset in each dimension.
Definition BaseIO.hpp:1125
BaseRecordingData(const BaseRecordingData &)=delete
Deleted copy constructor to prevent construction-copying.
BaseRecordingData & operator=(const BaseRecordingData &)=delete
Deleted copy assignment operator to prevent copying.
virtual ~BaseRecordingData()
Destructor.
Definition BaseIO.cpp:392
const SizeArray & getShape() const
Get the size of the dataset.
Definition BaseIO.hpp:1113
Generic structure to hold type-erased data and shape.
Definition ReadIO.hpp:34
The RecordingObjects class provides an interface for managing and holding groups of RegisteredType ob...
Definition RecordingObjects.hpp:30
The namespace for IO components of AqNWB.
FileMode
The access mode for the file.
Definition BaseIO.hpp:245
@ ReadOnly
Opens the file in read only mode.
Definition BaseIO.hpp:265
@ ReadWrite
Opens the file with both read and write access.
Definition BaseIO.hpp:257
@ Overwrite
Opens the file and overwrites any existing file.
Definition BaseIO.hpp:249
SearchMode
Enum class for specifying the search mode for findTypes.
Definition BaseIO.hpp:229
@ STOP_ON_TYPE
Stop searching inside an object once a matching type is found.
Definition BaseIO.hpp:233
@ CONTINUE_ON_TYPE
Continue searching inside an object even after a matching type is found.
Definition BaseIO.hpp:238
std::variant< std::monostate, std::vector< uint8_t >, std::vector< uint16_t >, std::vector< uint32_t >, std::vector< uint64_t >, std::vector< int8_t >, std::vector< int16_t >, std::vector< int32_t >, std::vector< int64_t >, std::vector< float >, std::vector< double >, std::vector< std::string > > VectorDataVariant
Variant data type for representing any 1D vector of scalar values.
Definition Types.hpp:141
StorageObjectType
Types of object used in the NWB schema.
Definition Types.hpp:60
Status
Represents the status of an operation.
Definition Types.hpp:29
std::variant< std::monostate, uint8_t, uint16_t, uint32_t, uint64_t, int8_t, int16_t, int32_t, int64_t, float, double, std::string > ScalarDataVariant
Variant data type for representing a single scalar value.
Definition Types.hpp:125
std::vector< SizeType > SizeArray
Alias for an array of size types used in the project.
Definition Types.hpp:115
size_t SizeType
Alias for the size type used in the project.
Definition Types.hpp:104
Represents a single cell value in a DynamicTable row.
Definition Types.hpp:190
std::variant< ScalarDataVariant, VectorDataVariant > value
Definition Types.hpp:191