Browse Source

wdsp/unit: Prevent unsafe copying of Unit

Explicitly delete the copy constructor and copy assignment operator for
Unit to prevent accidental duplication of DSP processing state.

Copying a Unit instance could duplicate internal buffer and processing
state, potentially causing incorrect DSP behavior or resource-management
problems.

Since Unit is not intended to be copied or assigned, prohibit both
operations at compile time.

cppcheck identified the missing copy constructor and assignment operator
with its noCopyConstructor and noOperatorEq warnings.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
chirpmodem-v8.0.0
Robin Getz 1 month ago
parent
commit
6059728a16
No known key found for this signature in database
GPG Key ID: 51C7231FFED0E060
  1. 3
      wdsp/unit.hpp

3
wdsp/unit.hpp

@ -50,6 +50,9 @@ public: @@ -50,6 +50,9 @@ public:
int _dsp_size // number complex samples processed per buffer in mainstream dsp processing
);
~Unit();
Unit(const Unit&) = delete;
Unit& operator=(const Unit&) = delete;
void flushBuffers();
void setBuffersInputSamplerate(int _in_rate);

Loading…
Cancel
Save