Files
Upsilon/apps/calculation/calculation_store.h
Émilie Feral 71284311bb [escher] [apps] Implement app snapshot
Change-Id: I24d7eed7cef964af8be1c85222e758c297dc0da1
2017-05-18 14:16:41 +02:00

28 lines
606 B
C++

#ifndef CALCULATION_CALCULATION_STORE_H
#define CALCULATION_CALCULATION_STORE_H
#include "calculation.h"
namespace Calculation {
// TODO: make tests for the ring buffer
class CalculationStore {
public:
CalculationStore();
Calculation * calculationAtIndex(int i);
Calculation * push(const char * text, Poincare::Context * context);
void deleteCalculationAtIndex(int i);
void deleteAll();
int numberOfCalculations();
void tidy();
private:
static constexpr int k_maxNumberOfCalculations = 10;
Calculation * m_start;
Calculation m_calculations[k_maxNumberOfCalculations];
};
}
#endif