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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user