STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Attributes | List of all members
promise< _Ty > Class Template Reference

Public Member Functions

 promise ()
 
template<class _Alloc >
 promise (allocator_arg_t, const _Alloc &_Al)
 
 promise (promise &&_Other) _NOEXCEPT
 
promiseoperator= (promise &&_Other) _NOEXCEPT
 
 ~promise () _NOEXCEPT
 
void swap (promise &_Other) _NOEXCEPT
 
future< _Ty > get_future ()
 
void set_value (const _Ty &_Val)
 
void set_value_at_thread_exit (const _Ty &_Val)
 
void set_value (_Ty &&_Val)
 
void set_value_at_thread_exit (_Ty &&_Val)
 
void set_exception (exception_ptr _Exc)
 
void set_exception_at_thread_exit (exception_ptr _Exc)
 
 promise (const promise &)=delete
 
promiseoperator= (const promise &)=delete
 

Private Attributes

_Promise< _Ty > _MyPromise
 

Constructor & Destructor Documentation

template<class _Ty>
promise< _Ty >::promise ( )
inline
1488  { // construct
1489  }
Definition: future:216
_Promise< _Ty > _MyPromise
Definition: future:1565
template<class _Ty>
template<class _Alloc >
promise< _Ty >::promise ( allocator_arg_t  ,
const _Alloc &  _Al 
)
inline
1493  : _MyPromise(_Make_associated_state<_Ty>(_Al))
1494  { // construct with allocator
1495  }
_Promise< _Ty > _MyPromise
Definition: future:1565
template<class _Ty>
promise< _Ty >::promise ( promise< _Ty > &&  _Other)
inline
1499  { // construct from rvalue promise object
1500  }
Definition: future:1395
_Promise< _Ty > _MyPromise
Definition: future:1565
constexpr _Ty && forward(typename remove_reference< _Ty >::type &_Arg) _NOEXCEPT
Definition: type_traits:1332
template<class _Ty>
promise< _Ty >::~promise ( )
inline
1509  { // destroy
1510  if (_MyPromise._Is_valid() && !_MyPromise._Is_ready() && !_MyPromise._Is_ready_at_thread_exit())
1511  { // exception if destroyed before function object returns
1513  _MyPromise._Get_state()
1514  ._Set_exception(_STD make_exception_ptr(_Fut), false);
1515  }
1516  }
error_code make_error_code(_Future_errc _Errno) _NOEXCEPT
Definition: future:119
_Promise< _Ty > _MyPromise
Definition: future:1565
Definition: future:151
exception_ptr make_exception_ptr(_Ex _Except) _NOEXCEPT
Definition: exception:378
template<class _Ty>
promise< _Ty >::promise ( const promise< _Ty > &  )
delete

Member Function Documentation

template<class _Ty>
future<_Ty> promise< _Ty >::get_future ( )
inline
1524  { // return a future object that shares the associated
1525  // asynchronous state
1526  return (future<_Ty>(_MyPromise._Get_state_for_future(), _Nil()));
1527  }
_Promise< _Ty > _MyPromise
Definition: future:1565
Definition: future:1102
Definition: xtr1common:16
template<class _Ty>
promise& promise< _Ty >::operator= ( promise< _Ty > &&  _Other)
inline
1503  { // assign from rvalue promise object
1504  promise(_STD move(_Other)).swap(*this);
1505  return (*this);
1506  }
promise()
Definition: future:1486
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
template<class _Ty>
promise& promise< _Ty >::operator= ( const promise< _Ty > &  )
delete
template<class _Ty>
void promise< _Ty >::set_exception ( exception_ptr  _Exc)
inline
1552  { // store result
1553  _MyPromise._Get_state_for_set()._Set_exception(_Exc, false);
1554  }
_Promise< _Ty > _MyPromise
Definition: future:1565
template<class _Ty>
void promise< _Ty >::set_exception_at_thread_exit ( exception_ptr  _Exc)
inline
1557  { // store result and block until thread exit
1558  _MyPromise._Get_state_for_set()._Set_exception(_Exc, true);
1559  }
_Promise< _Ty > _MyPromise
Definition: future:1565
template<class _Ty>
void promise< _Ty >::set_value ( const _Ty &  _Val)
inline
1530  { // store result
1531  _MyPromise._Get_state_for_set()._Set_value(_Val, false);
1532  }
_Promise< _Ty > _MyPromise
Definition: future:1565
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty>
void promise< _Ty >::set_value ( _Ty &&  _Val)
inline
1540  { // store result
1541  _MyPromise._Get_state_for_set()._Set_value(
1542  _STD forward<_Ty>(_Val), false);
1543  }
_Promise< _Ty > _MyPromise
Definition: future:1565
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty>
void promise< _Ty >::set_value_at_thread_exit ( const _Ty &  _Val)
inline
1535  { // store result and block until thread exit
1536  _MyPromise._Get_state_for_set()._Set_value(_Val, true);
1537  }
_Promise< _Ty > _MyPromise
Definition: future:1565
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty>
void promise< _Ty >::set_value_at_thread_exit ( _Ty &&  _Val)
inline
1546  { // store result and block until thread exit
1547  _MyPromise._Get_state_for_set()._Set_value(
1548  _STD forward<_Ty>(_Val), true);
1549  }
_Promise< _Ty > _MyPromise
Definition: future:1565
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty>
void promise< _Ty >::swap ( promise< _Ty > &  _Other)
inline
1519  { // exchange with _Other
1520  _MyPromise._Swap(_Other._MyPromise);
1521  }
_Promise< _Ty > _MyPromise
Definition: future:1565

Member Data Documentation

template<class _Ty>
_Promise<_Ty> promise< _Ty >::_MyPromise
private

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