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
qfactorycacheregistration.cpp
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
"qfactorycacheregistration_p.h"
5
6
#
include
<
QtCore
/
QMutex
>
7
8
QT_BEGIN_NAMESPACE
9
10
#
ifdef
QT_USE_FACTORY_CACHE_REGISTRATION
11
12
static
QBasicMutex
registrationMutex
;
13
static
detail
::
QWinRTFactoryCacheRegistration
*
firstElement
;
14
15
detail
::
QWinRTFactoryCacheRegistration
::
QWinRTFactoryCacheRegistration
(
16
QFunctionPointer
clearFunction
)
17
:
m_clearFunction
(
clearFunction
)
18
{
19
QMutexLocker
lock
(&
registrationMutex
);
20
21
// forward pointers
22
m_next
=
std
::
exchange
(
firstElement
,
this
);
23
24
// backward pointers
25
m_prevNext
= &
firstElement
;
26
if
(
m_next
)
27
m_next
->
m_prevNext
= &
m_next
;
28
}
29
30
detail
::
QWinRTFactoryCacheRegistration
::~
QWinRTFactoryCacheRegistration
()
31
{
32
QMutexLocker
lock
(&
registrationMutex
);
33
34
*
m_prevNext
=
m_next
;
35
36
if
(
m_next
)
37
m_next
->
m_prevNext
=
m_prevNext
;
38
}
39
40
void
detail
::
QWinRTFactoryCacheRegistration
::
clearAllCaches
()
41
{
42
QMutexLocker
lock
(&
registrationMutex
);
43
44
detail
::
QWinRTFactoryCacheRegistration
*
element
;
45
46
for
(
element
=
firstElement
;
element
!=
nullptr
;
element
=
element
->
m_next
) {
47
element
->
m_clearFunction
();
48
}
49
}
50
51
#
endif
52
53
QT_END_NAMESPACE
QSqlRelationalDelegate
\inmodule QtSql
qtbase
src
corelib
platform
windows
qfactorycacheregistration.cpp
Generated on
for Qt by
1.14.0