#include <Future.h>
Inheritance diagram for Future:
Public Types | |
typedef CountedPtr< Result > | ResultRef |
Reference counting holder for results. | |
typedef CountedPtr< Callable > | CallableRef |
Reference counting holder for results. | |
Public Methods | |
Future (const CallableRef &c, Executor &executor) | |
virtual | ~Future () throw () |
Destroy the Future. | |
virtual void | wait () |
virtual bool | wait (unsigned long timeout) |
ResultType | getResult () |
Waiting
Waiting for a Future means to wait for the completion of a Callable task. When the Callable tasks reports a result or an exception, wait() will no longer block. If an exception was set, it will be thrown. If a result was set, it will be obtainable.
|
Create a Future that will Execute the given Callable object by wrapping it with a Runnable and submitting it to an Executor.
|
|
Get the result from the future, this will block the caller until a result is ready. If the Callable has set an exception, that exception with be propogated to all waiters.
|
|
Wait for the Future's Callable to finish producing a result or an excetion. If the timeout expires before the result is ready, return false.
Reimplemented from Waitable. |
|
Wait for the Future's Callable to finish producing a result or an excetion.
Reimplemented from Waitable. |