3#include "util/async/context/impl/Cancellation.hpp"
10template <
typename RetType,
typename StopSourceType>
15template <
typename RetType>
23template <
typename RetType>
26 std::promise<RetType> promise_;
29 using DataType = RetType;
31 BasicOutcome() =
default;
32 BasicOutcome(BasicOutcome&&) =
default;
34 BasicOutcome(BasicOutcome
const&) =
delete;
42 setValue(std::convertible_to<RetType>
auto&& val)
44 promise_.set_value(std::forward<
decltype(val)>(val));
53 promise_.set_value({});
61 [[nodiscard]] std::future<RetType>
64 return promise_.get_future();
75template <
typename RetType>
96template <
typename RetType,
typename StopSourceType>
99 StopSourceType stopSource_;
118 [[nodiscard]] StopSourceType&
Unstoppable outcome.
Definition Outcome.hpp:76
impl::BasicOperation< Outcome > getOperation()
Gets the unstoppable operation for this outcome.
Definition Outcome.hpp:84
The future side of async operations that can be stopped.
Definition Operation.hpp:151
Stoppable outcome.
Definition Outcome.hpp:97
StoppableOperation< RetType, StopSourceType > getOperation()
Gets the stoppable operation for this outcome.
Definition Outcome.hpp:108
StopSourceType & getStopSource()
Gets the stop source for this outcome.
Definition Outcome.hpp:119
Definition Operation.hpp:26
Base for all promise side of async operations.
Definition Outcome.hpp:24
void setValue(std::convertible_to< RetType > auto &&val)
Sets the value on the inner promise.
Definition Outcome.hpp:42
std::future< RetType > getStdFuture()
Get the future for the inner promise.
Definition Outcome.hpp:62
void setValue()
Sets the value channel for void operations.
Definition Outcome.hpp:51
This namespace implements an async framework built on top of execution contexts.
Definition AnyExecutionContext.hpp:17