16#include "pw_async2/context.h"
17#include "pw_async2/future.h"
18#include "pw_async2/poll.h"
19#include "pw_async2/task.h"
53 template <
typename Arg,
typename... Args>
56 future_(std::forward<Arg>(arg), std::forward<Args>(args)...),
76 return std::move(output_).value();
90 output_ = future_.Pend(cx);
99FutureTask(T&& value) -> FutureTask<T>;
Definition: future_task.h:39
constexpr FutureTask(Arg &&arg, Args &&... args)
Definition: future_task.h:54
FutureValue< future_type > & value() &
Definition: future_task.h:69
FutureValue< future_type > && value() &&
Definition: future_task.h:73
typename future_type::value_type value_type
The type produced by this tasks's future when it completes.
Definition: future_task.h:45
Poll DoPend(Context &cx) override
Definition: future_task.h:89
const FutureValue< future_type > && value() const &&
Definition: future_task.h:75
std::remove_reference_t< T > future_type
The type of the future that is pended by this task.
Definition: future_task.h:42
FutureValue< future_type > & Wait()
Definition: future_task.h:81
const FutureValue< future_type > & value() const &
Definition: future_task.h:71
Poll< value_type > TakePoll()
Definition: future_task.h:64
std::conditional_t< std::is_void_v< typename T::value_type >, ReadyType, typename T::value_type > FutureValue
Definition: future.h:107
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:35