proxygen
folly::coro::detail::BlockingWaitPromise< T > Class Template Referencefinal

#include <BlockingWait.h>

Inheritance diagram for folly::coro::detail::BlockingWaitPromise< T >:
folly::coro::detail::BlockingWaitPromiseBase

Public Member Functions

 BlockingWaitPromise () noexcept=default
 
 ~BlockingWaitPromise ()=default
 
BlockingWaitTask< Tget_return_object () noexcept
 
void unhandled_exception () noexcept
 
template<typename U , std::enable_if_t< std::is_convertible< U, T >::value, int > = 0>
void return_value (U &&value) noexcept(std::is_nothrow_constructible< T, U && >::value)
 
folly::Try< TgetAsTry ()
 
T get ()
 
- Public Member Functions inherited from folly::coro::detail::BlockingWaitPromiseBase
 BlockingWaitPromiseBase () noexcept=default
 
std::experimental::suspend_always initial_suspend ()
 
FinalAwaiter final_suspend () noexcept
 

Private Attributes

folly::Try< T > * result_
 

Additional Inherited Members

- Protected Member Functions inherited from folly::coro::detail::BlockingWaitPromiseBase
void wait () noexcept
 

Detailed Description

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

Definition at line 72 of file BlockingWait.h.

Constructor & Destructor Documentation

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

Member Function Documentation

template<typename T >
T folly::coro::detail::BlockingWaitPromise< T >::get ( )
inline

Definition at line 103 of file BlockingWait.h.

103  {
104  return getAsTry().value();
105  }
template<typename T >
BlockingWaitTask< T > folly::coro::detail::BlockingWaitPromise< T >::get_return_object ( )
inlinenoexcept

Definition at line 232 of file BlockingWait.h.

232  {
233  return BlockingWaitTask<T>{
234  std::experimental::coroutine_handle<BlockingWaitPromise<T>>::from_promise(
235  *this)};
236 }
template<typename T >
folly::Try<T> folly::coro::detail::BlockingWaitPromise< T >::getAsTry ( )
inline

Definition at line 93 of file BlockingWait.h.

References folly::coro::detail::BlockingWaitPromiseBase::wait().

93  {
94  folly::Try<T> result;
95  result_ = &result;
96  std::experimental::coroutine_handle<BlockingWaitPromise<T>>::from_promise(
97  *this)
98  .resume();
99  this->wait();
100  return result;
101  }
Definition: Try.h:51
template<typename T >
template<typename U , std::enable_if_t< std::is_convertible< U, T >::value, int > = 0>
void folly::coro::detail::BlockingWaitPromise< T >::return_value ( U &&  value)
inlinenoexcept

Definition at line 88 of file BlockingWait.h.

89  {
90  result_->emplace(static_cast<U&&>(value));
91  }
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
template<typename T >
void folly::coro::detail::BlockingWaitPromise< T >::unhandled_exception ( )
inlinenoexcept

Definition at line 80 of file BlockingWait.h.

References folly::exception_wrapper::from_exception_ptr(), and value.

80  {
81  result_->emplaceException(
82  folly::exception_wrapper::from_exception_ptr(std::current_exception()));
83  }
static exception_wrapper from_exception_ptr(std::exception_ptr const &eptr) noexcept

Member Data Documentation

template<typename T >
folly::Try<T>* folly::coro::detail::BlockingWaitPromise< T >::result_
private

Definition at line 108 of file BlockingWait.h.


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