AUI Framework  master
Cross-platform module-based framework for developing C++20 desktop applications
AComplexFutureOperation< T > Class Template Reference

Helper class to construct AFuture values. More...

Detailed Description

template<typename T>
class AComplexFutureOperation< T >

Helper class to construct AFuture values.

Template Parameters
Tfuture type AFuture<T> (void is default)

AComplexFutureOperation is used to handle results and errors of multiple sequential futures.

AComplexFutureOperation is intended to construct a future with makeFuture(). makeFuture() must be called.

If AComplexFutureOperation get destroyed, it reports error to it's future if it does not have a result. AComplexFutureOperation should be carried with AFuture::onSuccess callbacks of other futures or any other callback-based structure, hence the destruction without result is treated as an error.

Classes

class  NoValueException
 

Public Member Functions

AFuture< T > makeFuture () noexcept
 Creates AFuture<T> object for this operation. More...
 
template<typename OtherT >
AComplexFutureOperationoperator<< (AFuture< OtherT > rhs)
 Adds a direct dependency on other AFuture<T>. More...
 
void supplyValue (T value)
 Pushes the result of operation to it's AFuture<T>. More...
 
void supplyException ()
 Pushes the result of operation to it's AFuture<T>.
 

Member Function Documentation

◆ makeFuture()

template<typename T >
AFuture< T > AComplexFutureOperation< T >::makeFuture ( )
inlinenoexcept

Creates AFuture<T> object for this operation.

AFuture<T> can be created only once.

◆ operator<<()

template<typename T >
template<typename OtherT >
AComplexFutureOperation & AComplexFutureOperation< T >::operator<< ( AFuture< OtherT >  rhs)
inline

Adds a direct dependency on other AFuture<T>.

Parameters
rhsother future

Stores other AFuture to internal AAsyncHolder storage. Passes rhs's onError calls to AComplexFutureOperation's future, if it does not have result (!AFuture::hasResult()).

◆ supplyValue()

template<typename T >
void AComplexFutureOperation< T >::supplyValue ( value)
inline

Pushes the result of operation to it's AFuture<T>.

Parameters
valueoperation

#include <AUI/Thread/AComplexFutureOperation.h>


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