-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcell.h
More file actions
57 lines (36 loc) · 1.24 KB
/
cell.h
File metadata and controls
57 lines (36 loc) · 1.24 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
50
51
52
53
54
55
56
57
#pragma once
#include "common.h"
#include "formula.h"
#include <functional>
#include <unordered_set>
class Sheet;
std::ostream &operator<<(std::ostream &output, const CellInterface::Value &value);
class Cell : public CellInterface {
public:
Cell(SheetInterface& sheet);
~Cell();
void Set(const 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;
std::unique_ptr<Impl> impl_;
std::unordered_set<Cell*> outRefCells_;
std::unordered_set<Cell*> inRefCells_;
SheetInterface &sheet_;
//поиск циклической зависимости
//обход графа по зависимым ячейкам начиная с impl
bool CircularDependency(const Impl &impl_) const;
//обновление зависимосте по ячейке
void FillCellsRefs();
//инвалидировать кэш по зависимым
void InvalidateCache();
};
//Создает пустую ячейку
std::unique_ptr<Cell> CreateCell(SheetInterface &sheet);