16#include "pw_async2/future.h"
17#include "pw_async2/poll.h"
18#include "pw_async2/task.h"
52 template <
typename Arg,
typename... Args>
55 future_(std::forward<Arg>(arg), std::forward<Args>(args)...),
75 return std::move(output_).value();
89 output_ = future_.Pend(cx);
98FutureTask(T&& value) -> FutureTask<T>;
Definition: future_task.h:38
constexpr FutureTask(Arg &&arg, Args &&... args)
Definition: future_task.h:53
FutureValue< future_type > & value() &
Definition: future_task.h:68
FutureValue< future_type > && value() &&
Definition: future_task.h:72
typename future_type::value_type value_type
The type produced by this tasks's future when it completes.
Definition: future_task.h:44
Poll DoPend(Context &cx) override
Definition: future_task.h:88
const FutureValue< future_type > && value() const &&
Definition: future_task.h:74
std::remove_reference_t< T > future_type
The type of the future that is pended by this task.
Definition: future_task.h:41
FutureValue< future_type > & Wait()
Definition: future_task.h:80
const FutureValue< future_type > & value() const &
Definition: future_task.h:70
Poll< value_type > TakePoll()
Definition: future_task.h:63
std::conditional_t< std::is_void_v< typename T::value_type >, ReadyType, typename T::value_type > FutureValue
Definition: future.h:110
constexpr Poll Readiness() const noexcept
Definition: poll.h:218
constexpr PendingType Pending()
Returns a value indicating that an operation was not yet able to complete.
Definition: poll.h:353
constexpr value_type & value() &noexcept
Definition: poll.h:228
#define PW_ASYNC_TASK_NAME(name)
Generates a token for use as a task name.
Definition: task.h:33