winrt::handle_type 구조체 템플릿(C++/WinRT)
winrt::handle 및 winrt::file_handle 구조체에 대한 템플릿입니다.
참고
고유한 핸들 특성(예: handle_traits 또는 file_handle_traits\cppwinrt\winrt\base.h
참조)을 정의하고 winrt::handle_typetypename T
함께 사용할 수 있습니다. 이러한 예제 base.h
중 하나를 사용자 고유의 소스 코드 파일로 복사하고 고유한 핸들 유형 및 구현을 제공합니다. MSDN Magazine 문서에는 C++를 사용한 Windows 자세한 내용이 있습니다.
구문
template <typename T>
struct handle_type
템플릿 매개 변수
typename T
표현되는 핸들의 종류(핸들, 파일 핸들 또는 다른 형식)를 지정하는 특성 형식입니다.
요구 사항
지원되는 최소 SDK: Windows SDK 버전 10.0.17134.0(Windows 10, 버전 1803)
네임스페이스: winrt
헤더: %WindowsSdkDir%IncludeWindowsTargetPlatformVersion<>\cppwinrt\winrt\base.h(기본적으로 포함)
멤버 형식 별칭
별칭 이름 | Type |
---|---|
handle_type::type | typename T::type의 동의어입니다. 여기서 T는 템플릿 매개 변수입니다typename T . |
생성자
생성자 | Description |
---|---|
handle_type::handle_type 생성자 | 필요에 따라 입력 데이터의 복사 또는 이동을 사용하여 handle_type 구조체의 새 인스턴스를 초기화합니다. |
멤버 함수
기능 | 설명 |
---|---|
handle_type::attach 함수 | 핸들 값에 연결하고 해당 값을 소유합니다. |
handle_type::close 함수 | 기본 핸들을 닫습니다. |
handle_type::d etach 함수 | 기본 핸들에서 분리합니다. |
handle_type::get 함수 | 함수에 전달해야 하는 경우 기본 핸들을 반환합니다. |
handle_type::p ut 함수 | 기본 핸들의 주소를 반환합니다. 이 함수는 핸들에 대한 포인터를 통해 참조를 out 매개 변수로 반환하는 메서드를 호출하는 데 도움이 됩니다. |
멤버 연산자
연산자 | 설명 |
---|---|
handle_type::operator bool | handle_type 개체가 현재 유효한 핸들을 나타내는지 여부를 확인합니다. |
handle_type::operator=(대입 연산자) | handle_type 개체에 값을 할당합니다. |
무료 함수
기능 | 설명 |
---|---|
swap 함수 | 서로의 핸들을 포함할 수 있도록 두 handle_type 매개 변수의 내용을 교환합니다. |
handle_type::handle_type 생성자
필요에 따라 입력 데이터의 복사 또는 이동을 사용하여 handle_type 구조체의 새 인스턴스를 초기화합니다.
구문
handle_type() noexcept;
explicit handle_type(handle_type::type value) noexcept;
handle_type(handle_type&& other) noexcept;
매개 변수
value
handle_type 개체를 초기화하는 값입니다.
other
handle_type 개체를 초기화하는 또 다른 handle_type.
handle_type::attach 함수
핸들 값에 연결하고 해당 값을 소유합니다.
구문
void attach(handle_type::type value) noexcept;
매개 변수
value
연결할 핸들 값입니다.
handle_type::close 함수
기본 핸들을 닫습니다.
구문
void close() noexcept;
handle_type::d etach 함수
기본 핸들에서 분리합니다.
구문
handle_type::type detach() noexcept;
반환 값
이전에 handle_type 개체로 표현된 기본 핸들입니다.
handle_type::get 함수
함수에 전달해야 하는 경우 기본 핸들을 반환합니다.
구문
handle_type::type get() const noexcept;
반환 값
handle_type 개체가 나타내는 기본 핸들입니다.
handle_type::p ut 함수
기본 핸들의 주소를 반환합니다. 이 함수는 핸들에 대한 포인터를 통해 참조를 out 매개 변수로 반환하는 메서드를 호출하는 데 도움이 됩니다.
구문
handle_type::type* put() noexcept;
반환 값
handle_type 개체가 나타내는 기본 핸들의 주소입니다.
handle_type::operator bool
handle_type 개체가 현재 유효한 핸들을 나타내는지 여부를 확인합니다.
구문
explicit operator bool() const noexcept;
반환 값
true
handle_type 개체가 현재 유효한 핸들을 나타내면 그렇지 않습니다false
.
handle_type::operator=(대입 연산자)
handle_type 개체에 값을 할당합니다.
구문
winrt::handle_type& operator=(winrt::handle_type&& other) noexcept;
매개 변수
other
handle_type 개체에 할당할 handle_type 값입니다.
반환 값
handle_type 개체에 대한 참조입니다.
swap 함수
서로의 핸들을 포함할 수 있도록 두 handle_type 매개 변수의 내용을 교환합니다.
구문
void swap(winrt::handle_type& left, winrt::handle_type& right) noexcept;
매개 변수
left
right
핸들이 다른 매개 변수의 핸들과 상호 교환되는 handle_type 값입니다.
참고 항목
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기