SW Task Event Loop Framework v1.0.0
High-performance C++ asynchronous event loop framework with timer management and promise-based programming
Loading...
Searching...
No Matches
Promise.cpp
Go to the documentation of this file.
1#include "Promise.h"
2#include "State.h"
3
4namespace swt {
5
6// void specialization
7Promise<void>::Promise() : m_state(std::make_shared<State<std::monostate>>()) {}
8
10 m_state->setValue(std::monostate{});
11}
12
13void Promise<void>::set_exception(std::exception_ptr exception) {
14 m_state->setException(exception);
15}
16
17} // namespace swt
Promise class for asynchronous result handling with continuation chaining and type safety.
Promise/Future state management with template specialization for void types.
void set_exception(std::exception_ptr exception)
Reject promise with an exception.
Promise()
Default constructor - creates promise with shared state.
void set_value(tValue value)
Resolve promise with a value.
Thread-safe promise state management with continuation support.
Definition State.h:70
Software Timer namespace containing all timer-related classes.
Definition Awaitable.h:21