|
Anklang-0.3.0.dev712+gdc4e642f anklang-0.3.0.dev712+gdc4e642f
ASE — Anklang Sound Engine (C++)
« « « Anklang Documentation |
Classes | |
| struct | PromiseAwaiter |
| Helper to capture shared_ptr<Promise> to allow co_await on temporary Promise instances. More... | |
Public Types | |
| using | StorageType = std::conditional_t< std::is_void_v< Result >, std::monostate, Result > |
| using | StateVariant = std::variant< std::monostate, StorageType, std::exception_ptr > |
Public Member Functions | |
| PromiseAwaiter | operator co_await () noexcept |
| Keeps shared_ptr<Promise> alive during co_await. | |
| template<typename T = Result> requires (!std::is_void_v<T>) | |
| void | resolve (T &&value) |
| Resolve Promise with value. | |
| template<typename T = Result> requires (std::is_void_v<T>) | |
| void | resolve () |
| Resolve Promise<void> | |
| void | reject (std::exception_ptr exc=nullptr) |
| Reject promise with exception. | |
Public Member Functions inherited from std::enable_shared_from_this< Promise< Result > > | |
| T | enable_shared_from_this (T... args) |
| T | operator= (T... args) |
| T | shared_from_this (T... args) |
| T | weak_from_this (T... args) |
| T | ~enable_shared_from_this (T... args) |
Friends | |
| class | Loop |
| using Ase::Loop::Promise< Result >::StateVariant = std::variant<std::monostate, StorageType, std::exception_ptr> |
| using Ase::Loop::Promise< Result >::StorageType = std::conditional_t<std::is_void_v<Result>, std::monostate, Result> |
| Ase::Loop::Promise< Result >::~Promise | ( | ) |
|
noexcept |
Keeps shared_ptr<Promise> alive during co_await.
Definition at line 403 of file loop.hh.
References std::enable_shared_from_this< Promise< Result > >::shared_from_this().
| void Ase::Loop::Promise< Result >::reject | ( | std::exception_ptr | exc = nullptr | ) |
Reject promise with exception.
Definition at line 422 of file loop.hh.
References std::make_exception_ptr().
| void Ase::Loop::Promise< Result >::resolve | ( | ) |
| void Ase::Loop::Promise< Result >::resolve | ( | T && | value | ) |