completion_future 클래스

C++ AMP 비동기 작업에 해당하는 미래를 나타냅니다.

구문

class completion_future;

멤버

공용 생성자

속성 설명
completion_future 생성자 completion_future 클래스의 새 인스턴스를 초기화합니다.
~completion_future 소멸자 개체를 completion_future 삭제합니다.

공용 메서드

이름 설명
get 연결된 비동기 작업이 완료될 때까지 기다립니다.
then 연결된 비동기 작업이 실행을 완료할 completion_future 때 실행할 개체에 콜백 함수 개체를 연결합니다.
to_task task 연결된 비동기 작업에 해당하는 개체를 반환합니다.
유효한 개체가 비동기 작업에 연결되어 있는지 여부를 나타내는 부울 값을 가져옵니다.
wait 연결된 비동기 작업이 완료될 때까지 차단합니다.
wait_for 연결된 비동기 작업이 완료되거나 지정된 _Rel_time 시간이 경과할 때까지 차단합니다.
wait_until 연결된 비동기 작업이 완료되거나 현재 시간이 지정된 값을 _Abs_time초과할 때까지 차단합니다.

Public 연산자

속성 설명
operator std::shared_future<void> 개체를 개체 std::shared_futurecompletion_future 암시적으로 변환합니다.
operator= 지정된 completion_future 개체의 콘텐츠를 이 항목으로 복사합니다.

상속 계층 구조

completion_future

요구 사항

헤더: amprt.h

네임스페이스: 동시성

completion_future

completion_future 클래스의 새 인스턴스를 초기화합니다.

구문

completion_future();

completion_future(
    const completion_future& _Other );

completion_future(
    completion_future&& _Other );

매개 변수

_Other
복사하거나 이동시킬 completion_future 개체입니다.

오버로드 목록

속성 설명
completion_future(); completion_future 클래스의 새 인스턴스를 초기화합니다.
completion_future(const completion_future& _Other); 생성자를 복사하여 completion_future 클래스의 새 인스턴스를 초기화합니다.
completion_future(completion_future&& _Other); 생성자를 이동시켜 completion_future 클래스의 새 인스턴스를 초기화합니다.

get

연결된 비동기 작업이 완료될 때까지 기다립니다. 비동기 작업 중 하나가 발생한 경우 저장된 예외를 throw합니다.

구문

void get() const;

operator std::shared_future<void>

개체를 개체 std::shared_futurecompletion_future 암시적으로 변환합니다.

구문

operator std::shared_future<void>() const;

Return Value

std::shared_future 개체입니다.

operator=

지정된 completion_future 개체의 콘텐츠를 이 항목으로 복사합니다.

구문

completion_future&  operator= (const completion_future& _Other );
completion_future&  operator= (completion_future&& _Other );

매개 변수

_Other
복사할 개체입니다.

Return Value

completion_future 개체에 대한 참조입니다.

오버로드 목록

속성 설명
completion_future& operator=(const completion_future& _Other); 전체 복사본을 사용하여 지정된 completion_future 개체의 내용을 여기로 복사합니다.
completion_future& operator=(completion_future&& _Other); 이동 할당을 사용하여 지정된 completion_future 개체의 내용을 여기로 복사합니다.

then

연결된 비동기 작업이 실행을 완료할 completion_future 때 실행할 개체에 콜백 함수 개체를 연결합니다.

구문

template <typename _Functor>
void then(const _Functor & _Func ) const;

매개 변수

_Functor
콜백 구조 함수입니다.

_Func
콜백 함수 개체입니다.

to_task

task 연결된 비동기 작업에 해당하는 개체를 반환합니다.

구문

concurrency::task<void> to_task() const;

Return Value

연결된 비동기 작업에 해당하는 task 개체입니다.

유효함

개체가 비동기 작업에 연결되어 있는지 여부를 나타내는 부울 값을 가져옵니다.

구문

bool valid() const;

Return Value

true개체가 비동기 작업과 연결되어 있으면 이고, 그렇지 않으면 . false

wait

연결된 비동기 작업이 완료될 때까지 차단합니다.

구문

void wait() const;

wait_for

연결된 비동기 작업이 완료되거나 지정된 _Rel_time 시간이 경과할 때까지 차단합니다.

구문

template <
    class _Rep,
    class _Period
>
std::future_status::future_status wait_for(
    const std::chrono::duration< _Rep, _Period>& _Rel_time ) const;

매개 변수

_담당자
틱 수를 나타내는 산술 형식입니다.

_마침표
틱당 경과되는 시간(초)을 나타내는 std::ratio입니다.

_Rel_time
작업이 완료되기를 기다리는 최대 시간입니다.

Return Value

HRESULT = NO_ERROR를

  • std::future_status::deferred 연결된 비동기 작업이 실행되고 있지 않은 경우

  • std::future_status::ready 연결된 비동기 작업이 완료된 경우

  • std::future_status::timeout 지정된 기간이 경과된 경우

wait_until

연결된 비동기 작업이 완료되거나 현재 시간이 지정된 값을 _Abs_time초과할 때까지 차단합니다.

구문

template <
    class _Clock,
    class _Duration
>
std::future_status::future_status wait_until(
    const std::chrono::time_point< _Clock, _Duration>& _Abs_time ) const;

매개 변수

_시계
이 시간 지점을 측정할 시계입니다.

_기간
epoch가 시작된 이후의 _Clock시간 간격이며, 그 후에 함수가 시간 초과됩니다.

_Abs_time
함수가 시간 초과되는 시점입니다.

Return Value

HRESULT = NO_ERROR를

  1. std::future_status::deferred 연결된 비동기 작업이 실행되고 있지 않은 경우

  2. std::future_status::ready 연결된 비동기 작업이 완료된 경우

  3. std::future_status::timeout 지정된 기간이 경과된 경우

~completion_future

개체를 completion_future 삭제합니다.

구문

~completion_future();

참고 항목

Concurrency 네임스페이스(C++ AMP)