Skip to content

Commit

Permalink
Update names in RecordingContainers
Browse files Browse the repository at this point in the history
  • Loading branch information
oruebel committed Sep 19, 2024
1 parent 43313cb commit 5c69181
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/nwb/NWBFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 8 additions & 3 deletions src/nwb/RecordingContainers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ RecordingContainers::~RecordingContainers() {}

void RecordingContainers::addContainer(std::unique_ptr<Container> 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();
}
}

Expand Down Expand Up @@ -79,3 +79,8 @@ Status RecordingContainers::writeSpikeEventData(const SizeType& containerInd,

ses->writeSpike(numSamples, numChannels, data, timestamps);
}

SizeType RecordingContainers::size()
{
return this->m_containers.size();
}
17 changes: 15 additions & 2 deletions src/nwb/RecordingContainers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,21 @@ class RecordingContainers
const void* data,
const void* timestamps);

std::vector<std::unique_ptr<Container>> containers;
std::string name;
/**
* @brief Get the number of recording containers
*/
SizeType size();

private:
/**
* @brief The Containers used for recording
*/
std::vector<std::unique_ptr<Container>> m_containers;

/**
* @brief The name of the collection of recording containers
*/
std::string m_name;
};

} // namespace AQNWB::NWB

0 comments on commit 5c69181

Please sign in to comment.