blob: 80d4f863971861c23df79e10f2380327ed34f205 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "operationcomplete.h"
#include <future>
namespace storage::spi {
class CatchResult : public OperationComplete {
public:
CatchResult();
~CatchResult() override;
std::future<std::unique_ptr<Result>> future_result() {
return _promisedResult.get_future();
}
void onComplete(std::unique_ptr<Result> result) override;
void addResultHandler(const ResultHandler * resultHandler) override;
private:
std::promise<std::unique_ptr<Result>> _promisedResult;
const ResultHandler *_resulthandler;
};
}
|