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 (_XSTD exception_ptr _Exc)
 
void set_exception_at_thread_exit (_XSTD 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
1481  { // construct
1482  }
Definition: future:231
_Promise< _Ty > _MyPromise
Definition: future:1553
template<class _Ty>
template<class _Alloc >
promise< _Ty >::promise ( allocator_arg_t  ,
const _Alloc &  _Al 
)
inline
1486  : _MyPromise(_Make_associated_state<_Ty>(_Al))
1487  { // construct with allocator
1488  }
_Promise< _Ty > _MyPromise
Definition: future:1553
template<class _Ty>
promise< _Ty >::promise ( promise< _Ty > &&  _Other)
inline
1491  : _MyPromise(_STD forward<_Promise<_Ty> >(_Other._MyPromise))
1492  { // construct from rvalue promise object
1493  }
Definition: future:1392
_Promise< _Ty > _MyPromise
Definition: future:1553
template<class _Ty>
promise< _Ty >::~promise ( )
inline
1502  { // destroy
1503  if (_MyPromise._Is_valid() && !_MyPromise._Is_ready())
1504  { // exception if destroyed before function object returns
1506  _MyPromise._Get_state()
1507  ._Set_exception(_XSTD make_exception_ptr(_Fut), false);
1508  }
1509  }
error_code make_error_code(_Future_errc _Errno) _NOEXCEPT
Definition: future:120
#define _XSTD
Definition: xstddef:20
_Promise< _Ty > _MyPromise
Definition: future:1553
Definition: future:133
exception_ptr make_exception_ptr(_E _Except)
Definition: exception:539
template<class _Ty>
promise< _Ty >::promise ( const promise< _Ty > &  )
delete

Member Function Documentation

template<class _Ty>
future<_Ty> promise< _Ty >::get_future ( )
inline
1517  { // return a future object that shares the associated
1518  // asynchronous state
1519  return (future<_Ty>(_MyPromise._Get_state_for_future(), _Nil_obj));
1520  }
_Promise< _Ty > _MyPromise
Definition: future:1553
static _Nil _Nil_obj
Definition: xtr1common:29
Definition: future:1099
template<class _Ty>
promise& promise< _Ty >::operator= ( promise< _Ty > &&  _Other)
inline
1496  { // assign from rvalue promise object
1497  _MyPromise = _STD forward<_Promise<_Ty> >(_Other._MyPromise);
1498  return (*this);
1499  }
_Promise< _Ty > _MyPromise
Definition: future:1553
template<class _Ty>
promise& promise< _Ty >::operator= ( const promise< _Ty > &  )
delete
template<class _Ty>
void promise< _Ty >::set_exception ( _XSTD exception_ptr  _Exc)
inline
1543  { // store result
1544  _MyPromise._Get_state_for_set()._Set_exception(_Exc, false);
1545  }
_Promise< _Ty > _MyPromise
Definition: future:1553
template<class _Ty>
void promise< _Ty >::set_exception_at_thread_exit ( _XSTD exception_ptr  _Exc)
inline
1548  { // store result and block until thread exit
1549  _MyPromise._Get_state_for_set()._Set_exception(_Exc, true);
1550  }
_Promise< _Ty > _MyPromise
Definition: future:1553
template<class _Ty>
void promise< _Ty >::set_value ( const _Ty &  _Val)
inline
1523  { // store result
1524  _MyPromise._Get_state_for_set()._Set_value(_Val, false);
1525  }
_Promise< _Ty > _MyPromise
Definition: future:1553
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty>
void promise< _Ty >::set_value ( _Ty &&  _Val)
inline
1533  { // store result
1534  _MyPromise._Get_state_for_set()._Set_value(_STD forward<_Ty>(_Val), false);
1535  }
_Promise< _Ty > _MyPromise
Definition: future:1553
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty>
void promise< _Ty >::set_value_at_thread_exit ( const _Ty &  _Val)
inline
1528  { // store result and block until thread exit
1529  _MyPromise._Get_state_for_set()._Set_value(_Val, true);
1530  }
_Promise< _Ty > _MyPromise
Definition: future:1553
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty>
void promise< _Ty >::set_value_at_thread_exit ( _Ty &&  _Val)
inline
1538  { // store result and block until thread exit
1539  _MyPromise._Get_state_for_set()._Set_value(_STD forward<_Ty>(_Val), true);
1540  }
_Promise< _Ty > _MyPromise
Definition: future:1553
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty>
void promise< _Ty >::swap ( promise< _Ty > &  _Other)
inline
1512  { // exchange with _Other
1513  _MyPromise._Swap(_Other._MyPromise);
1514  }
_Promise< _Ty > _MyPromise
Definition: future:1553

Member Data Documentation

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

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