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
qgenericatomic.h
Go to the documentation of this file.
1
// Copyright (C) 2011 Thiago Macieira <thiago@kde.org>
2
// Copyright (C) 2016 Intel Corporation.
3
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
// Qt-Security score:significant reason:default
5
6
#
ifndef
QGENERICATOMIC_H
7
#
define
QGENERICATOMIC_H
8
9
#
include
<
QtCore
/
qcompilerdetection
.
h
>
10
#
include
<
QtCore
/
qtconfigmacros
.
h
>
11
#
include
<
QtCore
/
qtypes
.
h
>
12
13
QT_BEGIN_NAMESPACE
14
15
#
if
0
16
// silence syncqt warnings
17
QT_END_NAMESPACE
18
#
pragma
qt_sync_skip_header_check
19
#
pragma
qt_sync_stop_processing
20
#
endif
21
22
template
<
int
Size>
struct
QAtomicOpsSupport
23
{
24
enum
{ IsSupported = (Size ==
sizeof
(
int
) || Size ==
sizeof
(qptrdiff)) };
25
};
26
27
template
<
typename
T>
struct
QAtomicAdditiveType
28
{
29
typedef
T
AdditiveT
;
30
static
const
int
AddScale
= 1;
31
};
32
template
<
typename
T>
struct
QAtomicAdditiveType
<T *>
33
{
34
typedef
qptrdiff
AdditiveT
;
35
static
const
int
AddScale
=
sizeof
(T);
36
};
37
38
QT_END_NAMESPACE
39
#
endif
// QGENERICATOMIC_H
QAtomicAdditiveType< T * >
Definition
qgenericatomic.h:33
QAtomicAdditiveType< T * >::AddScale
static const int AddScale
Definition
qgenericatomic.h:35
QAtomicAdditiveType< T * >::AdditiveT
qptrdiff AdditiveT
Definition
qgenericatomic.h:34
QAtomicAdditiveType
Definition
qgenericatomic.h:28
QAtomicAdditiveType::AdditiveT
T AdditiveT
Definition
qgenericatomic.h:29
QAtomicAdditiveType::AddScale
static const int AddScale
Definition
qgenericatomic.h:30
qtbase
src
corelib
thread
qgenericatomic.h
Generated on
for Qt by
1.14.0