Qt
6.x
The Qt SDK
Loading...
Searching...
No Matches
qrecursionwatcher_p.h
Go to the documentation of this file.
1
// Copyright (C) 2018 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
#ifndef QRECURSIONWATCHER_P_H
5
#define QRECURSIONWATCHER_P_H
6
7
//
8
// W A R N I N G
9
// -------------
10
//
11
// This file is not part of the Qt API. It exists purely as an
12
// implementation detail. This header file may change from version to
13
// version without notice, or even be removed.
14
//
15
// We mean it.
16
//
17
18
#include <QtCore/private/qglobal_p.h>
19
20
QT_BEGIN_NAMESPACE
21
22
class
QRecursionNode
;
23
class
QRecursionNode
{
24
public
:
25
inline
QRecursionNode
();
26
bool
*
_r
;
27
};
28
29
template
<
class
T, QRecursionNode T::*Node>
30
class
QRecursionWatcher
{
31
public
:
32
inline
QRecursionWatcher
(T *);
33
inline
~QRecursionWatcher
();
34
inline
bool
hasRecursed
()
const
;
35
private
:
36
T *_t;
37
bool
_r;
38
};
39
40
QRecursionNode::QRecursionNode
()
41
: _r(
nullptr
)
42
{
43
}
44
45
template
<
class
T, QRecursionNode T::*Node>
46
QRecursionWatcher<T, Node>::QRecursionWatcher
(T *
t
)
47
: _t(
t
), _r(
false
)
48
{
49
if
((_t->*
Node
)._r) *(_t->*
Node
)._r =
true
;
50
(_t->*
Node
)._r = &_r;
51
}
52
53
template
<
class
T, QRecursionNode T::*Node>
54
QRecursionWatcher<T, Node>::~QRecursionWatcher
()
55
{
56
if
((_t->*
Node
)._r == &_r) (_t->*
Node
)._r =
nullptr
;
57
}
58
59
template
<
class
T, QRecursionNode T::*Node>
60
bool
QRecursionWatcher<T, Node>::hasRecursed
()
const
61
{
62
return
_r;
63
}
64
65
QT_END_NAMESPACE
66
67
#endif
// QRECURSIONWATCHER_P_H
Node
Definition
lalr.h:137
QRecursionNode
Definition
qrecursionwatcher_p.h:23
QRecursionNode::QRecursionNode
QRecursionNode()
Definition
qrecursionwatcher_p.h:40
QRecursionNode::_r
bool * _r
Definition
qrecursionwatcher_p.h:26
QRecursionWatcher
Definition
qrecursionwatcher_p.h:30
QRecursionWatcher::QRecursionWatcher
QRecursionWatcher(T *)
Definition
qrecursionwatcher_p.h:46
QRecursionWatcher::hasRecursed
bool hasRecursed() const
Definition
qrecursionwatcher_p.h:60
QRecursionWatcher::~QRecursionWatcher
~QRecursionWatcher()
Definition
qrecursionwatcher_p.h:54
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1545
t
GLdouble GLdouble t
Definition
qopenglext.h:243
nullptr
QObject::connect nullptr
Definition
src_corelib_kernel_qobject.cpp:255
false
return false
Definition
src_corelib_thread_qatomic.cpp:23
qtdeclarative
src
qml
qml
ftw
qrecursionwatcher_p.h
Generated by
1.9.7