mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 08:47:28 +01:00
implementation of removeAll (always let an empty function in cartesian functions) Change-Id: I5e91a0ea427ba823eee4f86cdd8b7cd5426df2c6
39 lines
1.0 KiB
C++
39 lines
1.0 KiB
C++
#ifndef SHARED_FUNCTION_STORE_H
|
|
#define SHARED_FUNCTION_STORE_H
|
|
|
|
#include "function.h"
|
|
#include <stdint.h>
|
|
|
|
namespace Shared {
|
|
|
|
/* FunctionStore is a dumb class.
|
|
* Its only job is to store functions and to give them a color. */
|
|
|
|
class FunctionStore {
|
|
public:
|
|
FunctionStore();
|
|
virtual uint32_t storeChecksum() = 0;
|
|
virtual Function * functionAtIndex(int i) = 0;
|
|
virtual Function * activeFunctionAtIndex(int i);
|
|
virtual Function * definedFunctionAtIndex(int i);
|
|
virtual Function * addEmptyFunction() = 0;
|
|
virtual void removeFunction(Function * f) = 0;
|
|
virtual void removeAll() = 0;
|
|
int numberOfFunctions();
|
|
// Functions can be undefined when they have a color and a name but no content
|
|
int numberOfDefinedFunctions();
|
|
// An active function must be defined to be counted
|
|
int numberOfActiveFunctions();
|
|
virtual int maxNumberOfFunctions() = 0;
|
|
virtual char symbol() const = 0;
|
|
protected:
|
|
int m_numberOfFunctions;
|
|
private:
|
|
virtual const char * firstAvailableName() = 0;
|
|
virtual const KDColor firstAvailableColor() = 0;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|