| description | Learn more about: completion_future Class | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| title | completion_future Class | ||||||||||
| ms.date | 11/04/2016 | ||||||||||
| f1_keywords |
|
||||||||||
| ms.assetid | 1303c62e-546d-4b02-a578-251ed3fc0b6b |
Represents a future corresponding to a C++ AMP asynchronous operation.
class completion_future;| Name | Description |
|---|---|
| completion_future Constructor | Initializes a new instance of the completion_future class. |
| ~completion_future Destructor | Destroys the completion_future object. |
| Name | Description |
|---|---|
| get | Waits until the associated asynchronous operation completes. |
| then | Chains a callback function object to the completion_future object to be executed when the associated asynchronous operation finishes execution. |
| to_task | Returns a task object corresponding to the associated asynchronous operation. |
| valid | Gets a Boolean value that indicates whether the object is associated with an asynchronous operation. |
| wait | Blocks until the associated asynchronous operation completes. |
| wait_for | Blocks until the associated asynchronous operation completes or the time specified by _Rel_time has elapsed. |
| wait_until | Blocks until the associated asynchronous operation completes or until the current time exceeds the value specified by _Abs_time. |
| Name | Description |
|---|---|
| operator std::shared_future<void> | Implicitly converts the completion_future object to an std::shared_future object. |
| operator= | Copies the contents of the specified completion_future object into this one. |
completion_future
Header: amprt.h
Namespace: concurrency
Initializes a new instance of the completion_future class.
completion_future();
completion_future(
const completion_future& _Other );
completion_future(
completion_future&& _Other );_Other
The completion_future object to copy or move.
| Name | Description |
|---|---|
completion_future(); |
Initializes a new instance of the completion_future Class |
completion_future(const completion_future& _Other); |
Initializes a new instance of the completion_future class by copying a constructor. |
completion_future(completion_future&& _Other); |
Initializes a new instance of the completion_future class by moving a constructor. |
Waits until the associated asynchronous operation completes. Throws the stored exception if one was encountered during the asynchronous operation.
void get() const;Implicitly converts the completion_future object to an std::shared_future object.
operator std::shared_future<void>() const;An std::shared_future object.
Copies the contents of the specified completion_future object into this one.
completion_future& operator= (const completion_future& _Other );
completion_future& operator= (completion_future&& _Other );_Other
The object to copy from.
A reference to this completion_future object.
| Name | Description |
|---|---|
completion_future& operator=(const completion_future& _Other); |
Copies the contents of the specified completion_future object into this one, using a deep copy. |
completion_future& operator=(completion_future&& _Other); |
Copies the contents of the specified completion_future object into this one, using a move assignment. |
Chains a callback function object to the completion_future object to be executed when the associated asynchronous operation finishes execution.
template <typename _Functor>
void then(const _Functor & _Func ) const;_Functor
The callback functor.
_Func
The callback function object.
Returns a task object corresponding to the associated asynchronous operation.
concurrency::task<void> to_task() const;A task object corresponding to the associated asynchronous operation.
Gets a Boolean value that indicates whether the object is associated with an asynchronous operation.
bool valid() const;true if the object is associated with an asynchronous operation; otherwise, false.
Blocks until the associated asynchronous operation completes.
void wait() const;Blocks until the associated asynchronous operation completes or the time that's specified by _Rel_time has elapsed.
template <
class _Rep,
class _Period
>
std::future_status::future_status wait_for(
const std::chrono::duration< _Rep, _Period>& _Rel_time ) const;_Rep
An arithmetic type that represents the number of ticks.
_Period
A std::ratio that represents the number of seconds that elapse per tick.
_Rel_time
The maximum amount of time to wait for the operation to complete.
Returns:
-
std::future_status::deferredif the associated asynchronous operation is not running. -
std::future_status::readyif the associated asynchronous operation is finished. -
std::future_status::timeoutif the specified time period has elapsed.
Blocks until the associated asynchronous operation completes or until the current time exceeds the value specified by _Abs_time.
template <
class _Clock,
class _Duration
>
std::future_status::future_status wait_until(
const std::chrono::time_point< _Clock, _Duration>& _Abs_time ) const;_Clock
The clock on which this time point is measured.
_Duration
The time interval since the start of _Clock’s epoch, after which the function will time out.
_Abs_time
The point in time after which the function will time out.
Returns:
-
std::future_status::deferredif the associated asynchronous operation is not running. -
std::future_status::readyif the associated asynchronous operation is finished. -
std::future_status::timeoutif the time period specified has elapsed.
Destroys the completion_future object.
~completion_future();