mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-20 01:08:15 +01:00
GraphApp: Use a FunctionStore
Change-Id: Ib75947c40167489726fafc493ccb0ebf2862142b
This commit is contained in:
23
apps/graph/function_store.cpp
Normal file
23
apps/graph/function_store.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "function_store.h"
|
||||
extern "C" {
|
||||
#include <assert.h>
|
||||
}
|
||||
|
||||
Graph::FunctionStore::FunctionStore() :
|
||||
m_numberOfFunctions(0)
|
||||
{
|
||||
}
|
||||
|
||||
Graph::Function * Graph::FunctionStore::functionAtIndex(int i) {
|
||||
assert(i>=0 && i<m_numberOfFunctions);
|
||||
return &m_functions[i];
|
||||
}
|
||||
|
||||
void Graph::FunctionStore::pushFunction(const char * functionText) {
|
||||
assert(m_numberOfFunctions < k_maxNumberOfFunctions);
|
||||
m_functions[m_numberOfFunctions++] = Function(functionText);
|
||||
}
|
||||
|
||||
int Graph::FunctionStore::numberOfFunctions() {
|
||||
return m_numberOfFunctions;
|
||||
}
|
||||
Reference in New Issue
Block a user