nlib
nn::nlib::threading::WhenFutureComplete< R1, R2, R3, R4, R5 > Class Template Reference

Defines a Future for which to set the value, under the condition that a value has been set for the Future. More...

#include "nn/nlib/threading/Future.h"

Public Types

typedef UniquePtr< FutureTuple< R1, R2, R3, R4, R5 > > ReturnType
 Type of value to set to the newly created Future.
 
typedef Future< ReturnTypeFutureType
 Type of the newly created Future.
 

Static Public Member Functions

static errno_t All (FutureType *f, Future< R1 > *f1, Future< R2 > *f2, Future< R3 > *f3, Future< R4 > *f4, Future< R5 > *f5)
 When an error has been set to all Future f1, f2, f3, f4, and f5, sets a value to f. More...
 
static errno_t Any (FutureType *f, Future< R1 > *f1, Future< R2 > *f2, Future< R3 > *f3, Future< R4 > *f4, Future< R5 > *f5)
 When an error has been set to any of Future f1, f2, f3, f4, and f5, a value is set in f. More...
 

Detailed Description

template<class R1 = None, class R2 = None, class R3 = None, class R4 = None, class R5 = None>
class nn::nlib::threading::WhenFutureComplete< R1, R2, R3, R4, R5 >

Defines a Future for which to set the value, under the condition that a value has been set for the Future.

Template Parameters
R1Type of value of Future.
R2Type of value of Future.
R3Type of value of Future.
R4Type of value of Future.
R5Type of value of Future.
Description
Use WhenFutureComplete::All when setting Future when a value has been set for all instances of Future. Use WhenFutureComplete::Any when setting Future when a value has been set for any Future.
This class template provides specialized classes enabling the use of WhenFutureComplete<R1,R2>, WhenFutureComplete<R1,R2,R3>, WhenFutureComplete<R1,R2,R3,R4>, and WhenFutureComplete<R1,R2,R3,R4,R5>.

Definition at line 2109 of file Future.h.

Member Function Documentation

◆ All()

template<class R1 = None, class R2 = None, class R3 = None, class R4 = None, class R5 = None>
nn::nlib::threading::WhenFutureComplete< R1, R2, R3, R4, R5 >::All ( FutureType f,
Future< R1 > *  f1,
Future< R2 > *  f2,
Future< R3 > *  f3,
Future< R4 > *  f4,
Future< R5 > *  f5 
)
inlinestatic

When an error has been set to all Future f1, f2, f3, f4, and f5, sets a value to f.

Parameters
[in,out]fPointer to the newly created Future.
[in]f1Pointer to Future<R1>.
[in]f2Pointer to Future<R2>.
[in]f3Pointer to Future<R3>.
[in]f4Pointer to Future<R4>.
[in]f5Pointer to Future<R5>.
Return values
0Success.
EINVALIndicates that one of f1, f2, f3, f4, or f5 is NULL.
ENOMEMFailed to allocate memory.
Anothererror may be returned from a lower layer.

Definition at line 2113 of file Future.h.

◆ Any()

template<class R1 = None, class R2 = None, class R3 = None, class R4 = None, class R5 = None>
nn::nlib::threading::WhenFutureComplete< R1, R2, R3, R4, R5 >::Any ( FutureType f,
Future< R1 > *  f1,
Future< R2 > *  f2,
Future< R3 > *  f3,
Future< R4 > *  f4,
Future< R5 > *  f5 
)
inlinestatic

When an error has been set to any of Future f1, f2, f3, f4, and f5, a value is set in f.

Parameters
[in,out]fPointer to the newly created Future.
[in]f1Pointer to Future<R1>.
[in]f2Pointer to Future<R2>.
[in]f3Pointer to Future<R3>.
[in]f4Pointer to Future<R4>.
[in]f5Pointer to Future<R5>.
Return values
0Success.
EINVALIndicates that one of f1, f2, f3, f4, or f5 is NULL.
ENOMEMFailed to allocate memory.
Anothererror may be returned from a lower layer.

Definition at line 2117 of file Future.h.


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