27 VectorData(
const std::string& path, std::shared_ptr<IO::BaseIO> io);
46 const std::string& path,
47 std::shared_ptr<IO::BaseIO> io,
48 const std::string& description,
49 const std::vector<std::string>& references)
51 Status dataStatus = io->createReferenceDataSet(path, references);
52 if (dataStatus != Status::Success) {
57 Status commonAttrsStatus = io->createCommonNWBAttributes(
58 path, vectorData->getNamespace(), vectorData->getTypeName());
59 Status attrStatus = io->createAttribute(description, path,
"description");
60 if ((attrStatus && commonAttrsStatus) != Status::Success) {
77 const std::string& description)
80 if (ioPtr ==
nullptr) {
81 std::cerr <<
"IO object has been deleted. Can't initialize VectorData: "
83 return Status::Failure;
87 ioPtr->createAttribute(description,
m_path,
"description");
88 return dataStatus && attrStatus;
94 Description of what these vectors represent)
111template<
typename DTYPE = std::any>
141 static std::shared_ptr<VectorDataTyped>
create(
142 const std::string& path, std::shared_ptr<AQNWB::IO::BaseIO> io)
166 const std::shared_ptr<VectorData>& data)
AQNWB::Types::Status Status
Definition BaseIO.hpp:22
#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_DATASET_FIELD(readName, writeName, default_type, fieldPath, description)
Defines a lazy-loaded dataset field accessor function.
Definition RegisteredType.hpp:573
The configuration for an array dataset.
Definition BaseIO.hpp:204
Data(const std::string &path, std::shared_ptr< IO::BaseIO > io)
Constructor.
Definition Data.cpp:9
Status initialize(const IO::ArrayDataSetConfig &dataConfig)
Initialize the dataset for the Data object.
Definition Data.cpp:14
Base class for types defined in the NWB schema.
Definition RegisteredType.hpp:48
std::string m_path
The path of the registered type.
Definition RegisteredType.hpp:410
static std::shared_ptr< RegisteredType > create(const std::string &fullClassName, const std::string &path, std::shared_ptr< IO::BaseIO > io, bool fallbackToBase=false)
Create an instance of a registered subclass by name.
Definition RegisteredType.cpp:75
std::string getPath() const
Gets the path of the registered type.
Definition RegisteredType.hpp:59
std::shared_ptr< AQNWB::IO::BaseIO > getIO() const
Get a shared pointer to the IO object.
Definition RegisteredType.hpp:77
static std::shared_ptr< VectorData > create(const std::string &path, std::shared_ptr< AQNWB::IO::BaseIO > io)
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::AttributeField, VTYPE > > readDescription() const
VectorData(const std::string &path, std::shared_ptr< IO::BaseIO > io)
Constructor.
Definition VectorData.cpp:8
Status initialize(const IO::ArrayDataSetConfig &dataConfig, const std::string &description)
Initialize the dataset for the VectorData object.
Definition VectorData.hpp:76
static std::shared_ptr< VectorData > createReferenceVectorData(const std::string &path, std::shared_ptr< IO::BaseIO > io, const std::string &description, const std::vector< std::string > &references)
Create a VectorData object with a reference dataset.
Definition VectorData.hpp:45
virtual ~VectorData() override
Virtual destructor.
Definition VectorData.hpp:33
std::shared_ptr< AQNWB::IO::BaseRecordingData > recordData(bool reset=false)
std::unique_ptr< AQNWB::IO::ReadDataWrapper< AQNWB::NWB::DatasetField, VTYPE > > readData() const
VectorData(const std::string &path, std::shared_ptr< IO::BaseIO > io)
Constructor.
Definition VectorData.cpp:8
static std::shared_ptr< VectorDataTyped< DTYPE > > fromVectorData(const std::shared_ptr< VectorData > &data)
Create a VectorDataTyped object from a Data object.
Definition VectorData.hpp:165
VectorDataTyped(const std::string &path, std::shared_ptr< IO::BaseIO > io)
Constructor.
Definition VectorData.hpp:123
virtual ~VectorDataTyped() override
Virtual destructor.
Definition VectorData.hpp:150
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
Namespace for all classes related to the NWB data standard.
const std::string namespaceName
Definition hdmf_common.hpp:21