[Pcloud]StimProducer: Impl addAttachedStimBuffIfNotExists

Reduces code duplication, centralizes checking and enforces consistent
behaviour across producers.

Also reordered the writes to the sh_ptr<StimulusBuffer>s such that
the pointers are written last.
This commit is contained in:
2025-11-23 23:10:20 -04:00
parent 617020b534
commit b0df1ef3d0
3 changed files with 28 additions and 3 deletions
+3
View File
@@ -76,6 +76,9 @@ public:
const std::shared_ptr<device::DeviceAttachmentSpec>
&deviceAttachmentSpec) = 0;
bool addAttachedStimulusBufferIfNotExists(
const std::shared_ptr<StimulusBuffer>& buffer);
virtual void destroyAttachedStimulusBuffer(
const std::shared_ptr<StimulusBuffer>& buffer);