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 "BaseIO.hpp"
9
10namespace AQNWB::NWB
11{
19class DynamicTable : public Container
20{
21public:
28 DynamicTable(const std::string& path,
29 std::shared_ptr<BaseIO> io,
30 const std::string& description,
31 const std::vector<std::string>& colNames);
32
36 virtual ~DynamicTable();
37
42 void initialize();
43
51 void addColumn(const std::string& name,
52 const std::string& colDescription,
53 std::unique_ptr<VectorData>& vectorData,
54 const std::vector<std::string>& values);
55
62 void addColumn(const std::string& name,
63 const std::string& colDescription,
64 const std::vector<std::string>& dataset);
65
71 void setRowIDs(std::unique_ptr<ElementIdentifiers>& elementIDs,
72 const std::vector<int>& values);
73
78 inline std::string getDescription() const { return m_description; }
79
84 virtual const std::vector<std::string>& getColNames() const
85 {
86 return m_colNames;
87 }
88
93 virtual void setColNames(const std::vector<std::string>& newColNames)
94 {
95 m_colNames = newColNames;
96 }
97
98protected:
102 std::string m_description;
103
107 std::vector<std::string> m_colNames;
108};
109} // namespace AQNWB::NWB
Abstract data type for a group storing collections of data and metadata.
Definition Container.hpp:15
Represents a group containing multiple datasets that are aligned on the first dimension.
Definition DynamicTable.hpp:20
std::vector< std::string > m_colNames
Names of the columns in the table.
Definition DynamicTable.hpp:107
void initialize()
Initializes the DynamicTable object by creating NWB attributes and column names.
Definition DynamicTable.cpp:22
virtual ~DynamicTable()
Destructor.
Definition DynamicTable.cpp:19
void addColumn(const std::string &name, const std::string &colDescription, std::unique_ptr< VectorData > &vectorData, const std::vector< std::string > &values)
Adds a column of vector string data to the table.
Definition DynamicTable.cpp:32
void setRowIDs(std::unique_ptr< ElementIdentifiers > &elementIDs, const std::vector< int > &values)
Adds a column of element identifiers to the table.
Definition DynamicTable.cpp:51
std::string getDescription() const
Gets the description of the table.
Definition DynamicTable.hpp:78
std::string m_description
Description of the DynamicTable.
Definition DynamicTable.hpp:102
virtual void setColNames(const std::vector< std::string > &newColNames)
Sets the column names of the ElectrodeTable.
Definition DynamicTable.hpp:93
virtual const std::vector< std::string > & getColNames() const
Gets the column names of the table.
Definition DynamicTable.hpp:84
DynamicTable(const std::string &path, std::shared_ptr< BaseIO > io, const std::string &description, const std::vector< std::string > &colNames)
Constructor.
Definition DynamicTable.cpp:8
Namespace for all classes related to the NWB data standard.
Definition TimeSeries.hpp:9