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_;
|
||||
|
||||
@@ -18,12 +18,12 @@ class PcloudAmbienceStimulusBuffer
|
||||
{
|
||||
public:
|
||||
explicit PcloudAmbienceStimulusBuffer(
|
||||
std::shared_ptr<StimulusProducer>& producer,
|
||||
StimulusProducer& parent,
|
||||
const std::shared_ptr<device::DeviceAttachmentSpec>& deviceAttachmentSpec,
|
||||
int histbuffMs,
|
||||
const SpMcRingBuffer::InputEngineConstraints& ringBufferConstraints)
|
||||
: StimulusBuffer(
|
||||
producer, deviceAttachmentSpec, histbuffMs, ringBufferConstraints)
|
||||
parent, deviceAttachmentSpec, histbuffMs, ringBufferConstraints)
|
||||
{}
|
||||
|
||||
~PcloudAmbienceStimulusBuffer() = default;
|
||||
|
||||
@@ -18,12 +18,12 @@ class PcloudIStimulusBuffer
|
||||
{
|
||||
public:
|
||||
explicit PcloudIStimulusBuffer(
|
||||
std::shared_ptr<StimulusProducer>& producer,
|
||||
StimulusProducer& parent,
|
||||
const std::shared_ptr<device::DeviceAttachmentSpec>& deviceAttachmentSpec,
|
||||
int histbuffMs,
|
||||
const SpMcRingBuffer::InputEngineConstraints& ringBufferConstraints)
|
||||
: StimulusBuffer(
|
||||
producer, deviceAttachmentSpec, histbuffMs, ringBufferConstraints)
|
||||
parent, deviceAttachmentSpec, histbuffMs, ringBufferConstraints)
|
||||
{}
|
||||
|
||||
~PcloudIStimulusBuffer() = default;
|
||||
|
||||
@@ -18,12 +18,12 @@ class PcloudXyzStimulusBuffer
|
||||
{
|
||||
public:
|
||||
explicit PcloudXyzStimulusBuffer(
|
||||
std::shared_ptr<StimulusProducer>& producer,
|
||||
StimulusProducer& parent,
|
||||
const std::shared_ptr<device::DeviceAttachmentSpec>& deviceAttachmentSpec,
|
||||
int histbuffMs,
|
||||
const SpMcRingBuffer::InputEngineConstraints& ringBufferConstraints)
|
||||
: StimulusBuffer(
|
||||
producer, deviceAttachmentSpec, histbuffMs, ringBufferConstraints)
|
||||
parent, deviceAttachmentSpec, histbuffMs, ringBufferConstraints)
|
||||
{}
|
||||
|
||||
~PcloudXyzStimulusBuffer() = default;
|
||||
|
||||
Reference in New Issue
Block a user