From 5c69181326ad3654098dd115680b693209a1b179 Mon Sep 17 00:00:00 2001 From: Oliver Ruebel Date: Thu, 19 Sep 2024 11:16:17 -0700 Subject: [PATCH] Update names in RecordingContainers --- src/nwb/NWBFile.cpp | 4 ++-- src/nwb/RecordingContainers.cpp | 11 ++++++++--- src/nwb/RecordingContainers.hpp | 17 +++++++++++++++-- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/nwb/NWBFile.cpp b/src/nwb/NWBFile.cpp index 8bc4591d..64804ff6 100644 --- a/src/nwb/NWBFile.cpp +++ b/src/nwb/NWBFile.cpp @@ -162,7 +162,7 @@ Status NWBFile::createElectricalSeries( SizeArray {CHUNK_XSIZE, 0}); electricalSeries->initialize(); recordingContainers->addContainer(std::move(electricalSeries)); - containerIndexes.push_back(recordingContainers->containers.size() - 1); + containerIndexes.push_back(recordingContainers->size() - 1); } // write electrode information to datasets @@ -245,7 +245,7 @@ Status NWBFile::createSpikeEventSeries( chunkSize); spikeEventSeries->initialize(); recordingContainers->addContainer(std::move(spikeEventSeries)); - containerIndexes.push_back(recordingContainers->containers.size() - 1); + containerIndexes.push_back(recordingContainers->size() - 1); } // write electrode information to datasets diff --git a/src/nwb/RecordingContainers.cpp b/src/nwb/RecordingContainers.cpp index d80bea8a..4786b5c7 100644 --- a/src/nwb/RecordingContainers.cpp +++ b/src/nwb/RecordingContainers.cpp @@ -14,15 +14,15 @@ RecordingContainers::~RecordingContainers() {} void RecordingContainers::addContainer(std::unique_ptr container) { - this->containers.push_back(std::move(container)); + this->m_containers.push_back(std::move(container)); } Container* RecordingContainers::getContainer(const SizeType& containerInd) { - if (containerInd >= this->containers.size()) { + if (containerInd >= this->m_containers.size()) { return nullptr; } else { - return this->containers[containerInd].get(); + return this->m_containers[containerInd].get(); } } @@ -79,3 +79,8 @@ Status RecordingContainers::writeSpikeEventData(const SizeType& containerInd, ses->writeSpike(numSamples, numChannels, data, timestamps); } + +SizeType RecordingContainers::size() +{ + return this->m_containers.size(); +} \ No newline at end of file diff --git a/src/nwb/RecordingContainers.hpp b/src/nwb/RecordingContainers.hpp index f38d84c7..c1dfd5b1 100644 --- a/src/nwb/RecordingContainers.hpp +++ b/src/nwb/RecordingContainers.hpp @@ -105,8 +105,21 @@ class RecordingContainers const void* data, const void* timestamps); - std::vector> containers; - std::string name; + /** + * @brief Get the number of recording containers + */ + SizeType size(); + +private: + /** + * @brief The Containers used for recording + */ + std::vector> m_containers; + + /** + * @brief The name of the collection of recording containers + */ + std::string m_name; }; } // namespace AQNWB::NWB