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

#include <InlineTask.h>

Inheritance diagram for folly::coro::detail::InlineTaskPromise< T >:
folly::coro::detail::InlineTaskPromiseBase

Public Member Functions

 InlineTaskPromise () noexcept=default
 
 ~InlineTaskPromise ()=default
 
InlineTask< Tget_return_object () noexcept
 
template<typename Value , std::enable_if_t< std::is_convertible< Value &&, T >::value, int > = 0>
void return_value (Value &&value) noexcept(std::is_nothrow_constructible< T, Value && >::value)
 
void return_value (T &&value) noexcept(std::is_nothrow_move_constructible< T >::value)
 
void unhandled_exception () noexcept
 
T result ()
 
- Public Member Functions inherited from folly::coro::detail::InlineTaskPromiseBase
std::experimental::suspend_always initial_suspend () noexcept
 
auto final_suspend () noexcept
 
void set_continuation (std::experimental::coroutine_handle<> continuation) noexcept
 

Private Types

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

Private Attributes

folly::Try< StorageTyperesult_
 

Additional Inherited Members

- Protected Member Functions inherited from folly::coro::detail::InlineTaskPromiseBase
 InlineTaskPromiseBase () noexcept=default
 
 InlineTaskPromiseBase (const InlineTaskPromiseBase &)=delete
 
 InlineTaskPromiseBase (InlineTaskPromiseBase &&)=delete
 
InlineTaskPromiseBaseoperator= (const InlineTaskPromiseBase &)=delete
 
InlineTaskPromiseBaseoperator= (InlineTaskPromiseBase &&)=delete
 

Detailed Description

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

Definition at line 88 of file InlineTask.h.

Member Typedef Documentation

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

Definition at line 133 of file InlineTask.h.

Constructor & Destructor Documentation

template<typename T >
folly::coro::detail::InlineTaskPromise< T >::InlineTaskPromise ( )
defaultnoexcept
template<typename T >
folly::coro::detail::InlineTaskPromise< T >::~InlineTaskPromise ( )
default

Member Function Documentation

template<typename T >
InlineTask< T > folly::coro::detail::InlineTaskPromise< T >::get_return_object ( )
inlinenoexcept

Definition at line 221 of file InlineTask.h.

221  {
222  return InlineTask<T>{
223  std::experimental::coroutine_handle<InlineTaskPromise<T>>::from_promise(
224  *this)};
225 }
template<typename T >
T folly::coro::detail::InlineTaskPromise< T >::result ( )
inline

Definition at line 123 of file InlineTask.h.

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

123  {
124  return std::move(result_).value();
125  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
folly::Try< StorageType > result_
Definition: InlineTask.h:135
template<typename T >
template<typename Value , std::enable_if_t< std::is_convertible< Value &&, T >::value, int > = 0>
void folly::coro::detail::InlineTaskPromise< T >::return_value ( Value &&  value)
inlinenoexcept

Definition at line 106 of file InlineTask.h.

107  {
108  result_.emplace(static_cast<Value&&>(value));
109  }
T & emplace(Args &&...args) noexcept(std::is_nothrow_constructible< T, Args &&... >::value)
Definition: Try-inl.h:121
folly::Try< StorageType > result_
Definition: InlineTask.h:135
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
template<typename T >
void folly::coro::detail::InlineTaskPromise< T >::return_value ( T &&  value)
inlinenoexcept

Definition at line 113 of file InlineTask.h.

114  {
115  result_.emplace(static_cast<T&&>(value));
116  }
T & emplace(Args &&...args) noexcept(std::is_nothrow_constructible< T, Args &&... >::value)
Definition: Try-inl.h:121
folly::Try< StorageType > result_
Definition: InlineTask.h:135
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
template<typename T >
void folly::coro::detail::InlineTaskPromise< T >::unhandled_exception ( )
inlinenoexcept

Definition at line 118 of file InlineTask.h.

References folly::exception_wrapper::from_exception_ptr().

118  {
120  folly::exception_wrapper::from_exception_ptr(std::current_exception()));
121  }
static exception_wrapper from_exception_ptr(std::exception_ptr const &eptr) noexcept
folly::Try< StorageType > result_
Definition: InlineTask.h:135
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 >
folly::Try<StorageType> folly::coro::detail::InlineTaskPromise< T >::result_
private

Definition at line 135 of file InlineTask.h.


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