|
olp-cpp-sdk
1.23.1
|
A wrapper template that you can use to cancel a request or wait for it to finalize. More...
#include <ApiResponse.h>
Public Types | |
| using | PromisePtr = std::shared_ptr< std::promise< T > > |
| The sharable promise type. | |
Public Member Functions | |
| CancellableFuture (const CancellationToken &cancel_token, PromisePtr promise) | |
Creates the CancellableFuture instance with CancellationToken and std::promise. More... | |
| const CancellationToken & | GetCancellationToken () const |
Gets the CancellationToken reference used to cancel the ongoing operation. More... | |
| std::future< T > | GetFuture () const |
Gets the future associated with the std::promise that you specified during initialization. More... | |
A wrapper template that you can use to cancel a request or wait for it to finalize.
| T | The result type. |
|
inline |
Creates the CancellableFuture instance with CancellationToken and std::promise.
| cancel_token | The CancellationToken instance. |
| promise | The PromisePtr instance. |
|
inline |
Gets the CancellationToken reference used to cancel the ongoing operation.
CancellationToken instance.
|
inline |
Gets the future associated with the std::promise that you specified during initialization.