18 #ifndef LUNCHBOX_FUTURE_H 19 #define LUNCHBOX_FUTURE_H 21 #include <boost/noncopyable.hpp> 22 #include <lunchbox/refPtr.h> 23 #include <lunchbox/referenced.h> 32 : std::runtime_error(
"")
57 virtual bool isReady()
const = 0;
65 typedef void (
Future<T>::*bool_t)()
const;
66 void bool_true()
const {}
87 return impl_->wait(timeout_);
93 bool isReady()
const {
return impl_->isReady(); }
126 void bool_true()
const {}
147 impl_->wait(timeout_);
153 bool isReady()
const {
return impl_->isReady(); }
158 #endif // LUNCHBOX_FUTURE_H ~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.
RefPtr< FutureImpl< T > > Impl
The wait implementation.
Future template specialization for void.
Future(Impl impl)
Construct a new future.
RefPtr< FutureImpl< void > > Impl
The wait implementation.
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)
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.
Abstraction layer and common utilities for multi-threaded programming.
A smart reference pointer, aka boost::intrusive_ptr.
bool operator<(const T &rhs)
Future< bool > f_bool_t
A boolean future.
bool operator>=(const T &rhs)