Files
Upsilon/apps/graph/function_store.h
Émilie Feral ab74fe6933 [apps/graphs] Modify how functions are handled by the function store
Change-Id: I0d7a989526440a3b6d6a925b30d0d8742017e3f9
2016-09-26 14:51:10 +02:00

30 lines
721 B
C++

#ifndef GRAPH_FUNCTION_STORE_H
#define GRAPH_FUNCTION_STORE_H
#include "function.h"
namespace Graph {
/* FunctionStore is a dumb class.
* Its only job is to store functions and to give them a color. */
class FunctionStore {
public:
FunctionStore();
Function * functionAtIndex(int i);
Function * addEmptyFunction();
void removeFunction(Function * f);
int numberOfFunctions();
private:
constexpr static int numberOfDefaultColors = 4;
constexpr static KDColor defaultColors[numberOfDefaultColors] = {
KDColorRed, KDColorGreen, KDColorBlue, KDColorBlack
};
int m_numberOfFunctions;
static constexpr int k_maxNumberOfFunctions = 8;
Function m_functions[k_maxNumberOfFunctions];
};
}
#endif