[apps/shared] Add method in shared function store

Change-Id: I1b15ed95e7e9a5c4cffe303e5f699ec03ad87b45
This commit is contained in:
Émilie Feral
2017-02-07 10:53:36 +01:00
parent a6ee2c6ef0
commit 6cf5b9d317
5 changed files with 11 additions and 0 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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: