FMI Table
| Kamen Mladenov | FMI Computer Science Year 1 Group 6 | Project 2 | Project Topic 7 |
CellFormula.h
Go to the documentation of this file.
1#ifndef HEADER_CELLFORMULA
2#define HEADER_CELLFORMULA
3
8#include "Cell.h"
9#include "CellDouble.h"
10#include "../Generic/List/List.hpp"
11#include "../Generic/Pair/Pair.hpp"
12
17class CellFormula : public Cell {
18 const List<List<Cell*>>* tableCells;
19 List<CellDouble> localCells;
20
21 List<Pair<Pair<int, int>, char>> formula;
22 String rawFormula;
23
24 const Cell* ptrByInd(Pair<int, int> loc) const;
25 double calculate(unsigned index = 0) const;
26
27public:
28 CellFormula() = default;
29 CellFormula(const char* str, const List<List<Cell*>>* tableCells);
30
31 double getNumeralValue() const override;
32 String getValueForPrint() const override;
33 void parseAndSetValue(const char* str) override;
34 void writeToFile(std::ofstream& file) override;
35};
36
37#endif
Stores the declaration of class CellDouble.
Stores the declaration of class Cell.
A table cell which contains a formula.
Definition: CellFormula.h:17
void writeToFile(std::ofstream &file) override
Writes value to a text file.
Definition: CellFormula.cpp:188
String getValueForPrint() const override
Definition: CellFormula.cpp:84
double getNumeralValue() const override
Definition: CellFormula.cpp:69
void parseAndSetValue(const char *str) override
Definition: CellFormula.cpp:128
Fully abstract class that represents a cell in the table.
Definition: Cell.h:13
Templated class that stores an array of elements in dynamic memory.
Definition: List.hpp:22
A dynamically-allocated C-style string with extra features.
Definition: String.h:17
Stores two values of any types.
Definition: Pair.hpp:13