amino::Future Class Reference

This class reprensents a return value from Runnable object. More...

#include <future.h>

Inheritance diagram for amino::Future:

amino::AbstractFuture amino::FutureTask

List of all members.

Public Member Functions

virtual void * get ()=0
 This method will block current thread until the result is available.
virtual bool get (int milli, void **result=NULL)=0
 this method will block current thread until result becomes available or timeout is reached.
virtual ~Future ()


Detailed Description

This class reprensents a return value from Runnable object.

Since the Runnable object can run in other threads, it's very possible that its return value is not availabe to its caller. It's convenient to have a class to represent the future result of Runnable objects.


Constructor & Destructor Documentation

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


Member Function Documentation

virtual void* amino::Future::get (  )  [pure virtual]

This method will block current thread until the result is available.

TODO: Make this a template member function so that it can return any type?

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

Implemented in amino::AbstractFuture.

virtual bool amino::Future::get ( int  milli,
void **  result = NULL 
) [pure 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.

Implemented in amino::AbstractFuture.


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