SW Task Event Loop Framework v1.0.0
High-performance C++ asynchronous event loop framework with timer management and promise-based programming
|
Specialization for void return type. More...
#include <Awaitable.h>
Public Member Functions | |
template<typename Func > | |
PostAwaitable (std::shared_ptr< SLLooper > looper, Func &&func) | |
Construct PostAwaitable with void function. | |
bool | await_ready () const noexcept |
Check if operation is ready (coroutine interface) | |
void | await_suspend (std::coroutine_handle<> handle) const noexcept |
Suspend coroutine and post to main thread. | |
void | await_resume () const |
Resume coroutine after void operation completion. | |
std::function< void()> | getFunc () const |
Get the main thread function. | |
std::shared_ptr< SLLooper > | getLooper () const |
Get the SLLooper instance. | |
void | setResult () const |
Mark operation as completed (internal use) | |
void | setException (std::exception_ptr ex) const |
Set exception result (internal use) | |
Specialization for void return type.
Specialized version of PostAwaitable for functions that return void. Executes side-effect operations on the main thread.
Definition at line 363 of file Awaitable.h.
|
inline |
Construct PostAwaitable with void function.
Func | Function type (auto-deduced) |
looper | Shared pointer to SLLooper |
func | Void function to execute on main thread |
Definition at line 378 of file Awaitable.h.
|
inlinenoexcept |
Check if operation is ready (coroutine interface)
Definition at line 385 of file Awaitable.h.
|
inline |
Resume coroutine after void operation completion.
std::exception | if operation failed |
Definition at line 397 of file Awaitable.h.
|
noexcept |
Suspend coroutine and post to main thread.
handle | Coroutine handle for resumption |
Definition at line 326 of file SLLooper.cpp.
References SLLOOPER_DEBUG, SLLOOPER_ERROR, and SLLOOPER_ERROR_STREAM.
|
inline |
Get the main thread function.
Definition at line 405 of file Awaitable.h.
|
inline |
Get the SLLooper instance.
Definition at line 411 of file Awaitable.h.
|
inline |
Set exception result (internal use)
ex | Exception pointer from main thread function |
Definition at line 422 of file Awaitable.h.
|
inline |
Mark operation as completed (internal use)
Definition at line 416 of file Awaitable.h.