aqnwb 0.4.0
Loading...
Searching...
No Matches
TimeIntervals.hpp
Go to the documentation of this file.
1#pragma once
2
3// Common STL includes
4#include <memory>
5#include <optional>
6#include <string>
7#include <vector>
8// Base AqNWB includes for IO and RegisteredType
9#include "io/BaseIO.hpp"
10#include "io/ReadIO.hpp"
12// Include for parent type
14// Includes for types that are referenced and used
18// #include "core/base/TimeSeriesReferenceVectorData.hpp"
19
20#include "spec/core.hpp"
21
22namespace AQNWB::NWB
23{
24
30{
31protected:
37 TimeIntervals(const std::string& path, std::shared_ptr<AQNWB::IO::BaseIO> io);
38
39public:
43 virtual ~TimeIntervals() override {}
44
53 const std::vector<DataSpecPtr>& dataSpecs) const override;
54
63 static std::vector<DataSpecPtr> createDefaultDataSpecs(
64 const std::string& timeIntervalsPath,
65 const SizeType rowChunkSize = 100,
66 const bool addTagsColumn = false);
67
90 Status initialize(const std::string& description,
91 const std::vector<DataSpecPtr>& columnSpecs = {});
92
93 // Define read methods
95 VectorDataTyped<float>,
96 "start_time",
97 "Start time of epoch - in seconds.")
98
100 VectorDataTyped<float>,
101 "stop_time",
102 "Stop time of epoch - in seconds.")
103
105 readTags,
106 VectorDataTyped<std::string>,
107 "tags",
108 "User-defined tags that identify or categorize events.")
109
112 "tags_index",
113 "Index for tags.")
114
115 /*
116 // TODO Add support for the timeseries columns requires support for
117 TimeSeriesReferenceVectorData DEFINE_REGISTERED_FIELD( readTimeseries,
118 CORE::TimeSeriesReferenceVectorData,
119 "timeseries",
120 "An index into a TimeSeries object.")
121 */
122 /*
123 // TODO Add support for timeseries_index requires support for VectorIndex
124 DEFINE_REGISTERED_FIELD(
125 readTimeseriesIndex,
126 HDMF_COMMON::VectorIndex,
127 "timeseries_index",
128 "Index for timeseries.")
129 */
130
133 AQNWB::SPEC::CORE::namespaceName)
134};
135
136} // namespace AQNWB::NWB
AQNWB::Types::Status Status
Definition BaseIO.hpp:21
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:547
#define DEFINE_REGISTERED_FIELD(name, registeredType, fieldPath, description)
Defines a lazy-loaded accessor function for reading fields that are RegisteredTypes.
Definition RegisteredType.hpp:672
Status initialize()
Initialize the container.
Definition Container.cpp:20
Represents a group containing multiple datasets that are aligned on the first dimension.
Definition DynamicTable.hpp:32
DynamicTable(const std::string &path, std::shared_ptr< IO::BaseIO > io)
Constructor.
Definition DynamicTable.cpp:19
virtual ~TimeIntervals() override
Virtual destructor.
Definition TimeIntervals.hpp:43
TimeIntervals(const std::string &path, std::shared_ptr< AQNWB::IO::BaseIO > io)
Constructor.
Definition TimeIntervals.cpp:13
std::shared_ptr< RTYPE > readTags() const
std::shared_ptr< RTYPE > readStopTime() const
static std::vector< DataSpecPtr > createDefaultDataSpecs(const std::string &timeIntervalsPath, const SizeType rowChunkSize=100, const bool addTagsColumn=false)
Creates the default data specs for the TimeIntervals table.
Definition TimeIntervals.cpp:21
std::shared_ptr< RTYPE > readTagsIndex() const
std::shared_ptr< RTYPE > readStartTime() const
Status validateDataSpecs(const std::vector< DataSpecPtr > &dataSpecs) const override
Validates the provided data specifications for the TimeIntervals table.
Definition TimeIntervals.cpp:71
A typed n-dimensional dataset representing a column of a DynamicTable.
Definition VectorData.hpp:143
Used with VectorData to encode a ragged array. An array of indices into the first dimension of the ta...
Definition VectorIndex.hpp:40
Namespace for all classes related to the NWB data standard.
The namespace for managing format schema and namespaces.
The main namespace for AqNWB.
Definition Channel.hpp:11