Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qbluetoothutils_winrt_p.h File Reference

(80b628514cf40009d81a7dfaf1580615135f83e4)

#include <winrt/base.h>
#include <QtCore/private/qfactorycacheregistration_p.h>
#include <QtCore/QtGlobal>
#include <QtCore/private/qglobal_p.h>
#include <wrl/client.h>
#include <functional>
#include <type_traits>
Include dependency graph for qbluetoothutils_winrt_p.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  winrt
namespace  winrt::impl
namespace  ABI
namespace  ABI::Windows
namespace  ABI::Windows::Storage
namespace  ABI::Windows::Storage::Streams

Macros

#define LOG_HRESULT(hr)
#define HR(x)
#define TRY(x)
#define SAFE(x)

Typedefs

using NativeBuffer = ABI::Windows::Storage::Streams::IBuffer

Functions

template<typename Async>
auto winrt::impl::wait_for (Async const &async, Windows::Foundation::TimeSpan const &timeout)
QByteArray byteArrayFromBuffer (const Microsoft::WRL::ComPtr< NativeBuffer > &buffer, bool isWCharString=false)
void mainThreadCoInit (void *caller)
void mainThreadCoUninit (void *caller)

Macro Definition Documentation

◆ HR

#define HR ( x)
Value:
std::invoke([&]() { \
try { \
x; \
} catch (winrt::hresult_error const &e) { \
LOG_HRESULT(e.code()) << "/*" << #x << "*/"; \
return e.code(); \
} \
return winrt::hresult{ S_OK }; \
})
GLint GLint GLint GLint GLint x

Definition at line 56 of file qbluetoothutils_winrt_p.h.

◆ LOG_HRESULT

#define LOG_HRESULT ( hr)
Value:
qCWarning(QT_BT_WINDOWS) << "HRESULT:" << quint32(hr)
#define qCWarning(category,...)
unsigned int quint32
Definition qtypes.h:56

Definition at line 54 of file qbluetoothutils_winrt_p.h.

◆ SAFE

#define SAFE ( x)
Value:
std::invoke([&]() -> decltype(x) { \
try { return (x); } \
catch (winrt::hresult_error const &e) { \
LOG_HRESULT(e.code()) << "/*" << #x << "*/"; \
if constexpr (std::is_default_constructible_v<decltype(x)>) \
return decltype(x){}; \
else \
return decltype(x)(nullptr); \
} \
})

Definition at line 78 of file qbluetoothutils_winrt_p.h.

◆ TRY

#define TRY ( x)
Value:
std::invoke([&]() { \
try { \
x; \
} catch (winrt::hresult_error const &e) { \
LOG_HRESULT(e.code()) << "/*" << #x << "*/"; \
return false; \
} \
return true; \
})

Definition at line 67 of file qbluetoothutils_winrt_p.h.

Typedef Documentation

◆ NativeBuffer

using NativeBuffer = ABI::Windows::Storage::Streams::IBuffer

Definition at line 102 of file qbluetoothutils_winrt_p.h.

Function Documentation

◆ byteArrayFromBuffer()

QT_BEGIN_NAMESPACE QByteArray byteArrayFromBuffer ( const Microsoft::WRL::ComPtr< NativeBuffer > & buffer,
bool isWCharString = false )

Definition at line 23 of file qbluetoothutils_winrt.cpp.

◆ mainThreadCoInit()

void mainThreadCoInit ( void * caller)

Definition at line 48 of file qbluetoothutils_winrt.cpp.

Referenced by QBluetoothSocketPrivateWinRT::QBluetoothSocketPrivateWinRT().

Here is the caller graph for this function:

◆ mainThreadCoUninit()

void mainThreadCoUninit ( void * caller)

Definition at line 75 of file qbluetoothutils_winrt.cpp.

Referenced by QBluetoothSocketPrivateWinRT::~QBluetoothSocketPrivateWinRT().

Here is the caller graph for this function: