amino::AbstractFuture Class Reference

This is a base class for other Future implementations. More...

#include <future.h>

Inheritance diagram for amino::AbstractFuture:

amino::Future amino::FutureTask

List of all members.

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


Detailed Description

This is a base class for other Future implementations.

This class provides basic wait/notify mechanism for handling notification. It can be used as parent classes is the wait/notify mechanism is required.


Constructor & Destructor Documentation

amino::AbstractFuture::AbstractFuture (  )  [inline]

virtual amino::AbstractFuture::~AbstractFuture (  )  [inline, virtual]


Member Function Documentation

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]

Set the available flag.

Parameters:
True if the result is ready

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.

Returns:
Return value from Runnable.run() method.

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.

Parameters:
milli timout value in milli-second
result this pointer is used to return result of Runnable.run() method
Returns:
true if succed, false if timeout is reached.

Implements amino::Future.


Member Data Documentation

volatile void* amino::AbstractFuture::f_result [protected]

result from task running


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

Generated on Tue Dec 9 13:39:39 2008 for Amino by  doxygen 1.5.6