Browse Source

dsp: Prevent unsafe copying of CTCSSDetector

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

Copying could duplicate internal detection state and coefficients, leading
to unintended behavior if instances are expected to maintain independent
processing state.

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

2
sdrbase/dsp/ctcssdetector.h

@ -32,6 +32,8 @@ class SDRBASE_API CTCSSDetector { @@ -32,6 +32,8 @@ class SDRBASE_API CTCSSDetector {
public:
CTCSSDetector();
virtual ~CTCSSDetector();
CTCSSDetector(const CTCSSDetector&) = delete;
CTCSSDetector& operator=(const CTCSSDetector&) = delete;
// setup the basic parameters and coefficients
void setCoefficients(

Loading…
Cancel
Save