diff options
Diffstat (limited to 'src/storage.cc')
-rw-r--r-- | src/storage.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/storage.cc b/src/storage.cc index fed607b..4ad916b 100644 --- a/src/storage.cc +++ b/src/storage.cc @@ -2,15 +2,19 @@ #include "definitions.h" #include <algorithm> +Storage::Storage(int delay) { + this->data = new std::vector<std::array<signed int, LINE_SIZE>>; + this->delay = delay; + this->lower = nullptr; + this->current_request = nullptr; + this->wait_time = this->delay; +} + std::vector<std::array<signed int, LINE_SIZE>> Storage::view(int base, int lines) const { base = (base / LINE_SIZE) * LINE_SIZE; std::vector<std::array<signed int, LINE_SIZE>> ret(lines + 1); - std::copy( - this->data->begin() + base, this->data->begin() + base + lines, - ret.begin()); + std::copy(this->data->begin() + base, this->data->begin() + base + lines, ret.begin()); return ret; } - -Storage *Storage::get_lower() { return this->lower; } |