Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
btraii.mm
Go to the documentation of this file.
1
// Copyright (C) 2022 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4
#
include
"btraii_p.h"
5
6
#
include
<
qdebug
.
h
>
7
8
#
include
<
Foundation
/
Foundation
.
h
>
9
10
#
include
<
utility
>
11
12
QT_BEGIN_NAMESPACE
13
14
namespace
DarwinBluetooth
{
15
16
StrongReference
::
StrongReference
(
void
*object,
RetainPolicy
policy)
17
: objCInstance(object)
18
{
19
if
(objCInstance && policy ==
RetainPolicy
::
doInitialRetain
)
20
objCInstance = [getAs<NSObject>() retain];
21
}
22
23
StrongReference
::
StrongReference
(
const
StrongReference
&other)
24
{
25
if
((objCInstance = other.getAs<NSObject>()))
26
objCInstance = [other.getAs<NSObject>() retain];
27
}
28
29
StrongReference
::
StrongReference
(
StrongReference
&&other)
30
{
31
std
::swap(objCInstance, other.objCInstance);
32
}
33
34
StrongReference
::~
StrongReference
()
35
{
36
[getAs<NSObject>() release];
37
}
38
39
StrongReference
&
StrongReference
::
operator
= (
const
StrongReference
&other)
noexcept
40
{
41
if
(
this
!= &other) {
42
[getAs<NSObject>() release];
43
objCInstance = [other.getAs<NSObject>() retain];
44
}
45
46
return
*
this
;
47
}
48
49
StrongReference
&
StrongReference
::
operator
= (
StrongReference
&&other)
noexcept
50
{
51
swap
(
other
)
;
52
53
return
*
this
;
54
}
55
56
void
*
StrongReference
::
release
()
57
{
58
void
*released = objCInstance;
59
objCInstance =
nullptr
;
60
61
return
released;
62
}
63
64
void
StrongReference
::
reset
()
65
{
66
[getAs<NSObject>() release];
67
objCInstance =
nullptr
;
68
}
69
70
void
StrongReference
::
reset
(
void
*obj,
RetainPolicy
policy)
71
{
72
[getAs<NSObject>() release];
73
objCInstance = obj;
74
75
if
(objCInstance && policy ==
RetainPolicy
::
doInitialRetain
)
76
objCInstance = [getAs<NSObject>() retain];
77
}
78
79
}
// namespace DarwinBluetooth
80
81
QT_END_NAMESPACE
DarwinBluetooth::StrongReference
Definition
btraii_p.h:44
DarwinBluetooth::StrongReference::operator=
StrongReference & operator=(StrongReference &&other) noexcept
Definition
btraii.mm:49
DarwinBluetooth::StrongReference::operator=
StrongReference & operator=(const StrongReference &other) noexcept
Definition
btraii.mm:39
DarwinBluetooth::StrongReference::~StrongReference
~StrongReference()
Definition
btraii.mm:34
DarwinBluetooth::StrongReference::StrongReference
StrongReference(void *object, RetainPolicy policy)
Definition
btraii.mm:16
DarwinBluetooth::StrongReference::reset
void reset(void *newInstance, RetainPolicy policy)
Definition
btraii.mm:70
DarwinBluetooth::StrongReference::StrongReference
StrongReference(StrongReference &&other)
Definition
btraii.mm:29
DarwinBluetooth::StrongReference::swap
void swap(StrongReference &other) noexcept
Definition
btraii_p.h:56
DarwinBluetooth::StrongReference::StrongReference
StrongReference(const StrongReference &other)
Definition
btraii.mm:23
DarwinBluetooth::StrongReference::reset
void reset()
Definition
btraii.mm:64
DarwinBluetooth::StrongReference::release
void * release()
Definition
btraii.mm:56
DarwinBluetooth
Definition
btcentralmanager.mm:22
DarwinBluetooth::RetainPolicy
RetainPolicy
Definition
btraii_p.h:27
DarwinBluetooth::RetainPolicy::doInitialRetain
@ doInitialRetain
Definition
btraii_p.h:29
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
qtconnectivity
src
bluetooth
darwin
btraii.mm
Generated on
for Qt by
1.18.0