diff options
author | bd <bdunaisky@umass.edu> | 2025-04-12 01:38:39 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-12 01:38:39 +0000 |
commit | be2bc108dc112ae7e21d4a77f7bcbfac88d6fcd4 (patch) | |
tree | 08549aa6c7cbae114958df62f92c9e60eb5f114c /src/storage.cc | |
parent | 101f0facf8002907ca6e19faabfdcf472c0c3152 (diff) | |
parent | 1fb7a9bd5eb41e87871bcbb3423caaabdd8ce1d9 (diff) |
Merge pull request #1 from bdunahu/bdunahu
First part of storage rework (see description)
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; } |