StimulusBuffer should take ref to parent; not sh_ptr to common instance

This commit is contained in:
2025-11-15 01:15:57 -04:00
parent 188b09319c
commit e215e78aa5
4 changed files with 10 additions and 10 deletions
+4 -4
View File
@@ -18,18 +18,18 @@ class StimulusProducer;
* StimulusBuffer manages a collection of stimulus frames and ring buffer.
*
* This buffer holds the actual frame storage and ring buffer for stimulus
* data. It maintains a reference to the StimulusProducer that it owns.
* data. It maintains a reference to its parent StimulusProducer.
*/
class StimulusBuffer
{
public:
explicit StimulusBuffer(
std::shared_ptr<StimulusProducer> &producer,
StimulusProducer& parent,
const std::shared_ptr<device::DeviceAttachmentSpec>
&deviceAttachmentSpec,
int histbuffMs,
const SpMcRingBuffer::InputEngineConstraints& ringBufferConstraints)
: producer(producer),
: parent(parent),
deviceAttachmentSpec(deviceAttachmentSpec),
histbuffMs(histbuffMs),
frames_(static_cast<size_t>(histbuffMs / CONFIG_STIMBUFF_FRAME_PERIOD_MS)),
@@ -48,7 +48,7 @@ public:
StimulusBuffer& operator=(StimulusBuffer&&) = default;
public:
std::shared_ptr<StimulusProducer> producer;
StimulusProducer& parent;
std::shared_ptr<device::DeviceAttachmentSpec> deviceAttachmentSpec;
int histbuffMs;
std::vector<StimulusFrame> frames_;