summaryrefslogtreecommitdiff
path: root/src/storage.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/storage.cc')
-rw-r--r--src/storage.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/storage.cc b/src/storage.cc
index 17c902d..ee2e7e7 100644
--- a/src/storage.cc
+++ b/src/storage.cc
@@ -1,6 +1,7 @@
#include "storage.h"
#include "definitions.h"
#include <algorithm>
+#include <stdexcept>
Storage::Storage(int delay)
{
@@ -21,6 +22,18 @@ Storage::view(int base, int lines) const
}
int
+Storage::preprocess(void *id)
+{
+ if (id == nullptr)
+ throw std::invalid_argument("Accessor cannot be nullptr.");
+
+ if (this->current_request == nullptr)
+ this->current_request = id;
+
+ return this->current_request == id;
+}
+
+int
Storage::is_data_ready()
{
int r;