proxygen
folly::coro::detail::TaskPromise< T > Class Template Reference

#include <Task.h>

Inheritance diagram for folly::coro::detail::TaskPromise< T >:
folly::coro::detail::TaskPromiseBase

Public Member Functions

 TaskPromise () noexcept=default
 
Task< Tget_return_object () noexcept
 
void unhandled_exception () noexcept
 
template<typename U >
void return_value (U &&value)
 
T getResult ()
 
- Public Member Functions inherited from folly::coro::detail::TaskPromiseBase
std::experimental::suspend_always initial_suspend () noexcept
 
FinalAwaiter final_suspend () noexcept
 
template<typename U >
auto await_transform (Task< U > &&t) noexcept
 
template<typename Awaitable >
auto await_transform (Awaitable &&awaitable) noexcept
 
auto await_transform (folly::coro::getCurrentExecutor) noexcept
 
template<typename T >
auto await_transform (Task< T > &&t) noexcept
 

Private Types

using StorageType = std::conditional_t< std::is_reference< T >::value, std::reference_wrapper< std::remove_reference_t< T >>, T >
 

Private Attributes

Try< StorageTyperesult_
 

Additional Inherited Members

- Protected Member Functions inherited from folly::coro::detail::TaskPromiseBase
 TaskPromiseBase () noexcept
 

Detailed Description

template<typename T>
class folly::coro::detail::TaskPromise< T >

Definition at line 101 of file Task.h.

Member Typedef Documentation

template<typename T >
using folly::coro::detail::TaskPromise< T >::StorageType = std::conditional_t< std::is_reference<T>::value, std::reference_wrapper<std::remove_reference_t<T>>, T>
private

Definition at line 128 of file Task.h.

Constructor & Destructor Documentation

template<typename T >
folly::coro::detail::TaskPromise< T >::TaskPromise ( )
defaultnoexcept

Member Function Documentation

template<typename T >
Task< T > folly::coro::detail::TaskPromise< T >::get_return_object ( )
noexcept

Definition at line 353 of file Task.h.

353  {
354  return Task<T>{
355  std::experimental::coroutine_handle<detail::TaskPromise<T>>::from_promise(
356  *this)};
357 }
template<typename T >
T folly::coro::detail::TaskPromise< T >::getResult ( )
inline

Definition at line 120 of file Task.h.

References folly::gen::move, folly::T, and value.

120  {
121  return static_cast<T&&>(std::move(result_).value());
122  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
folly::std T
Try< StorageType > result_
Definition: Task.h:130
template<typename T >
template<typename U >
void folly::coro::detail::TaskPromise< T >::return_value ( U &&  value)
inline

Definition at line 113 of file Task.h.

References value, and folly::value().

113  {
114  static_assert(
116  "cannot convert return value to type T");
117  result_.emplace(static_cast<U&&>(value));
118  }
T & emplace(Args &&...args) noexcept(std::is_nothrow_constructible< T, Args &&... >::value)
Definition: Try-inl.h:121
Try< StorageType > result_
Definition: Task.h:130
static const char *const value
Definition: Conv.cpp:50
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
template<typename T >
void folly::coro::detail::TaskPromise< T >::unhandled_exception ( )
inlinenoexcept

Definition at line 107 of file Task.h.

References folly::exception_wrapper::from_exception_ptr().

107  {
109  exception_wrapper::from_exception_ptr(std::current_exception()));
110  }
static exception_wrapper from_exception_ptr(std::exception_ptr const &eptr) noexcept
Try< StorageType > result_
Definition: Task.h:130
exception_wrapper & emplaceException(Args &&...args) noexcept(std::is_nothrow_constructible< exception_wrapper, Args &&... >::value)
Definition: Try-inl.h:131

Member Data Documentation

template<typename T >
Try<StorageType> folly::coro::detail::TaskPromise< T >::result_
private

Definition at line 130 of file Task.h.


The documentation for this class was generated from the following file: