aqnwb 0.1.0
Loading...
Searching...
No Matches
DynamicTable.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
5#include "Utils.hpp"
6#include "io/BaseIO.hpp"
7#include "io/ReadIO.hpp"
11
12namespace AQNWB::NWB
13{
21class DynamicTable : public Container
22{
23public:
24 // Register the TimeSeries as a subclass of Container
25 REGISTER_SUBCLASS(DynamicTable, "hdmf-common")
26
27
34 const std::string& path,
35 std::shared_ptr<IO::BaseIO> io,
36 const std::vector<std::string>& colNames =
37 {}); // TODO Need to remove colNames here and move it to initialize
38
42 virtual ~DynamicTable();
43
50 void initialize(const std::string& description);
51
57 void addColumn(std::unique_ptr<VectorData>& vectorData,
58 const std::vector<std::string>& values);
59
66 void addReferenceColumn(const std::string& name,
67 const std::string& colDescription,
68 const std::vector<std::string>& dataset);
69
75 void setRowIDs(std::unique_ptr<ElementIdentifiers>& elementIDs,
76 const std::vector<int>& values);
77
82 virtual void setColNames(const std::vector<std::string>& newColNames)
83 {
84 m_colNames = newColNames;
85 }
86
89 std::string,
90 "colnames",
91 The names of the columns in the table)
92
95 std::string,
96 "description",
97 Description of what is in this dynamic table)
98
101 std::any,
102 "id",
103 Array of unique identifiers for the rows of this dynamic table)
104
105protected:
109 std::vector<std::string> m_colNames;
110};
111} // 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
Container(const std::string &path, std::shared_ptr< IO::BaseIO > io)
Constructor.
Definition Container.cpp:10
void initialize()
Initialize the container.
Definition Container.cpp:20
std::vector< std::string > m_colNames
Names of the columns in the table.
Definition DynamicTable.hpp:109
void addColumn(std::unique_ptr< VectorData > &vectorData, const std::vector< std::string > &values)
Adds a column of vector string data to the table.
Definition DynamicTable.cpp:33
std::unique_ptr< IO::ReadDataWrapper< DatasetField, VTYPE > > readId() const
virtual ~DynamicTable()
Destructor.
Definition DynamicTable.cpp:21
std::unique_ptr< IO::ReadDataWrapper< AttributeField, VTYPE > > readColNames() const
void setRowIDs(std::unique_ptr< ElementIdentifiers > &elementIDs, const std::vector< int > &values)
Adds a column of element identifiers to the table.
Definition DynamicTable.cpp:49
std::unique_ptr< IO::ReadDataWrapper< AttributeField, VTYPE > > readDescription() const
virtual void setColNames(const std::vector< std::string > &newColNames)
Sets the column names of the ElectrodeTable.
Definition DynamicTable.hpp:82
DynamicTable(const std::string &path, std::shared_ptr< IO::BaseIO > io, const std::vector< std::string > &colNames={})
Constructor.
Definition DynamicTable.cpp:12
void addReferenceColumn(const std::string &name, const std::string &colDescription, const std::vector< std::string > &dataset)
Adds a column of references to the table.
Definition DynamicTable.cpp:65
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