A promise that can be resolved or rejected by an asynchronous task.
More...
#include <CesiumAsync/Promise.h>
|
void | resolve (T &&value) const |
| Will be called when the task completed successfully. More...
|
|
void | resolve (const T &value) const |
| Will be called when the task completed successfully. More...
|
|
template<typename TException > |
void | reject (TException error) const |
| Will be called when the task failed. More...
|
|
void | reject (const std::exception_ptr &error) const |
| Will be called when the task failed. More...
|
|
Future< T > | getFuture () const |
| Gets the Future that resolves or rejects when this Promise is resolved or rejected. More...
|
|
template<typename T>
class CesiumAsync::Promise< T >
A promise that can be resolved or rejected by an asynchronous task.
- Template Parameters
-
T | The type of the object that the promise will be resolved with. |
Definition at line 18 of file Promise.h.
◆ getFuture()
Gets the Future that resolves or rejects when this Promise is resolved or rejected.
This method may only be called once.
- Returns
- The future.
Definition at line 61 of file Promise.h.
◆ reject() [1/2]
Will be called when the task failed.
- Parameters
-
error | The error, captured with std::current_exception , that caused the task to fail. |
Definition at line 49 of file Promise.h.
◆ reject() [2/2]
template<typename T >
template<typename TException >
Will be called when the task failed.
- Parameters
-
error | The error that caused the task to fail. |
Definition at line 39 of file Promise.h.
◆ resolve() [1/2]
Will be called when the task completed successfully.
- Parameters
-
value | The value that was computed by the asynchronous task. |
Definition at line 32 of file Promise.h.
◆ resolve() [2/2]
Will be called when the task completed successfully.
- Parameters
-
value | The value that was computed by the asynchronous task. |
Definition at line 25 of file Promise.h.
The documentation for this class was generated from the following file:
- /home/runner/work/cesium-native/cesium-native/CesiumAsync/include/CesiumAsync/Promise.h