21 template <
typename Promise>
22 YACLIB_INLINE
auto await_suspend(yaclib_std::coroutine_handle<Promise> handle)
noexcept {
23 _caller.StoreCallback(handle.promise());
25#if YACLIB_SYMMETRIC_TRANSFER != 0
26 return next->Next(handle.promise());
28 return Loop(&handle.promise(), next);
39template <
typename V,
typename E>
50 template <
typename Promise>
51 YACLIB_INLINE
auto await_suspend(yaclib_std::coroutine_handle<Promise> handle)
noexcept {
52 _result->StoreCallback(handle.promise());
54#if YACLIB_SYMMETRIC_TRANSFER != 0
55 return next->Next(handle.promise());
57 return Loop(&handle.promise(), next);
62 return std::move(_result->Get()).Ok();
69template <
typename Handle>
75 return !_caller.core.Empty();
78 template <
typename Promise>
79 YACLIB_INLINE
bool await_suspend(yaclib_std::coroutine_handle<Promise> handle)
noexcept {
80 return _caller.SetCallback(handle.promise());
101 template <
bool SymmetricTransfer>
120#if YACLIB_SYMMETRIC_TRANSFER != 0
127template <
typename Event>
130 static constexpr auto kShared = Event::kShared;
137 template <
typename It>
143 return this->Get(std::memory_order_acquire) == 1;
146 template <
typename Promise>
148 this->next = &
handle.promise();
149 return !this->SubEqual(1);
156template <
bool Shared,
typename V,
typename E>
159template <
typename V,
typename E>
167 return !_result->Empty();
170 template <
typename Promise>
171 YACLIB_INLINE
bool await_suspend(yaclib_std::coroutine_handle<Promise> handle)
noexcept {
172 return _result->SetCallback(handle.promise());
176 return std::move(_result->Get()).Ok();
184template <
typename V,
typename E>
192 return !_result->Empty();
195 template <
typename Promise>
196 YACLIB_INLINE
bool await_suspend(yaclib_std::coroutine_handle<Promise> handle)
const noexcept {
197 return _result->SetCallback(handle.promise());
201 return std::as_const(_result->Get()).Ok();
A intrusive pointer to objects with an embedded reference count.
InlineCore * Here(InlineCore &caller) noexcept final
static constexpr auto kShared
AwaitEvent & GetCall() noexcept
AwaitSingleAwaiter(UniqueCorePtr< V, E > &&result) noexcept
YACLIB_INLINE bool await_suspend(yaclib_std::coroutine_handle< Promise > handle) noexcept
YACLIB_INLINE bool await_ready() const noexcept
YACLIB_INLINE bool await_suspend(yaclib_std::coroutine_handle< Promise > handle) const noexcept
auto await_resume() const
YACLIB_INLINE bool await_ready() const noexcept
AwaitSingleAwaiter(SharedCorePtr< V, E > result) noexcept
YACLIB_INLINE bool await_suspend(yaclib_std::coroutine_handle< Promise > handle) noexcept
static constexpr auto kShared
MultiAwaitAwaiter(Handles... handles) noexcept
MultiAwaitAwaiter(It it, std::size_t count) noexcept
constexpr void await_resume() const noexcept
YACLIB_INLINE bool await_ready() const noexcept
#define YACLIB_ASSERT(cond)
YACLIB_INLINE BaseCore * MoveToCaller(BaseCore *head) noexcept
void SetCallbacksStatic(Event &event, Handles... handles)
YACLIB_INLINE void Loop(InlineCore *prev, InlineCore *curr) noexcept
void SetCallbacksDynamic(Event &event, It it, std::size_t count)
Contract< V, E > MakeContract()
Creates related future and promise.
YACLIB_INLINE bool SubEqual(std::size_t n) noexcept
constexpr void await_resume() const noexcept
AwaitAwaiter(Handle caller) noexcept
YACLIB_INLINE bool await_suspend(yaclib_std::coroutine_handle< Promise > handle) noexcept
YACLIB_INLINE bool await_ready() const noexcept
constexpr bool await_ready() const noexcept
constexpr void await_resume() const noexcept
TransferAwaiter(BaseCore &caller) noexcept
YACLIB_INLINE auto await_suspend(yaclib_std::coroutine_handle< Promise > handle) noexcept
YACLIB_INLINE auto await_suspend(yaclib_std::coroutine_handle< Promise > handle) noexcept
TransferSingleAwaiter(UniqueCorePtr< V, E > &&result) noexcept
constexpr bool await_ready() const noexcept