Lunchbox  1.14.0
Multi-threaded C++ toolbox library for all application developers creating high-performance multi-threaded programs.
lunchbox::FutureImpl< T > Class Template Referenceabstract

Base class to implement the wait method fulfilling the future. More...

#include <future.h>

+ Inheritance diagram for lunchbox::FutureImpl< T >:
+ Collaboration diagram for lunchbox::FutureImpl< T >:

Public Member Functions

virtual ~FutureImpl ()
 Destruct the future. More...
 
virtual T wait (const uint32_t timeout=LB_TIMEOUT_INDEFINITE)=0
 Wait for the promise to be fullfilled. More...
 
virtual bool isReady () const =0
 
- Public Member Functions inherited from lunchbox::Referenced
void ref (const void *holder=0) const
 Increase the reference count. More...
 
bool unref (const void *holder=0) const
 Decrease the reference count. More...
 
int32_t getRefCount () const
 
void printHolders (std::ostream &) const
 

Additional Inherited Members

- Protected Member Functions inherited from lunchbox::Referenced
 Referenced ()
 Construct a new reference-counted object. More...
 
 Referenced (const Referenced &)
 Construct a new copy of a reference-counted object. More...
 
virtual ~Referenced ()
 Destruct a reference-counted object. More...
 
Referencedoperator= (const Referenced &)
 Assign another object to this object. More...
 
virtual void notifyFree ()
 

Detailed Description

template<class T>
class lunchbox::FutureImpl< T >

Base class to implement the wait method fulfilling the future.

Definition at line 37 of file future.h.

Constructor & Destructor Documentation

template<class T>
virtual lunchbox::FutureImpl< T >::~FutureImpl ( )
inlinevirtual

Destruct the future.

Definition at line 41 of file future.h.

Member Function Documentation

template<class T>
virtual bool lunchbox::FutureImpl< T >::isReady ( ) const
pure virtual
Returns
true if the future has been fulfilled, false if it is pending.

Implemented in lunchbox::Request< T >::Impl, lunchbox::FutureFunction< T >, and lunchbox::FutureBool< value >.

template<class T>
virtual T lunchbox::FutureImpl< T >::wait ( const uint32_t  timeout = LB_TIMEOUT_INDEFINITE)
pure virtual

Wait for the promise to be fullfilled.

May be called multiple times.

Parameters
timeoutoptional timeout in milliseconds. If the future is not ready when the timer goes off a timeout exception is thrown.

Implemented in lunchbox::Request< T >::Impl, lunchbox::Request< T >::Impl, lunchbox::FutureFunction< T >, and lunchbox::FutureBool< value >.


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