const std::string &FutureBase::error(int msecs) const { if (wait(msecs) == FutureState_Running) throw FutureException(FutureException::ExceptionState_FutureTimeout); if (_p->_state.load() != FutureState_FinishedWithError) throw FutureException(FutureException::ExceptionState_FutureHasNoError); return _p->_error; }
const std::string &FutureBase::error(int msecs) const { if (wait(msecs) == FutureState_Running) throw FutureException(FutureException::ExceptionState_FutureTimeout); if (_p->_state.load() != FutureState_FinishedWithError) throw FutureException(FutureException::ExceptionState_FutureHasNoError); boost::recursive_mutex::scoped_lock lock(_p->_mutex); return _p->_error; }
bool FutureBase::hasValue(int msecs) const { if (wait(msecs) == FutureState_Running) throw FutureException(FutureException::ExceptionState_FutureTimeout); return _p->_state.load() == FutureState_FinishedWithValue; }
bool FutureBase::hasError(int msecs) const { if (wait(msecs) == FutureState_Running) throw FutureException(FutureException::ExceptionState_FutureTimeout); return *_p->_state == FutureState_FinishedWithError; }