dune-common 2.10
Loading...
Searching...
No Matches
Dune::Future< T > Class Template Reference

Type-erasure for future-like objects. A future-like object is a object satisfying the interface of FutureBase. More...

#include <dune/common/parallel/future.hh>

Public Member Functions

template<class F>
 Future (F &&f)
template<class U, std::enable_if_t< std::is_same< U, T >::value &&!std::is_same< T, void >::value >>
 Future (U &&data)
 Future ()=default
void wait ()
 wait until the future is ready
get ()
 Waits until the future is ready and returns the resulting value.
bool ready () const

Detailed Description

template<class T>
class Dune::Future< T >

Type-erasure for future-like objects. A future-like object is a object satisfying the interface of FutureBase.

Constructor & Destructor Documentation

◆ Future() [1/3]

template<class T>
template<class F>
Dune::Future< T >::Future ( F && f)
inline

◆ Future() [2/3]

template<class T>
template<class U, std::enable_if_t< std::is_same< U, T >::value &&!std::is_same< T, void >::value >>
Dune::Future< T >::Future ( U && data)
inline

◆ Future() [3/3]

template<class T>
Dune::Future< T >::Future ( )
default

Member Function Documentation

◆ get()

template<class T>
T Dune::Future< T >::get ( )
inline

Waits until the future is ready and returns the resulting value.

Returns
The contained value
Exceptions
InvalidFutureException

◆ ready()

template<class T>
bool Dune::Future< T >::ready ( ) const
inline
Returns
true is the future is ready, otherwise false
Exceptions
InvalidFutureException

◆ wait()

template<class T>
void Dune::Future< T >::wait ( )
inline

wait until the future is ready

Exceptions
InvalidFutureException

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