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< T & > get_return_object () noexcept
 
void unhandled_exception () noexcept
 
auto yield_value (T &&value) noexcept
 
auto yield_value (T &value) noexcept
 
void return_void ()
 
folly::Try< std::reference_wrapper< T > > getAsTry ()
 
Tget ()
 
- 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< std::reference_wrapper< 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 112 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 159 of file BlockingWait.h.

159  {
160  return getAsTry().value();
161  }
T & value()&
Definition: Try-inl.h:140
folly::Try< std::reference_wrapper< T > > getAsTry()
Definition: BlockingWait.h:149
template<typename T >
BlockingWaitTask< T & > folly::coro::detail::BlockingWaitPromise< T & >::get_return_object ( )
inlinenoexcept

Definition at line 240 of file BlockingWait.h.

240  {
241  return BlockingWaitTask<T&>{std::experimental::coroutine_handle<
242  BlockingWaitPromise<T&>>::from_promise(*this)};
243 }
template<typename T >
folly::Try<std::reference_wrapper<T> > folly::coro::detail::BlockingWaitPromise< T & >::getAsTry ( )
inline

Definition at line 149 of file BlockingWait.h.

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

149  {
151  result_ = &result;
152  std::experimental::coroutine_handle<BlockingWaitPromise<T&>>::from_promise(
153  *this)
154  .resume();
155  this->wait();
156  return result;
157  }
folly::Try< std::reference_wrapper< T > > * result_
Definition: BlockingWait.h:164
Definition: Try.h:51
template<typename T >
void folly::coro::detail::BlockingWaitPromise< T & >::return_void ( )
inline

Definition at line 141 of file BlockingWait.h.

141  {
142  // This should never be reachable.
143  // The coroutine should either have suspended at co_yield or should have
144  // thrown an exception and skipped over the implicit co_return and
145  // gone straight to unhandled_exception().
146  std::abort();
147  }
template<typename T >
void folly::coro::detail::BlockingWaitPromise< T & >::unhandled_exception ( )
inlinenoexcept

Definition at line 120 of file BlockingWait.h.

References folly::exception_wrapper::from_exception_ptr().

120  {
122  folly::exception_wrapper::from_exception_ptr(std::current_exception()));
123  }
folly::Try< std::reference_wrapper< T > > * result_
Definition: BlockingWait.h:164
static exception_wrapper from_exception_ptr(std::exception_ptr const &eptr) noexcept
exception_wrapper & emplaceException(Args &&...args) noexcept(std::is_nothrow_constructible< exception_wrapper, Args &&... >::value)
Definition: Try-inl.h:131
template<typename T >
auto folly::coro::detail::BlockingWaitPromise< T & >::yield_value ( T &&  value)
inlinenoexcept

Definition at line 125 of file BlockingWait.h.

References folly::coro::detail::BlockingWaitPromiseBase::final_suspend(), and folly::value().

125  {
126  result_->emplace(std::ref(value));
127  return final_suspend();
128  }
folly::Try< std::reference_wrapper< T > > * result_
Definition: BlockingWait.h:164
T & emplace(Args &&...args) noexcept(std::is_nothrow_constructible< T, Args &&... >::value)
Definition: Try-inl.h:121
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
template<typename T >
auto folly::coro::detail::BlockingWaitPromise< T & >::yield_value ( T value)
inlinenoexcept

Definition at line 130 of file BlockingWait.h.

References folly::coro::detail::BlockingWaitPromiseBase::final_suspend(), folly::T, and folly::value().

130  {
131  result_->emplace(std::ref(value));
132  return final_suspend();
133  }
folly::Try< std::reference_wrapper< T > > * result_
Definition: BlockingWait.h:164
T & emplace(Args &&...args) noexcept(std::is_nothrow_constructible< T, Args &&... >::value)
Definition: Try-inl.h:121
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)

Member Data Documentation

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

Definition at line 164 of file BlockingWait.h.


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