StimulusBuffer should take ref to parent; not sh_ptr to common instance
This commit is contained in:
@@ -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_;
|
||||
|
||||
Reference in New Issue
Block a user