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
1492  { // construct
1493  }
Definition: future:217
_Promise< _Ty > _MyPromise
Definition: future:1569
template<class _Ty>
template<class _Alloc >
promise< _Ty >::promise ( allocator_arg_t  ,
const _Alloc &  _Al 
)
inline
1497  : _MyPromise(_Make_associated_state<_Ty>(_Al))
1498  { // construct with allocator
1499  }
_Promise< _Ty > _MyPromise
Definition: future:1569
template<class _Ty>
promise< _Ty >::promise ( promise< _Ty > &&  _Other)
inline
1503  { // construct from rvalue promise object
1504  }
Definition: future:1404
_Promise< _Ty > _MyPromise
Definition: future:1569
constexpr _Ty && forward(typename remove_reference< _Ty >::type &_Arg) _NOEXCEPT
Definition: type_traits:1273
template<class _Ty>
promise< _Ty >::~promise ( )
inline
1513  { // destroy
1514  if (_MyPromise._Is_valid() && !_MyPromise._Is_ready())
1515  { // exception if destroyed before function object returns
1517  _MyPromise._Get_state()
1518  ._Set_exception(_XSTD make_exception_ptr(_Fut), false);
1519  }
1520  }
error_code make_error_code(_Future_errc _Errno) _NOEXCEPT
Definition: future:120
#define _XSTD
Definition: xstddef:21
_Promise< _Ty > _MyPromise
Definition: future:1569
Definition: future:152
exception_ptr make_exception_ptr(_Ex _Except) _NOEXCEPT
Definition: exception:371
template<class _Ty>
promise< _Ty >::promise ( const promise< _Ty > &  )
delete

Member Function Documentation

template<class _Ty>
future<_Ty> promise< _Ty >::get_future ( )
inline
1528  { // return a future object that shares the associated
1529  // asynchronous state
1530  return (future<_Ty>(_MyPromise._Get_state_for_future(), _Nil()));
1531  }
_Promise< _Ty > _MyPromise
Definition: future:1569
Definition: future:1111
Definition: xtr1common:15
template<class _Ty>
promise& promise< _Ty >::operator= ( promise< _Ty > &&  _Other)
inline
1507  { // assign from rvalue promise object
1508  _MyPromise = _STD forward<_Promise<_Ty> >(_Other._MyPromise);
1509  return (*this);
1510  }
_Promise< _Ty > _MyPromise
Definition: future:1569
template<class _Ty>
promise& promise< _Ty >::operator= ( const promise< _Ty > &  )
delete
template<class _Ty>
void promise< _Ty >::set_exception ( _XSTD exception_ptr  _Exc)
inline
1556  { // store result
1557  _MyPromise._Get_state_for_set()._Set_exception(_Exc, false);
1558  }
_Promise< _Ty > _MyPromise
Definition: future:1569
template<class _Ty>
void promise< _Ty >::set_exception_at_thread_exit ( _XSTD exception_ptr  _Exc)
inline
1561  { // store result and block until thread exit
1562  _MyPromise._Get_state_for_set()._Set_exception(_Exc, true);
1563  }
_Promise< _Ty > _MyPromise
Definition: future:1569
template<class _Ty>
void promise< _Ty >::set_value ( const _Ty &  _Val)
inline
1534  { // store result
1535  _MyPromise._Get_state_for_set()._Set_value(_Val, false);
1536  }
_In_ int _Val
Definition: vcruntime_string.h:62
_Promise< _Ty > _MyPromise
Definition: future:1569
template<class _Ty>
void promise< _Ty >::set_value ( _Ty &&  _Val)
inline
1544  { // store result
1545  _MyPromise._Get_state_for_set()._Set_value(
1546  _STD forward<_Ty>(_Val), false);
1547  }
_In_ int _Val
Definition: vcruntime_string.h:62
_Promise< _Ty > _MyPromise
Definition: future:1569
template<class _Ty>
void promise< _Ty >::set_value_at_thread_exit ( const _Ty &  _Val)
inline
1539  { // store result and block until thread exit
1540  _MyPromise._Get_state_for_set()._Set_value(_Val, true);
1541  }
_In_ int _Val
Definition: vcruntime_string.h:62
_Promise< _Ty > _MyPromise
Definition: future:1569
template<class _Ty>
void promise< _Ty >::set_value_at_thread_exit ( _Ty &&  _Val)
inline
1550  { // store result and block until thread exit
1551  _MyPromise._Get_state_for_set()._Set_value(
1552  _STD forward<_Ty>(_Val), true);
1553  }
_In_ int _Val
Definition: vcruntime_string.h:62
_Promise< _Ty > _MyPromise
Definition: future:1569
template<class _Ty>
void promise< _Ty >::swap ( promise< _Ty > &  _Other)
inline
1523  { // exchange with _Other
1524  _MyPromise._Swap(_Other._MyPromise);
1525  }
_Promise< _Ty > _MyPromise
Definition: future:1569

Member Data Documentation

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

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