From 0818f3de0fe44ad53358fafd57c6d7dea729d319 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Sat, 6 Dec 2014 00:57:35 +0100 Subject: place to put generic parts of the Storage class impl --- common/storage_common.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 common/storage_common.cpp (limited to 'common') diff --git a/common/storage_common.cpp b/common/storage_common.cpp new file mode 100644 index 0000000..bc1acc4 --- /dev/null +++ b/common/storage_common.cpp @@ -0,0 +1,21 @@ +#include "storage.h" + +#include + +void errorHandler(const Storage::Error &error) +{ + //TODO: allow this to be turned on / off globally + //TODO: log $SOMEWHERE $SOMEHOW rather than just spit to stderr + std::cerr << "Read error in " << error.store << ", code " << error.code << ", message: " << error.message << std::endl; +} + +void Storage::read(const std::string &sKey, const std::function &resultHandler) +{ + read(sKey, resultHandler, &errorHandler); +} + +void Storage::read(const std::string &sKey, const std::function &resultHandler) +{ + read(sKey, resultHandler, &errorHandler); +} + -- cgit v1.2.3