-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcell.h
More file actions
51 lines (35 loc) · 1.2 KB
/
cell.h
File metadata and controls
51 lines (35 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once
#include "common.h"
#include <set>
class Sheet;
class Cell final : public CellInterface {
public:
Cell(Sheet &sheet);
~Cell() override;
void Set(std::string text);
void Clear();
Value GetValue() const override;
std::string GetText() const override;
std::vector<Position> GetReferencedCells() const override;
bool IsReferenced() const;
private:
class Impl;
class EmptyImpl;
class TextImpl;
class FormulaImpl;
Sheet &sheet_;
std::unique_ptr<Impl> impl_;
// список ячеек, от которых зависит данная
std::set<Cell*> parents_;
// список ячеек, которые зависят от данной
std::set<Cell*> children_;
// устанавливает родителей ячейки
void SetParents();
// удаляет родителей ячейки
void DeleteParents();
void ClearCache();
// сбрасывает кэш у ячейки и всех её детей
void ClearChildrenCache();
// проверяет новую формулу на циклы в таблице
void TestCycles(const std::vector<Position> &parents, const Cell *root);
};