swift
Loading...
Searching...
No Matches
swift::misc::CPromise< void > Class Reference

Specialization of CPromise for void futures. More...

#include <promise.h>

Public Member Functions

QFuture< void > future ()
 Return a future that can be used to detect when the task is complete.
void abandon ()
 Mark the task as cancelled.
void setResult ()
 Mark the task as complete.
template<typename U>
void setResult (QFuture< U > future)
 Wait for the given future, then mark the task as complete.
template<typename U>
void chainResult (QFuture< U > future)
 When the given future is ready, mark this promise as complete.
template<typename F>
void setResultFrom (F &&func)
 Invoke a functor and mark the task as complete.

Detailed Description

Specialization of CPromise for void futures.

Definition at line 133 of file promise.h.

Member Function Documentation

◆ abandon()

void swift::misc::CPromise< void >::abandon ( )
inline

Mark the task as cancelled.

Definition at line 140 of file promise.h.

◆ chainResult()

template<typename U>
void swift::misc::CPromise< void >::chainResult ( QFuture< U > future)
inline

When the given future is ready, mark this promise as complete.

Definition at line 159 of file promise.h.

◆ future()

QFuture< void > swift::misc::CPromise< void >::future ( )
inline

Return a future that can be used to detect when the task is complete.

Definition at line 137 of file promise.h.

◆ setResult() [1/2]

void swift::misc::CPromise< void >::setResult ( )
inline

Mark the task as complete.

Definition at line 147 of file promise.h.

◆ setResult() [2/2]

template<typename U>
void swift::misc::CPromise< void >::setResult ( QFuture< U > future)
inline

Wait for the given future, then mark the task as complete.

Definition at line 151 of file promise.h.

◆ setResultFrom()

template<typename F>
void swift::misc::CPromise< void >::setResultFrom ( F && func)
inline

Invoke a functor and mark the task as complete.

Useful for uniform syntax in generic code where T could be void.

Definition at line 167 of file promise.h.


The documentation for this class was generated from the following file: