diff --git a/apps/graph/function_store.cpp b/apps/graph/function_store.cpp index 89036fe1a..fa5590b5f 100644 --- a/apps/graph/function_store.cpp +++ b/apps/graph/function_store.cpp @@ -60,6 +60,10 @@ void FunctionStore::removeFunction(Shared::Function * f) { } } +int FunctionStore::maxNumberOfFunctions() { + return k_maxNumberOfFunctions; +} + const char * FunctionStore::firstAvailableName() { for (int k = 0; k < k_maxNumberOfFunctions; k++) { int j = 0; diff --git a/apps/graph/function_store.h b/apps/graph/function_store.h index d32b25c13..0f0476f87 100644 --- a/apps/graph/function_store.h +++ b/apps/graph/function_store.h @@ -16,6 +16,7 @@ public: Function * definedFunctionAtIndex(int i) override; Function * addEmptyFunction() override; void removeFunction(Shared::Function * f) override; + int maxNumberOfFunctions() override; static constexpr int k_maxNumberOfFunctions = 8; private: const char * firstAvailableName() override; diff --git a/apps/sequence/sequence_store.cpp b/apps/sequence/sequence_store.cpp index 2ebe6fe66..4b030cf8b 100644 --- a/apps/sequence/sequence_store.cpp +++ b/apps/sequence/sequence_store.cpp @@ -52,6 +52,10 @@ void SequenceStore::removeFunction(Shared::Function * f) { } } +int SequenceStore::maxNumberOfFunctions() { + return k_maxNumberOfSequences; +} + const char * SequenceStore::firstAvailableName() { for (int k = 0; k < k_maxNumberOfSequences; k++) { int j = 0; diff --git a/apps/sequence/sequence_store.h b/apps/sequence/sequence_store.h index 42a2f62ea..8cb7fa68e 100644 --- a/apps/sequence/sequence_store.h +++ b/apps/sequence/sequence_store.h @@ -16,6 +16,7 @@ public: Sequence * definedFunctionAtIndex(int i) override; Sequence * addEmptyFunction() override; void removeFunction(Shared::Function * f) override; + int maxNumberOfFunctions() override; static constexpr int k_maxNumberOfSequences = 3; private: const char * firstAvailableName() override; diff --git a/apps/shared/function_store.h b/apps/shared/function_store.h index 5e4f4adf2..6aa02f57d 100644 --- a/apps/shared/function_store.h +++ b/apps/shared/function_store.h @@ -23,6 +23,7 @@ public: int numberOfDefinedFunctions(); // An active function must be defined to be counted int numberOfActiveFunctions(); + virtual int maxNumberOfFunctions() = 0; protected: int m_numberOfFunctions; private: