38 DynamicTable(
const std::string& path, std::shared_ptr<IO::BaseIO> io);
76 const std::vector<std::string>& values);
86 const std::string& colDescription,
87 const std::vector<std::string>& dataset);
96 const std::vector<int>& values);
112 virtual void setColNames(
const std::vector<std::string>& newColNames)
127 template<
typename DTYPE = std::any>
128 std::shared_ptr<VectorDataTyped<DTYPE>>
readColumn(
const std::string& colName)
131 auto ioPtr =
getIO();
132 if (ioPtr !=
nullptr) {
133 if (ioPtr->objectExists(columnPath)) {
134 if (ioPtr->getStorageObjectType(columnPath)
135 == StorageObjectType::Dataset)
141 std::cerr <<
"IO object has been deleted. Can't read column: " << colName
142 <<
" in DynamicTable: " <<
m_path << std::endl;
150 The names of the columns in the table)
155 Description of what is in
this dynamic table)
161 "unique identifiers for the rows of this dynamic table")
AQNWB::Types::Status Status
Definition BaseIO.hpp:22
AQNWB::Types::SizeType SizeType
Definition Channel.hpp:8
#define REGISTER_SUBCLASS(T, BASE, NAMESPACE)
Macro to register a subclass with the RegisteredType class registry.
Definition RegisteredType.hpp:501
#define DEFINE_ATTRIBUTE_FIELD(name, default_type, fieldPath, description)
Defines a lazy-loaded attribute field accessor function.
Definition RegisteredType.hpp:534
#define DEFINE_REGISTERED_FIELD(name, registeredType, fieldPath, description)
Defines a lazy-loaded accessor function for reading fields that are RegisteredTypes.
Definition RegisteredType.hpp:638
Container(const std::string &path, std::shared_ptr< IO::BaseIO > io)
Constructor.
Definition Container.cpp:10
Status initialize()
Initialize the container.
Definition Container.cpp:20
std::vector< std::string > m_colNames
Names of the columns in the table.
Definition DynamicTable.hpp:173
SizeType addColumnName(const std::string &colName)
Add a column name to m_colNames while preventing duplicates.
Definition DynamicTable.cpp:55
Status setRowIDs(const std::shared_ptr< ElementIdentifiers > &elementIDs, const std::vector< int > &values)
Adds a column of element identifiers to the table.
Definition DynamicTable.cpp:90
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::AttributeField, VTYPE > > readDescription() const
std::shared_ptr< VectorDataTyped< DTYPE > > readColumn(const std::string &colName)
Read an arbitrary column of the DynamicTable.
Definition DynamicTable.hpp:128
virtual ~DynamicTable()
Destructor.
Definition DynamicTable.cpp:36
DynamicTable(const std::string &path, std::shared_ptr< IO::BaseIO > io)
Constructor.
Definition DynamicTable.cpp:12
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::AttributeField, VTYPE > > readColNames() const
Status 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:117
Status addColumn(const std::shared_ptr< VectorData > &vectorData, const std::vector< std::string > &values)
Adds a column of vector string data to the table.
Definition DynamicTable.cpp:69
virtual void setColNames(const std::vector< std::string > &newColNames)
Sets the column names of the DynamicTable.
Definition DynamicTable.hpp:112
std::shared_ptr< ElementIdentifiers > m_rowElementIdentifiers
The row ids data object for write.
Definition DynamicTable.hpp:183
Status finalize() override
Finalizes writing the DynamicTable.
Definition DynamicTable.cpp:150
std::shared_ptr< RTYPE > readIdColumn() const
std::unique_ptr< IO::RecordingObjects > m_recordingColumns
The columns added for recording.
Definition DynamicTable.hpp:178
A list of unique identifiers for values within a dataset, e.g. rows of a DynamicTable.
Definition ElementIdentifiers.hpp:13
std::string m_path
The path of the registered type.
Definition RegisteredType.hpp:410
std::shared_ptr< AQNWB::IO::BaseIO > getIO() const
Get a shared pointer to the IO object.
Definition RegisteredType.hpp:77
static std::shared_ptr< VectorDataTyped > create(const std::string &path, std::shared_ptr< AQNWB::IO::BaseIO > io)
Factor method to create a VectorDataTyped object.
Definition VectorData.hpp:141
The namespace for IO components of AqNWB.
Namespace for all classes related to the NWB data standard.
const std::string namespaceName
Definition hdmf_common.hpp:21
static std::string mergePaths(const std::string &path1, const std::string &path2)
Merge two paths into a single path, handling extra trailing and starting "/".
Definition Utils.hpp:112