StimulusProducer: add duplicate-quale guard and attach-identity buffer lookup.

Provide ensureNoDuplicateQualeIface and getAttachedStimulusBufferByAttachIdentity
so session-scoped stimBuff plugins can reject duplicate quales and detach by
stable DAP line identity rather than full spec equality.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-14 11:02:18 -04:00
parent 7af684039d
commit 809861be2b
4 changed files with 353 additions and 0 deletions
+8
View File
@@ -56,6 +56,10 @@ public:
virtual std::shared_ptr<StimulusBuffer> getAttachedStimulusBuffer(
const std::shared_ptr<device::DeviceAttachmentSpec>& spec) const;
std::shared_ptr<StimulusBuffer> getAttachedStimulusBufferByAttachIdentity(
const std::string& deviceIdentifier,
const std::string& qualeIfaceApi) const;
virtual std::shared_ptr<StimulusBuffer> getOrCreateAttachedStimulusBuffer(
const std::shared_ptr<device::DeviceAttachmentSpec>
&deviceAttachmentSpec) = 0;
@@ -72,6 +76,10 @@ public:
// Check if any attached buffer has the specified qualeIfaceApi
bool hasBufferWithQualeIfaceApi(const std::string& qualeIfaceApi) const;
/** Reject a second buffer for the same qualeIface on this producer session. */
void ensureNoDuplicateQualeIface(
const std::string& qualeIfaceApi) const;
protected:
// Virtual functions for derived classes to override
virtual int getStopDelayMs() const