diff options
| Commit | 5d13f960965d8dce18cc32ef71d73df76f5c8395 (patch) | |
|---|---|---|
| Author | 2022-05-28 16:14:00 +0300 | |
| Committer | 2022-05-28 16:14:00 +0300 | |
| Files | 5657056afe1090c09425c14d515dc6d066b394f5 /src | |
| FMI-OOP-P2_Tables-5d13f960965d8dce18cc32ef71d73df76f5c8395.tar FMI-OOP-P2_Tables-5d13f960965d8dce18cc32ef71d73df76f5c8395.tar.gz FMI-OOP-P2_Tables-5d13f960965d8dce18cc32ef71d73df76f5c8395.zip | ||
| Parent | 13f94e28b06966adcfee9a8a7d90b49b1e4bf3a1 (diff) | |
Autocommit at 28.05.2022 @ 16:14
3 files changed, 32 insertions, 2 deletions
| -rw-r--r-- | src/Generic/Pair/Pair.hpp | 21 | ||||
| -rw-r--r-- | src/Models/CellFormula.cpp | 2 | ||||
| -rw-r--r-- | src/Models/CellFormula.h | 11 |
diff --git a/src/Generic/Pair/Pair.hpp b/src/Generic/Pair/Pair.hpp index 460bd56..e21ea51 100644 --- a/src/Generic/Pair/Pair.hpp +++ b/src/Generic/Pair/Pair.hpp @@ -7,7 +7,28 @@ class Pair { U right; public: + Pair(); Pair(const T& left, const U& right); + + const T& l(); + const U& r(); }; +template <typename T, typename U> +Pair<T, U>::Pair() : left(), right() {} + + +template <typename T, typename U> +Pair<T, U>::Pair(const T& left, const U& right) : left(left), right(right) {} + +template <typename T, typename U> +const T& Pair<T, U>::l() { + return left; +} + +template <typename T, typename U> +const U& Pair<T, U>::r() { + return right; +} + #endif diff --git a/src/Models/CellFormula.cpp b/src/Models/CellFormula.cpp index 3f8b07b..e488b0f 100644 --- a/src/Models/CellFormula.cpp +++ b/src/Models/CellFormula.cpp @@ -2,7 +2,7 @@ #include <cstring> String CellFormula::getValueForPrint() { - Cell* a = 3; + double result = 0; return String() += value; } diff --git a/src/Models/CellFormula.h b/src/Models/CellFormula.h index cf349e0..505d305 100644 --- a/src/Models/CellFormula.h +++ b/src/Models/CellFormula.h @@ -3,10 +3,19 @@ #include "Cell.h" #include "../Generic/List/List.hpp" +#include "../Generic/Pair/Pair.hpp" class CellFormula : public Cell { + enum Op { + plus, + minus, + mult, + div, + pow, + }; + List<Cell*> referencedCells; - List<Pair<Cell*, char>> formula; + List<Pair<Cell*, Op>> formula; String rawFormula; public: |
