23 #ifndef _IGNITE_FUTURE
24 #define _IGNITE_FUTURE
26 #include <ignite/common/shared_state.h>
52 friend class common::Promise<T>;
88 const common::SharedState<ValueType>* state0 = state.Get();
104 const common::SharedState<ValueType>* state0 = state.Get();
108 return state0->WaitFor(msTimeout);
120 const common::SharedState<ValueType>* state0 = state.Get();
124 return state0->GetValue();
132 common::SharedState<ValueType>* state0 = state.Get();
144 common::SharedState<ValueType>* state0 = state.Get();
148 return state0->IsSet();
157 Future(common::concurrent::SharedPointer< common::SharedState<ValueType> > state0) :
164 common::concurrent::SharedPointer< common::SharedState<ValueType> > state;
173 friend class common::Promise<void>;
209 const common::SharedState<ValueType>* state0 = state.Get();
225 const common::SharedState<ValueType>* state0 = state.Get();
229 return state0->WaitFor(msTimeout);
240 const common::SharedState<ValueType>* state0 = state.Get();
252 common::SharedState<ValueType>* state0 = state.Get();
264 common::SharedState<ValueType>* state0 = state.Get();
268 return state0->IsSet();
277 Future(common::concurrent::SharedPointer< common::SharedState<ValueType> > state0) :
284 common::concurrent::SharedPointer< common::SharedState<ValueType> > state;
291 class Future< common::concurrent::SharedPointer<T> >
293 friend class common::Promise< common::concurrent::SharedPointer<T> >;
307 Future(const Future<SP_ValueType>& src) :
333 const common::SharedState<SP_ValueType>* state0 = state.Get();
349 const common::SharedState<SP_ValueType>* state0 = state.Get();
353 return state0->WaitFor(msTimeout);
365 const common::SharedState<SP_ValueType>* state0 = state.Get();
369 return state0->GetValue();
377 common::SharedState<SP_ValueType>* state0 = state.Get();
389 common::SharedState<SP_ValueType>* state0 = state.Get();
393 return state0->IsSet();
402 Future(common::concurrent::SharedPointer< common::SharedState<SP_ValueType> > state0) :
409 common::concurrent::SharedPointer< common::SharedState<SP_ValueType> > state;
413 #endif //_IGNITE_FUTURE