summaryrefslogtreecommitdiffstats
path: root/persistence/src/vespa/persistence/spi/catchresult.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'persistence/src/vespa/persistence/spi/catchresult.cpp')
-rw-r--r--persistence/src/vespa/persistence/spi/catchresult.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/persistence/src/vespa/persistence/spi/catchresult.cpp b/persistence/src/vespa/persistence/spi/catchresult.cpp
new file mode 100644
index 00000000000..3dbe8cfdf7e
--- /dev/null
+++ b/persistence/src/vespa/persistence/spi/catchresult.cpp
@@ -0,0 +1,25 @@
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#include "catchresult.h"
+#include "result.h"
+#include <cassert>
+
+namespace storage::spi {
+
+CatchResult::CatchResult()
+ : _promisedResult(),
+ _resulthandler(nullptr)
+{}
+CatchResult::~CatchResult() = default;
+
+void
+CatchResult::onComplete(std::unique_ptr<Result> result) {
+ _promisedResult.set_value(std::move(result));
+}
+void
+CatchResult::addResultHandler(const ResultHandler * resultHandler) {
+ assert(_resulthandler == nullptr);
+ _resulthandler = resultHandler;
+}
+
+}