Browse Source

dsp: Prevent unsafe copying of UpChannelizer::FilterStage

Explicitly delete the copy constructor and copy assignment operator for
FilterStage to prevent accidental duplication of its filter state.

Copying a filter stage could duplicate internal processing state and
resource references, potentially causing incorrect channelization behavior
or resource-management problems.

Since FilterStage 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
ec9f83fa3e
No known key found for this signature in database
GPG Key ID: 51C7231FFED0E060
  1. 2
      sdrbase/dsp/upchannelizer.h

2
sdrbase/dsp/upchannelizer.h

@ -67,6 +67,8 @@ protected: @@ -67,6 +67,8 @@ protected:
FilterStage(Mode mode);
~FilterStage();
FilterStage(const FilterStage&) = delete;
FilterStage& operator=(const FilterStage&) = delete;
bool work(Sample* sampleIn, Sample *sampleOut) {
return (m_filter->*m_workFunction)(sampleIn, sampleOut);

Loading…
Cancel
Save