This class provides implicit conversion to boolean type. More...
#include <Radiant/FutureBool.hpp>
Public Member Functions | |
| FutureBool (bool value) | |
| Constructs a FutureBool object whose value is already known at this point. More... | |
| FutureBool (FutureBoolIPtr future) | |
| Constructs a FutureBool object from FutureBoolIPtr. More... | |
| FutureBool (FutureBool &&f) | |
| Move the given FutureBool object. More... | |
| operator bool () | |
| Implicit conversion to boolean. More... | |
| FutureBool & | operator= (FutureBool &&f) |
| Move the given FutureBool object. More... | |
This class provides implicit conversion to boolean type.
The class is used to provide asynchronous return values from functions. By invoking a function that returns a FutureBool-instance, the invoker can choose if he wants to wait for the return value by evaluating the value of the FutureBool. In case the value is never evaluated the function is run asynchronously.
This behaviour and usage pattern is very similar to std::future. See also MultiWidgets::ImageWidget::load
|
inline |
Constructs a FutureBool object whose value is already known at this point.
| value | Value to return when converting this object to boolean |
|
inline |
Constructs a FutureBool object from FutureBoolIPtr.
| future | Class-specific implementation of FutureBoolI-interface. |
|
inline |
Move the given FutureBool object.
| f | FutureBool to move |
|
inline |
Implicit conversion to boolean.
This function will block until the value of the future has been set.
|
inline |
Move the given FutureBool object.
| f | FutureBool to move |