Use override and final to ensure clarity/avoid override at unwanted levels
This commit is contained in:
@@ -14,4 +14,4 @@ CLANG_CXX_LIBRARY = libc++
|
||||
CLANG_X86_VECTOR_INSTRUCTIONS = avx
|
||||
|
||||
OTHER_CFLAGS = -fvisibility=hidden
|
||||
OTHER_CPLUSPLUSFLAGS = -fvisibility=hidden
|
||||
OTHER_CPLUSPLUSFLAGS = -fvisibility=hidden -Winconsistent-missing-override
|
||||
|
||||
@@ -93,25 +93,25 @@ public:
|
||||
|
||||
// Set Fixed Inputs
|
||||
|
||||
virtual void setFixedInput(unsigned long idx, double *input, unsigned long size);
|
||||
virtual const double *getFixedInput(unsigned long idx, unsigned long *size);
|
||||
void setFixedInput(unsigned long idx, double *input, unsigned long size) final;
|
||||
const double *getFixedInput(unsigned long idx, unsigned long *size) final;
|
||||
|
||||
// Audio Processing
|
||||
|
||||
virtual void blockUpdate(const double * const *ins, double **outs, unsigned long blockSize);
|
||||
virtual void reset(double samplingRate, unsigned long maxBlockSize);
|
||||
void blockUpdate(const double * const *ins, double **outs, unsigned long blockSize) final;
|
||||
void reset(double samplingRate, unsigned long maxBlockSize) final;
|
||||
|
||||
// Info (individual objects should override other methods to provide info)
|
||||
|
||||
virtual const FrameLib_Parameters *getParameters() const { return &mParameters; }
|
||||
const FrameLib_Parameters *getParameters() const final { return &mParameters; }
|
||||
|
||||
virtual FrameType inputType(unsigned long idx) const { return mInputs[idx].mType; }
|
||||
virtual FrameType outputType(unsigned long idx) const { return mOutputs[idx].mType; }
|
||||
FrameType inputType(unsigned long idx) const final { return mInputs[idx].mType; }
|
||||
FrameType outputType(unsigned long idx) const final { return mOutputs[idx].mType; }
|
||||
|
||||
// Automatic Oredering Connections
|
||||
// Automatic Ordering Connections
|
||||
|
||||
virtual void autoOrderingConnections();
|
||||
virtual void clearAutoOrderingConnections();
|
||||
void autoOrderingConnections() final;
|
||||
void clearAutoOrderingConnections() final;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -250,8 +250,8 @@ private:
|
||||
|
||||
// Connections
|
||||
|
||||
virtual void connectionUpdate(Queue *queue);
|
||||
virtual void autoOrderingConnections(LocalQueue *queue);
|
||||
void connectionUpdate(Queue *queue) final;
|
||||
void autoOrderingConnections(LocalQueue *queue);
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ private:
|
||||
|
||||
// Thread for Allocating System Memory
|
||||
|
||||
class NewThread : public DelegateThread
|
||||
class NewThread final : public DelegateThread
|
||||
{
|
||||
|
||||
public:
|
||||
@@ -54,7 +54,7 @@ private:
|
||||
|
||||
private:
|
||||
|
||||
virtual void doTask() { mAllocator->addScheduledPool(); };
|
||||
void doTask() override { mAllocator->addScheduledPool(); };
|
||||
|
||||
CoreAllocator *mAllocator;
|
||||
};
|
||||
@@ -63,7 +63,7 @@ private:
|
||||
|
||||
// Thread for Freeing System Memory
|
||||
|
||||
class FreeThread : public TriggerableThread
|
||||
class FreeThread final : public TriggerableThread
|
||||
{
|
||||
|
||||
public:
|
||||
@@ -72,7 +72,7 @@ private:
|
||||
|
||||
private:
|
||||
|
||||
virtual void doTask() { mAllocator->destroyScheduledPool(); };
|
||||
void doTask() override { mAllocator->destroyScheduledPool(); };
|
||||
|
||||
CoreAllocator *mAllocator;
|
||||
};
|
||||
|
||||
@@ -40,15 +40,7 @@ public:
|
||||
|
||||
virtual ~FrameLib_MultiChannel() {}
|
||||
|
||||
// Set Fixed Inputs
|
||||
|
||||
virtual void setFixedInput(unsigned long idx, double *input, unsigned long size) {};
|
||||
virtual const double *getFixedInput(unsigned long idx, unsigned long *size) { return getEmptyFixedInput(idx, size); }
|
||||
|
||||
// Audio Processing
|
||||
|
||||
virtual void blockUpdate(const double * const *ins, double **outs, unsigned long blockSize) {}
|
||||
virtual void reset(double samplingRate, unsigned long maxBlockSize) {}
|
||||
// Default is not to handle audio
|
||||
|
||||
static bool handlesAudio() { return false; }
|
||||
|
||||
@@ -85,7 +77,7 @@ private:
|
||||
|
||||
// Connection Methods (private)
|
||||
|
||||
void connectionUpdate(Queue *queue)
|
||||
void connectionUpdate(Queue *queue) final
|
||||
{
|
||||
if (inputUpdate())
|
||||
outputUpdate(queue);
|
||||
@@ -109,7 +101,7 @@ private:
|
||||
|
||||
// FrameLib_Pack - Pack Multichannel Signals
|
||||
|
||||
class FrameLib_Pack : public FrameLib_MultiChannel
|
||||
class FrameLib_Pack final : public FrameLib_MultiChannel
|
||||
{
|
||||
enum AtrributeList { kInputs };
|
||||
|
||||
@@ -117,27 +109,37 @@ class FrameLib_Pack : public FrameLib_MultiChannel
|
||||
|
||||
public:
|
||||
|
||||
virtual const FrameLib_Parameters::Serial *getSerialised() { return &mSerialisedParameters; }
|
||||
const FrameLib_Parameters::Serial *getSerialised() override { return &mSerialisedParameters; }
|
||||
|
||||
FrameLib_Pack(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy, unsigned long nStreams);
|
||||
|
||||
// Set Fixed Inputs
|
||||
|
||||
void setFixedInput(unsigned long idx, double *input, unsigned long size) override {};
|
||||
const double *getFixedInput(unsigned long idx, unsigned long *size) override { return getEmptyFixedInput(idx, size); }
|
||||
|
||||
// Audio Processing
|
||||
|
||||
void blockUpdate(const double * const *ins, double **outs, unsigned long blockSize) override {}
|
||||
void reset(double samplingRate, unsigned long maxBlockSize) override {}
|
||||
|
||||
// Info
|
||||
|
||||
virtual std::string objectInfo(bool verbose);
|
||||
virtual std::string inputInfo(unsigned long idx, bool verbose);
|
||||
virtual std::string outputInfo(unsigned long idx, bool verbose);
|
||||
std::string objectInfo(bool verbose) override;
|
||||
std::string inputInfo(unsigned long idx, bool verbose) override;
|
||||
std::string outputInfo(unsigned long idx, bool verbose) override;
|
||||
|
||||
virtual const FrameLib_Parameters *getParameters() const { return &mParameters; }
|
||||
const FrameLib_Parameters *getParameters() const override { return &mParameters; }
|
||||
|
||||
virtual FrameType inputType(unsigned long idx) const { return kFrameAny; }
|
||||
virtual FrameType outputType(unsigned long idx) const { return kFrameAny; }
|
||||
FrameType inputType(unsigned long idx) const override { return kFrameAny; }
|
||||
FrameType outputType(unsigned long idx) const override { return kFrameAny; }
|
||||
|
||||
virtual void autoOrderingConnections() {}
|
||||
virtual void clearAutoOrderingConnections() {}
|
||||
void autoOrderingConnections() override {}
|
||||
void clearAutoOrderingConnections() override {}
|
||||
|
||||
private:
|
||||
|
||||
virtual bool inputUpdate();
|
||||
bool inputUpdate() override;
|
||||
|
||||
FrameLib_Parameters::AutoSerial mSerialisedParameters;
|
||||
|
||||
@@ -150,7 +152,7 @@ private:
|
||||
|
||||
// FrameLib_Unpack - Unpack Multichannel Signals
|
||||
|
||||
class FrameLib_Unpack : public FrameLib_MultiChannel
|
||||
class FrameLib_Unpack final : public FrameLib_MultiChannel
|
||||
{
|
||||
enum AtrributeList { kOutputs };
|
||||
|
||||
@@ -158,27 +160,37 @@ class FrameLib_Unpack : public FrameLib_MultiChannel
|
||||
|
||||
public:
|
||||
|
||||
virtual const FrameLib_Parameters::Serial *getSerialised() { return &mSerialisedParameters; }
|
||||
const FrameLib_Parameters::Serial *getSerialised() override { return &mSerialisedParameters; }
|
||||
|
||||
FrameLib_Unpack(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy, unsigned long nStreams);
|
||||
|
||||
// Set Fixed Inputs
|
||||
|
||||
void setFixedInput(unsigned long idx, double *input, unsigned long size) override {};
|
||||
const double *getFixedInput(unsigned long idx, unsigned long *size) override { return getEmptyFixedInput(idx, size); }
|
||||
|
||||
// Audio Processing
|
||||
|
||||
void blockUpdate(const double * const *ins, double **outs, unsigned long blockSize) override {}
|
||||
void reset(double samplingRate, unsigned long maxBlockSize) override {}
|
||||
|
||||
// Info
|
||||
|
||||
virtual std::string objectInfo(bool verbose);
|
||||
virtual std::string inputInfo(unsigned long idx, bool verbose);
|
||||
virtual std::string outputInfo(unsigned long idx, bool verbose);
|
||||
std::string objectInfo(bool verbose) override;
|
||||
std::string inputInfo(unsigned long idx, bool verbose) override;
|
||||
std::string outputInfo(unsigned long idx, bool verbose) override;
|
||||
|
||||
virtual const FrameLib_Parameters *getParameters() const { return &mParameters; }
|
||||
const FrameLib_Parameters *getParameters() const override { return &mParameters; }
|
||||
|
||||
virtual FrameType inputType(unsigned long idx) const { return kFrameAny; }
|
||||
virtual FrameType outputType(unsigned long idx) const { return kFrameAny; }
|
||||
FrameType inputType(unsigned long idx) const override { return kFrameAny; }
|
||||
FrameType outputType(unsigned long idx) const override { return kFrameAny; }
|
||||
|
||||
virtual void autoOrderingConnections() {}
|
||||
virtual void clearAutoOrderingConnections() {}
|
||||
void autoOrderingConnections() override {}
|
||||
void clearAutoOrderingConnections() override {}
|
||||
|
||||
private:
|
||||
|
||||
virtual bool inputUpdate();
|
||||
virtual bool inputUpdate() override;
|
||||
|
||||
FrameLib_Parameters::AutoSerial mSerialisedParameters;
|
||||
|
||||
@@ -191,12 +203,12 @@ private:
|
||||
|
||||
// FrameLib_Expand - MultiChannel expansion for FrameLib_Block objects
|
||||
|
||||
template <class T> class FrameLib_Expand : public FrameLib_MultiChannel
|
||||
template <class T> class FrameLib_Expand final : public FrameLib_MultiChannel
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
virtual const FrameLib_Parameters::Serial *getSerialised() { return &mSerialisedParameters; }
|
||||
const FrameLib_Parameters::Serial *getSerialised() override { return &mSerialisedParameters; }
|
||||
|
||||
FrameLib_Expand(FrameLib_Context context, FrameLib_Parameters::Serial *serialisedParameters, FrameLib_Proxy *proxy, unsigned long nStreams)
|
||||
: FrameLib_MultiChannel(T::getType(), context, proxy, nStreams), mSerialisedParameters(serialisedParameters->size())
|
||||
@@ -239,7 +251,7 @@ public:
|
||||
|
||||
// Fixed Inputs
|
||||
|
||||
virtual void setFixedInput(unsigned long idx, double *input, unsigned long size)
|
||||
void setFixedInput(unsigned long idx, double *input, unsigned long size) override
|
||||
{
|
||||
if (idx < mFixedInputs.size())
|
||||
{
|
||||
@@ -248,14 +260,14 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual const double *getFixedInput(unsigned long idx, unsigned long *size)
|
||||
const double *getFixedInput(unsigned long idx, unsigned long *size) override
|
||||
{
|
||||
return mBlocks[0]->getFixedInput(idx, size);
|
||||
}
|
||||
|
||||
// Audio Processing
|
||||
|
||||
virtual void blockUpdate(const double * const *ins, double **outs, unsigned long blockSize)
|
||||
void blockUpdate(const double * const *ins, double **outs, unsigned long blockSize) override
|
||||
{
|
||||
unsigned long internalNumIns = mBlocks[0]->getNumAudioIns();
|
||||
unsigned long internalNumOuts = mBlocks[0]->getNumAudioOuts();
|
||||
@@ -296,7 +308,7 @@ public:
|
||||
|
||||
// Reset
|
||||
|
||||
virtual void reset(double samplingRate, unsigned long maxBlockSize)
|
||||
void reset(double samplingRate, unsigned long maxBlockSize) override
|
||||
{
|
||||
mSamplingRate = samplingRate;
|
||||
mMaxBlockSize = maxBlockSize;
|
||||
@@ -311,29 +323,29 @@ public:
|
||||
|
||||
// Info
|
||||
|
||||
virtual std::string objectInfo(bool verbose) { return mBlocks[0]->objectInfo(verbose); }
|
||||
virtual std::string inputInfo(unsigned long idx, bool verbose) { return mBlocks[0]->inputInfo(idx, verbose); }
|
||||
virtual std::string outputInfo(unsigned long idx, bool verbose) { return mBlocks[0]->outputInfo(idx, verbose); }
|
||||
std::string objectInfo(bool verbose) override { return mBlocks[0]->objectInfo(verbose); }
|
||||
std::string inputInfo(unsigned long idx, bool verbose) override { return mBlocks[0]->inputInfo(idx, verbose); }
|
||||
std::string outputInfo(unsigned long idx, bool verbose) override { return mBlocks[0]->outputInfo(idx, verbose); }
|
||||
|
||||
virtual std::string audioInfo(unsigned long idx, bool verbose)
|
||||
std::string audioInfo(unsigned long idx, bool verbose) override
|
||||
{
|
||||
return formatInfo((mBlocks[0]->audioInfo(idx % mBlocks[0]->getNumAudioChans(), verbose) + " [#]").c_str(), idx / mBlocks[0]->getNumAudioChans());
|
||||
}
|
||||
|
||||
virtual FrameType inputType(unsigned long idx) const { return mBlocks[0]->inputType(idx); }
|
||||
virtual FrameType outputType(unsigned long idx) const { return mBlocks[0]->outputType(idx); }
|
||||
FrameType inputType(unsigned long idx) const override { return mBlocks[0]->inputType(idx); }
|
||||
FrameType outputType(unsigned long idx) const override { return mBlocks[0]->outputType(idx); }
|
||||
|
||||
virtual const FrameLib_Parameters *getParameters() const { return mBlocks[0]->getParameters(); }
|
||||
const FrameLib_Parameters *getParameters() const override { return mBlocks[0]->getParameters(); }
|
||||
|
||||
// Ordering Connections
|
||||
|
||||
virtual void autoOrderingConnections()
|
||||
void autoOrderingConnections() override
|
||||
{
|
||||
for (auto it = mBlocks.begin(); it != mBlocks.end(); it++)
|
||||
(*it)->autoOrderingConnections();
|
||||
}
|
||||
|
||||
virtual void clearAutoOrderingConnections()
|
||||
void clearAutoOrderingConnections() override
|
||||
{
|
||||
for (auto it = mBlocks.begin(); it != mBlocks.end(); it++)
|
||||
(*it)->clearAutoOrderingConnections();
|
||||
@@ -351,7 +363,7 @@ private:
|
||||
|
||||
// Update (expand)
|
||||
|
||||
virtual bool inputUpdate()
|
||||
bool inputUpdate() override
|
||||
{
|
||||
// Find number of channels (always keep at least one channel)
|
||||
|
||||
|
||||
@@ -338,7 +338,7 @@ private:
|
||||
|
||||
// Enum Parameter Class
|
||||
|
||||
class Enum : public Parameter
|
||||
class Enum final : public Parameter
|
||||
{
|
||||
|
||||
public:
|
||||
@@ -347,21 +347,21 @@ private:
|
||||
|
||||
// Setters
|
||||
|
||||
void addEnumItem(const char *str);
|
||||
void addEnumItem(const char *str) override;
|
||||
|
||||
virtual SetError set(double value);
|
||||
virtual SetError set(double *values, size_t N);
|
||||
virtual SetError set(const char *str);
|
||||
SetError set(double value) override;
|
||||
SetError set(double *values, size_t N) override;
|
||||
virtual SetError set(const char *str) override;
|
||||
|
||||
virtual void clear() { Enum::set(0.0); };
|
||||
void clear() override { Enum::set(0.0); }
|
||||
|
||||
virtual Type type() { return kEnum; }
|
||||
virtual Type type() override { return kEnum; }
|
||||
|
||||
// Getters
|
||||
|
||||
virtual double getValue() const { return mValue; }
|
||||
virtual const char *getString() const { return mItems[mValue].c_str(); }
|
||||
virtual const char *getItemString(unsigned long item) const { return mItems[item].c_str(); }
|
||||
virtual double getValue() const override { return mValue; }
|
||||
virtual const char *getString() const override { return mItems[mValue].c_str(); }
|
||||
virtual const char *getItemString(unsigned long item) const override { return mItems[item].c_str(); }
|
||||
|
||||
private:
|
||||
|
||||
@@ -373,7 +373,7 @@ private:
|
||||
|
||||
// Value Parameter Class
|
||||
|
||||
class Value : public Parameter
|
||||
class Value final : public Parameter
|
||||
{
|
||||
|
||||
public:
|
||||
@@ -383,16 +383,16 @@ private:
|
||||
|
||||
// Setters
|
||||
|
||||
virtual SetError set(double value);
|
||||
virtual SetError set(double *values, size_t N);
|
||||
SetError set(double value) override;
|
||||
SetError set(double *values, size_t N) override;
|
||||
|
||||
virtual void clear() { Value::set(mDefault); };
|
||||
void clear() override { Value::set(mDefault); };
|
||||
|
||||
// Getters
|
||||
|
||||
virtual Type type() { return kValue; }
|
||||
Type type() override { return kValue; }
|
||||
|
||||
virtual double getValue() const { return mValue; }
|
||||
double getValue() const override { return mValue; }
|
||||
|
||||
private:
|
||||
|
||||
@@ -403,7 +403,7 @@ private:
|
||||
|
||||
// String Parameter Class
|
||||
|
||||
class String : public Parameter
|
||||
class String final : public Parameter
|
||||
{
|
||||
const static size_t maxLen = 128;
|
||||
|
||||
@@ -413,15 +413,15 @@ private:
|
||||
|
||||
// Setters
|
||||
|
||||
virtual SetError set(const char *str);
|
||||
SetError set(const char *str) override;
|
||||
|
||||
virtual void clear() { String::set(nullptr); };
|
||||
void clear() override { String::set(nullptr); };
|
||||
|
||||
// Getters
|
||||
|
||||
virtual Type type() { return kString; }
|
||||
Type type() override { return kString; }
|
||||
|
||||
virtual const char *getString() const { return mCString; }
|
||||
const char *getString() const override { return mCString; }
|
||||
|
||||
private:
|
||||
|
||||
@@ -432,7 +432,7 @@ private:
|
||||
|
||||
// Array Parameter Class
|
||||
|
||||
class Array : public Parameter, private std::vector<double>
|
||||
class Array final : public Parameter, private std::vector<double>
|
||||
{
|
||||
|
||||
public:
|
||||
@@ -442,17 +442,17 @@ private:
|
||||
|
||||
// Setters
|
||||
|
||||
virtual SetError set(double *values, size_t N);
|
||||
SetError set(double *values, size_t N) override;
|
||||
|
||||
virtual void clear() { Array::set(nullptr, 0); };
|
||||
void clear() override { Array::set(nullptr, 0); };
|
||||
|
||||
// Getters
|
||||
|
||||
virtual Type type() { return mVariableSize ? kVariableArray : kArray; }
|
||||
Type type() override { return mVariableSize ? kVariableArray : kArray; }
|
||||
|
||||
virtual size_t getArraySize() const { return mSize; }
|
||||
virtual size_t getArrayMaxSize() const { return mItems.size(); }
|
||||
virtual const double * getArray() const { return mItems.data(); }
|
||||
size_t getArraySize() const override { return mSize; }
|
||||
size_t getArrayMaxSize() const override { return mItems.size(); }
|
||||
const double * getArray() const override { return mItems.data(); }
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -2336,7 +2336,6 @@
|
||||
B8DF3FA2198AABAD00CA8BB6 /* FrameLib_Parameters.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FrameLib_Parameters.h; sourceTree = "<group>"; };
|
||||
B8E058AE198DA34D00721359 /* FrameLib_Object.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FrameLib_Object.h; sourceTree = "<group>"; };
|
||||
B8E41AE620C307EB003BBD86 /* fl.expression~.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = "fl.expression~.cpp"; sourceTree = "<group>"; };
|
||||
B8E41AE820C30AE2003BBD86 /* exprtk.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = exprtk.hpp; sourceTree = "<group>"; };
|
||||
B8E41B0720C36599003BBD86 /* FrameLib_ExprParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FrameLib_ExprParser.h; sourceTree = "<group>"; };
|
||||
B8E41B1C20C5E71C003BBD86 /* fl.expr~.mxo */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "fl.expr~.mxo"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
B8E41B1E20C5E763003BBD86 /* FrameLib_Expression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FrameLib_Expression.h; sourceTree = "<group>"; };
|
||||
@@ -4481,7 +4480,6 @@
|
||||
B8C2D6071F6BFF60009A7C96 /* TableReader.hpp */,
|
||||
B87E876619C8EEB900B1D0CD /* HISSTools_FFT */,
|
||||
B8F6E4DA199D24820073E06D /* tlsf */,
|
||||
B8E41AE920C30AF1003BBD86 /* exprtk */,
|
||||
);
|
||||
name = Dependencies;
|
||||
path = FrameLib_Dependencies;
|
||||
@@ -4778,14 +4776,6 @@
|
||||
path = FrameLib_Max_Objects/Expressions;
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
B8E41AE920C30AF1003BBD86 /* exprtk */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B8E41AE820C30AE2003BBD86 /* exprtk.hpp */,
|
||||
);
|
||||
path = exprtk;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B8F5A4DF1F2A619200D4777C /* Spatial */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
||||
Reference in New Issue
Block a user