#include <future.h>
Public Member Functions | |
AbstractFuture () | |
virtual | ~AbstractFuture () |
virtual void * | get () |
This method will block current thread until the result is available. | |
virtual bool | get (int milli, void **result=NULL) |
this method will block current thread until result becomes available or timeout is reached. | |
Protected Member Functions | |
virtual void | fireEvent () |
subclass must call this function to notify that computation is finished. | |
virtual void | setAvailable (bool flag) |
Set the available flag. | |
virtual bool | getAvailable () |
return the Available flag | |
Protected Attributes | |
volatile void * | f_result |
result from task running |
This class provides basic wait/notify mechanism for handling notification. It can be used as parent classes is the wait/notify mechanism is required.
amino::AbstractFuture::AbstractFuture | ( | ) | [inline] |
virtual amino::AbstractFuture::~AbstractFuture | ( | ) | [inline, virtual] |
virtual void amino::AbstractFuture::fireEvent | ( | ) | [inline, protected, virtual] |
subclass must call this function to notify that computation is finished.
Note: get() method might wait infinitely if this method is not called
virtual void amino::AbstractFuture::setAvailable | ( | bool | flag | ) | [inline, protected, virtual] |
virtual bool amino::AbstractFuture::getAvailable | ( | ) | [inline, protected, virtual] |
return the Available flag
virtual void* amino::AbstractFuture::get | ( | ) | [inline, virtual] |
This method will block current thread until the result is available.
Implements amino::Future.
virtual bool amino::AbstractFuture::get | ( | int | milli, | |
void ** | result = NULL | |||
) | [inline, virtual] |
this method will block current thread until result becomes available or timeout is reached.
milli | timout value in milli-second | |
result | this pointer is used to return result of Runnable.run() method |
Implements amino::Future.
volatile void* amino::AbstractFuture::f_result [protected] |
result from task running