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
qautoresetevent_pipe_p.h
Go to the documentation of this file.
1
// Copyright (C) 2024 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
//
5
// W A R N I N G
6
// -------------
7
//
8
// This file is not part of the Qt API. It exists purely as an
9
// implementation detail. This header file may change from version to
10
// version without notice, or even be removed.
11
//
12
// We mean it.
13
//
14
15
#
ifndef
QAUTORESETEVENT_PIPE_P_H
16
#
define
QAUTORESETEVENT_PIPE_P_H
17
18
#
include
<
QtMultimedia
/
qtmultimediaexports
.
h
>
19
#
include
<
QtCore
/
qsocketnotifier
.
h
>
20
21
#
include
<
atomic
>
22
23
QT_BEGIN_NAMESPACE
24
25
namespace
QtPrivate
{
26
27
class
Q_MULTIMEDIA_EXPORT QAutoResetEventPipe
final
:
public
QObject
28
{
29
Q_OBJECT
30
31
public
:
32
explicit
QAutoResetEventPipe
(
QObject
*
parent
=
nullptr
);
33
~
QAutoResetEventPipe
();
34
Q_DISABLE_COPY_MOVE
(
QAutoResetEventPipe
)
35
36
bool
isValid
()
const
{
return
m_fdProducer
!= -1; }
37
38
void
set
();
39
40
template
<
typename
...
Args
>
41
QMetaObject
::
Connection
callOnActivated
(
Args
&&...
args
)
42
{
43
return
connect
(
this
, &
QAutoResetEventPipe
::
activated
,
std
::
forward
<
Args
>(
args
)...);
44
}
45
46
template
<
typename
Functor
>
47
QMetaObject
::
Connection
callOnActivated
(
Functor
&&
functor
)
48
{
49
return
connect
(
this
, &
QAutoResetEventPipe
::
activated
,
this
,
std
::
forward
<
Functor
>(
functor
));
50
}
51
52
Q_SIGNALS
:
53
void
activated
();
54
55
private
:
56
QSocketNotifier
m_notifier
;
57
int
m_fdProducer
= -1;
58
int
m_fdConsumer
= -1;
59
std
::
atomic_flag
m_consumePending
{};
60
};
61
62
}
// namespace QtPrivate
63
64
QT_END_NAMESPACE
65
66
#
endif
// QAUTORESETEVENT_PIPE_P_H
QtPrivate
Definition
qalloc.h:29
qtmultimedia
src
multimedia
audio
qautoresetevent_pipe_p.h
Generated on
for Qt by
1.16.1