Overload of dash::Future for operations returning void
.
More...
#include <Future.h>
|
typedef Future< void > | self_t |
|
typedef std::function< void(void)> | get_func_t |
| Callback function to wait for completion. More...
|
|
typedef std::function< bool(void)> | test_func_t |
| Callback function to test for completion. More...
|
|
typedef std::function< void(void)> | destroy_func_t |
| Callback function called upon destruction. More...
|
|
|
template<typename ResultT_ > |
std::ostream & | operator<< (std::ostream &os, const Future< ResultT_ > &future) |
|
template<>
class dash::Future< void >
Overload of dash::Future for operations returning void
.
Definition at line 235 of file Future.h.
◆ destroy_func_t
Callback function called upon destruction.
Definition at line 253 of file Future.h.
◆ get_func_t
Callback function to wait for completion.
Definition at line 243 of file Future.h.
◆ test_func_t
Callback function to test for completion.
Definition at line 248 of file Future.h.
◆ Future() [1/6]
◆ Future() [2/6]
Create a future using a function that returns the value.
- Parameters
-
get_func | Function blocking until the operation is complete. |
Definition at line 292 of file Future.h.
293 : _get_func(std::move(get_func))
◆ Future() [3/6]
Create a future using a function that returns the value and a function to test whether the result value is available.
- Parameters
-
get_func | Function blocking until the operation is complete. |
test_func | Function returning true if the value is available. |
Definition at line 304 of file Future.h.
305 : _get_func(std::move(get_func))
306 , _test_func(std::move(test_func))
◆ Future() [4/6]
Create a future using a function to wait for completion and a function to test for completion, plus a function to be called upon destruction of the future.
- Parameters
-
get_func | Function to wait for completion. |
test_func | Function returning true if the operation is complete. |
destroy_func | Function called upon destruction of the future. |
Definition at line 319 of file Future.h.
References dash::Future< ResultT >::Future().
323 : _get_func(std::move(get_func)),
324 _test_func(std::move(test_func)),
325 _destroy_func(std::move(destroy_func))
◆ Future() [5/6]
Copy construction is not permited.
◆ Future() [6/6]
Move constructor.
Definition at line 336 of file Future.h.
338 *
this = std::move(other);
◆ ~Future()
◆ get()
Return after making sure that the operation is completed.
Definition at line 416 of file Future.h.
References dash::Future< ResultT >::wait().
418 DASH_LOG_TRACE_VAR(
"Future.get()", _ready);
420 DASH_LOG_TRACE(
"Future.get >");
void wait()
Wait for the value to become available.
◆ operator=() [1/2]
Copy assignment is not permited.
◆ operator=() [2/2]
Move assignment.
Definition at line 359 of file Future.h.
361 _get_func = std::move(other._get_func);
362 _test_func = std::move(other._test_func);
363 _destroy_func = std::move(other._destroy_func);
364 _ready = other._ready;
◆ test()
Test whether the operation has completed.
Blocks if no test-function has been provided.
- Returns
true
if the value is available, false
otherwise.
Definition at line 396 of file Future.h.
400 _ready = _test_func();
401 }
else if (_get_func) {
407 "Future not initialized with function");
◆ valid()
Check whether the future is valid, i.e., a function to wait for completion has been provided.
Definition at line 427 of file Future.h.
429 return (_get_func !=
nullptr);
◆ wait()
Wait for the value to become available.
It is safe to call get after this call returned.
Definition at line 372 of file Future.h.
374 DASH_LOG_TRACE_VAR(
"Future.wait()", _ready);
379 DASH_LOG_ERROR(
"Future.wait()",
"No function");
382 "Future not initialized with function");
386 DASH_LOG_TRACE_VAR(
"Future.wait >", _ready);
The documentation for this class was generated from the following file:
- /tmp/tmporruphar/dash/include/dash/Future.h