-
Notifications
You must be signed in to change notification settings - Fork 0
/
ISpreadsheet.cpp
41 lines (37 loc) · 999 Bytes
/
ISpreadsheet.cpp
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
//
// Created by Frederik Desmet on 29/04/2022.
//
#include <utility>
#include "ISpreadsheet.h"
#include "Spreadsheet.h"
ISpreadsheet::ISpreadsheet(const SpreadsheetApplication& theApp, size_t width, size_t height)
{
_spreadsheet = std::make_unique<Spreadsheet>(theApp, width, height);
}
ISpreadsheet::ISpreadsheet(const ISpreadsheet& src)
{
_spreadsheet = std::make_unique<Spreadsheet>(*src._spreadsheet);
}
ISpreadsheet::~ISpreadsheet() = default;
void ISpreadsheet::setCellAt(size_t x, size_t y, const SpreadsheetCell& cell)
{
_spreadsheet->setCellAt(x, y, cell);
}
SpreadsheetCell& ISpreadsheet::getCellAt(size_t x, size_t y)
{
return _spreadsheet->getCellAt(x, y);
}
size_t ISpreadsheet::getId() const
{
return _spreadsheet->getId();
}
ISpreadsheet& ISpreadsheet::operator=(const ISpreadsheet& rhs)
{
*_spreadsheet = *rhs._spreadsheet;
return *this;
}
void swap(ISpreadsheet& first, ISpreadsheet& second) noexcept
{
using std::swap;
swap(first._spreadsheet, second._spreadsheet);
}