The template for the winrt::handle and winrt::file_handle structs, among others.
Note
You can define your own handle traits (see, for example, handle_traits or file_handle_traits in \cppwinrt\winrt\base.h
), and use them with winrt::handle_type as typename T
. Copy one of those examples from base.h
into your own source code file, and provide your own handle type and implementation. There are more details in the MSDN Magazine article Windows with C++.
template <typename T>
struct handle_type
Template parameters
typename T
A traits type that specifies the kind of handle being represented (a handle, a file handle, or some other type).
Minimum supported SDK: Windows SDK version 10.0.17134.0 (Windows 10, version 1803)
Namespace: winrt
Header: %WindowsSdkDir%Include<WindowsTargetPlatformVersion>\cppwinrt\winrt\base.h (included by default)
Member type aliases Alias name Type handle_type::type A synonym for typename T::type, where T is thetypename T
template parameter. Constructors Member functions Member operators Free functions Function Description swap function Swaps the contents of the two handle_type parameters so that they contain one another's handle. handle_type::handle_type constructor
Initializes a new instance of the handle_type struct, optionally with a copy or move of the input data.
Syntaxhandle_type() noexcept;
explicit handle_type(handle_type::type value) noexcept;
handle_type(handle_type&& other) noexcept;
Parameters
value
A value that initializes the handle_type object.
other
Another handle_type that initializes the handle_type object.
Attaches to a handle value, and takes ownership of it.
Syntaxvoid attach(handle_type::type value) noexcept;
Parameters
value
A handle value to attach to.
Closes the underlying handle.
Syntaxvoid close() noexcept;
handle_type::detach function
Detaches from the underlying handle.
Syntaxhandle_type::type detach() noexcept;
Return value
The underlying handle formerly represented by the handle_type object.
handle_type::get functionReturns the underlying handle, should you need to pass it to a function.
Syntaxhandle_type::type get() const noexcept;
Return value
The underlying handle represented by the handle_type object.
handle_type::put functionReturns the address of the underlying handle; this function helps you call methods that return references as out parameters via a pointer to a handle.
Syntaxhandle_type::type* put() noexcept;
Return value
The address of the underlying handle represented by the handle_type object.
handle_type::operator boolChecks whether or not the handle_type object currently represents a valid handle.
Syntaxexplicit operator bool() const noexcept;
Return value
true
if the handle_type object currently represents a valid handle, otherwise false
.
Assigns a value to the handle_type object.
Syntaxwinrt::handle_type& operator=(winrt::handle_type&& other) noexcept;
Parameters
other
A handle_type value to assign to the handle_type object.
A reference to the handle_type object.
swap functionSwaps the contents of the two handle_type parameters so that they contain one another's handle.
Syntaxvoid swap(winrt::handle_type& left, winrt::handle_type& right) noexcept;
Parameters
left
right
A handle_type value whose handle to mutually swap with that of the other parameter.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4