32 DynamicTable(
const std::string& path, std::shared_ptr<IO::BaseIO> io);
65 const std::vector<std::string>& values);
75 const std::string& colDescription,
76 const std::vector<std::string>& dataset);
85 const std::vector<int>& values);
101 virtual void setColNames(
const std::vector<std::string>& newColNames)
116 template<
typename DTYPE = std::any>
117 std::shared_ptr<VectorDataTyped<DTYPE>>
readColumn(
const std::string& colName)
120 if (
m_io->objectExists(columnPath)) {
121 if (
m_io->getStorageObjectType(columnPath) == StorageObjectType::Dataset)
123 return std::make_shared<VectorDataTyped<DTYPE>>(columnPath,
m_io);
133 The names of the columns in the table)
139 Description of what is in
this dynamic table)
145 "unique identifiers for the rows of this dynamic table")
AQNWB::Types::Status Status
Definition BaseIO.hpp:22
#define REGISTER_SUBCLASS(T, NAMESPACE)
Macro to register a subclass with the RegisteredType class registry.
Definition RegisteredType.hpp:373
#define DEFINE_FIELD(name, storageObjectType, default_type, fieldPath, description)
Defines a lazy-loaded field accessor function.
Definition RegisteredType.hpp:407
#define DEFINE_REGISTERED_FIELD(name, registeredType, fieldPath, description)
Defines a lazy-loaded accessor function for reading fields that are RegisteredTypes.
Definition RegisteredType.hpp:439
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:151
Status setRowIDs(std::unique_ptr< ElementIdentifiers > &elementIDs, const std::vector< int > &values)
Adds a column of element identifiers to the table.
Definition DynamicTable.cpp:61
std::shared_ptr< VectorDataTyped< DTYPE > > readColumn(const std::string &colName)
Read an arbitrary column of the DyanmicTable.
Definition DynamicTable.hpp:117
virtual ~DynamicTable()
Destructor.
Definition DynamicTable.cpp:30
DynamicTable(const std::string &path, std::shared_ptr< IO::BaseIO > io)
Constructor.
Definition DynamicTable.cpp:12
std::unique_ptr< IO::ReadDataWrapper< AttributeField, VTYPE > > readColNames() const
Status finalize()
Finalizes writing the DynamicTable.
Definition DynamicTable.cpp:100
Status 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:43
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:80
std::unique_ptr< IO::ReadDataWrapper< AttributeField, VTYPE > > readDescription() const
virtual void setColNames(const std::vector< std::string > &newColNames)
Sets the column names of the DynamicTable.
Definition DynamicTable.hpp:101
std::shared_ptr< RTYPE > readIdColumn() const
A list of unique identifiers for values within a dataset, e.g. rows of a DynamicTable.
Definition ElementIdentifiers.hpp:12
std::string m_path
The path of the registered type.
Definition RegisteredType.hpp:318
std::shared_ptr< IO::BaseIO > m_io
A shared pointer to the IO object.
Definition RegisteredType.hpp:323
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:23
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