18 #ifndef LUNCHBOX_FUTURE_H
19 #define LUNCHBOX_FUTURE_H
21 #include <lunchbox/refPtr.h>
22 #include <lunchbox/referenced.h>
56 virtual bool isReady()
const = 0;
64 void bool_true()
const {}
84 return impl_->wait( timeout_ );
90 bool isReady()
const {
return impl_->isReady(); }
128 void bool_true()
const {}
148 impl_->wait( timeout_ );
154 bool isReady()
const {
return impl_->isReady(); }
161 #endif //LUNCHBOX_FUTURE_H
RefPtr< FutureImpl< void > > Impl
The wait implementation.
virtual bool isReady() const =0
~Future()
Destruct the future.
~Future()
Destruct the future.
void wait(const uint32_t timeout_=LB_TIMEOUT_INDEFINITE)
Wait for the promise to be fullfilled.
bool operator!=(const T &rhs)
#define LB_TIMEOUT_INDEFINITE
Constant defining 'wait forever' in methods with wait parameters.
Future template specialization for void.
Future(Impl impl)
Construct a new future.
virtual ~FutureImpl()
Destruct the future.
T wait(const uint32_t timeout_=LB_TIMEOUT_INDEFINITE)
Wait for the promise to be fullfilled.
bool operator>(const T &rhs)
RefPtr< FutureImpl< T > > Impl
The wait implementation.
virtual T wait(const uint32_t timeout=LB_TIMEOUT_INDEFINITE)=0
Wait for the promise to be fullfilled.
bool operator==(const T &rhs)
bool operator<=(const T &rhs)
Base class to implement the wait method fulfilling the future.
A future represents a asynchronous operation.
Base class for referenced objects.
Future(Impl impl)
Construct a new future.
A smart reference pointer, aka boost::intrusive_ptr.
bool operator<(const T &rhs)
bool operator>=(const T &rhs)