blob: 3dbe8cfdf7e65a8b6f19eaacb55f4bf8533b6ca3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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;
}
}
|