STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Concurrency::completion_future Class Reference

Class represents a future corresponding to a C++ AMP asynchronous operation More...

#include <amprt.h>

Public Member Functions

 completion_future ()
 Default constructor More...
 
 completion_future (const completion_future &_Other)
 Copy constructor More...
 
 completion_future (completion_future &&_Other)
 Move constructor More...
 
 ~completion_future ()
 Destructor More...
 
completion_futureoperator= (const completion_future &_Other)
 Copy assignment operator More...
 
completion_futureoperator= (completion_future &&_Other)
 Move assignment operator More...
 
void get () const
 Waits until the associated asynchronous operation completes Throws the stored exception if one was encountered during the asynchronous operation More...
 
bool valid () const
 Returns true if the object is associated with an asynchronous operation More...
 
void wait () const
 Blocks until the associated asynchronous operation completes More...
 
template<class _Rep , class _Period >
std::future_status wait_for (const std::chrono::duration< _Rep, _Period > &_Rel_time) const
 Blocks until the associated asynchronous operation completes or _Rel_time has elapsed More...
 
template<class _Clock , class _Duration >
std::future_status wait_until (const std::chrono::time_point< _Clock, _Duration > &_Abs_time) const
 Blocks until the associated asynchronous operation completes or until the current time exceeds _Abs_time More...
 
 operator std::shared_future< void > () const
 Returns a std::shared_future<void> object corresponding to the associated asynchronous operation More...
 
template<typename _Functor >
void then (const _Functor &_Func) const
 Chains a callback Functor to the completion_future to be executed when the associated asynchronous operation finishes execution More...
 
concurrency::task< voidto_task () const
 Returns a concurrency::task<void> object corresponding to the associated asynchronous operation More...
 

Private Member Functions

 completion_future (const std::shared_future< void > &_Shared_future, const concurrency::task< void > &_Task)
 

Private Attributes

std::shared_future< void_M_shared_future
 
concurrency::task< void_M_task
 

Friends

class details::_Amp_runtime_trace
 

Detailed Description

Class represents a future corresponding to a C++ AMP asynchronous operation

Constructor & Destructor Documentation

Concurrency::completion_future::completion_future ( )
inline

Default constructor

1275  {
1276  }
Concurrency::completion_future::completion_future ( const completion_future _Other)
inline

Copy constructor

1282  : _M_shared_future(_Other._M_shared_future),
1283  _M_task(_Other._M_task)
1284  {
1285  }
std::shared_future< void > _M_shared_future
Definition: amprt.h:1435
concurrency::task< void > _M_task
Definition: amprt.h:1436
Concurrency::completion_future::completion_future ( completion_future &&  _Other)
inline

Move constructor

1291  : _M_shared_future(std::move(_Other._M_shared_future)),
1292  _M_task(std::move(_Other._M_task))
1293  {
1294  }
std::shared_future< void > _M_shared_future
Definition: amprt.h:1435
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
concurrency::task< void > _M_task
Definition: amprt.h:1436
Concurrency::completion_future::~completion_future ( )
inline

Destructor

1300  {
1301  }
Concurrency::completion_future::completion_future ( const std::shared_future< void > &  _Shared_future,
const concurrency::task< void > &  _Task 
)
inlineprivate
1431  : _M_shared_future(_Shared_future), _M_task(_Task)
1432  {
1433  }
std::shared_future< void > _M_shared_future
Definition: amprt.h:1435
concurrency::task< void > _M_task
Definition: amprt.h:1436

Member Function Documentation

void Concurrency::completion_future::get ( ) const
inline

Waits until the associated asynchronous operation completes Throws the stored exception if one was encountered during the asynchronous operation

1335  {
1336  _M_shared_future.get();
1337  }
std::shared_future< void > _M_shared_future
Definition: amprt.h:1435
Concurrency::completion_future::operator std::shared_future< void > ( ) const
inline

Returns a std::shared_future<void> object corresponding to the associated asynchronous operation

Returns
A std::shared_future<void> object corresponding to the associated asynchronous operation
1399  {
1400  return _M_shared_future;
1401  }
std::shared_future< void > _M_shared_future
Definition: amprt.h:1435
completion_future& Concurrency::completion_future::operator= ( const completion_future _Other)
inline

Copy assignment operator

1307  {
1308  if (this != &_Other) {
1309  _M_shared_future = _Other._M_shared_future;
1310  _M_task = _Other._M_task;
1311  }
1312 
1313  return (*this);
1314  }
std::shared_future< void > _M_shared_future
Definition: amprt.h:1435
concurrency::task< void > _M_task
Definition: amprt.h:1436
completion_future& Concurrency::completion_future::operator= ( completion_future &&  _Other)
inline

Move assignment operator

1320  {
1321  if (this != &_Other) {
1322  _M_shared_future = std::move(_Other._M_shared_future);
1323  _M_task = std::move(_Other._M_task);
1324  }
1325 
1326  return (*this);
1327  }
std::shared_future< void > _M_shared_future
Definition: amprt.h:1435
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
concurrency::task< void > _M_task
Definition: amprt.h:1436
template<typename _Functor >
void Concurrency::completion_future::then ( const _Functor &  _Func) const
inline

Chains a callback Functor to the completion_future to be executed when the associated asynchronous operation finishes execution

1409  {
1410  this->to_task().then(_Func);
1411  }
concurrency::task< void > to_task() const
Returns a concurrency::task object corresponding to the associated asynchronous operation ...
Definition: amprt.h:1421
concurrency::task<void> Concurrency::completion_future::to_task ( ) const
inline

Returns a concurrency::task<void> object corresponding to the associated asynchronous operation

Returns
A concurrency::task<void> object corresponding to the associated asynchronous operation
1422  {
1423  return _M_task;
1424  }
concurrency::task< void > _M_task
Definition: amprt.h:1436
bool Concurrency::completion_future::valid ( ) const
inline

Returns true if the object is associated with an asynchronous operation

Returns
true if the object is associated with an asynchronous operation and false otherwise
1348  {
1349  return _M_shared_future.valid();
1350  }
std::shared_future< void > _M_shared_future
Definition: amprt.h:1435
void Concurrency::completion_future::wait ( ) const
inline

Blocks until the associated asynchronous operation completes

1356  {
1357  _M_shared_future.wait();
1358  }
std::shared_future< void > _M_shared_future
Definition: amprt.h:1435
template<class _Rep , class _Period >
std::future_status Concurrency::completion_future::wait_for ( const std::chrono::duration< _Rep, _Period > &  _Rel_time) const
inline

Blocks until the associated asynchronous operation completes or _Rel_time has elapsed

Returns
1371  {
1372  return _M_shared_future.wait_for(_Rel_time);
1373  }
std::shared_future< void > _M_shared_future
Definition: amprt.h:1435
template<class _Clock , class _Duration >
std::future_status Concurrency::completion_future::wait_until ( const std::chrono::time_point< _Clock, _Duration > &  _Abs_time) const
inline

Blocks until the associated asynchronous operation completes or until the current time exceeds _Abs_time

Returns
1386  {
1387  return _M_shared_future.wait_until(_Abs_time);
1388  }
std::shared_future< void > _M_shared_future
Definition: amprt.h:1435

Friends And Related Function Documentation

friend class details::_Amp_runtime_trace
friend

Member Data Documentation

std::shared_future<void> Concurrency::completion_future::_M_shared_future
private
concurrency::task<void> Concurrency::completion_future::_M_task
private

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