Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
13
14namespace DarwinBluetooth {
15
17 : objCInstance(object)
18{
19 if (objCInstance && policy == RetainPolicy::doInitialRetain)
20 objCInstance = [getAs<NSObject>() retain];
21}
22
24{
25 if ((objCInstance = other.getAs<NSObject>()))
26 objCInstance = [other.getAs<NSObject>() retain];
27}
28
30{
31 std::swap(objCInstance, other.objCInstance);
32}
33
35{
36 [getAs<NSObject>() release];
37}
38
40{
41 if (this != &other) {
42 [getAs<NSObject>() release];
43 objCInstance = [other.getAs<NSObject>() retain];
44 }
45
46 return *this;
50{
51 swap(other);
52
53 return *this;
54}
55
57{
58 void *released = objCInstance;
59 objCInstance = nullptr;
60
61 return released;
62}
63
65{
66 [getAs<NSObject>() release];
67 objCInstance = nullptr;
68}
69
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
StrongReference & operator=(const StrongReference &other) noexcept
Definition btraii.mm:39
Combined button and popup list for selecting options.
GLuint object
[3]
GLhandleARB obj
[2]
sem release()
QSharedPointer< T > other(t)
[5]
this swap(other)
QSizePolicy policy