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:
29 DynamicTable(const std::string& path,
30 std::shared_ptr<BaseIO> io,
31 const std::string& description,
32 const std::vector<std::string>& colNames);
33
37 virtual ~DynamicTable();
38
43 void initialize();
44
52 void addColumn(const std::string& name,
53 const std::string& colDescription,
54 std::unique_ptr<VectorData>& vectorData,
55 const std::vector<std::string>& values);
56
63 void addColumn(const std::string& name,
64 const std::string& colDescription,
65 const std::vector<std::string>& dataset);
66
72 void setRowIDs(std::unique_ptr<ElementIdentifiers>& elementIDs,
73 const std::vector<int>& values);
74
79 inline std::string getDescription() const { return m_description; }
80
85 virtual const std::vector<std::string>& getColNames() const
86 {
87 return m_colNames;
88 }
89
94 virtual void setColNames(const std::vector<std::string>& newColNames)
95 {
96 m_colNames = newColNames;
97 }
98
99protected:
103 std::string m_description;
104
108 std::vector<std::string> m_colNames;
109};
110} // 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:108
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:79
std::string m_description
Description of the DynamicTable.
Definition DynamicTable.hpp:103
virtual void setColNames(const std::vector< std::string > &newColNames)
Sets the column names of the ElectrodeTable.
Definition DynamicTable.hpp:94
virtual const std::vector< std::string > & getColNames() const
Gets the column names of the table.
Definition DynamicTable.hpp:85
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