Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qwindowspipewriter_p.h
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// Copyright (C) 2021 Alex Trotsenko <alex1973tr@gmail.com>
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
QWINDOWSPIPEWRITER_P_H
7
#
define
QWINDOWSPIPEWRITER_P_H
8
9
//
10
// W A R N I N G
11
// -------------
12
//
13
// This file is not part of the Qt API. It exists purely as an
14
// implementation detail. This header file may change from version to
15
// version without notice, or even be removed.
16
//
17
// We mean it.
18
//
19
20
#
include
<
qobject
.
h
>
21
#
include
<
qmutex
.
h
>
22
#
include
<
private
/
qringbuffer_p
.
h
>
23
24
#
include
<
qt_windows
.
h
>
25
26
QT_BEGIN_NAMESPACE
27
28
class
Q_CORE_EXPORT
QWindowsPipeWriter
:
public
QObject
29
{
30
Q_OBJECT
31
public
:
32
explicit
QWindowsPipeWriter(HANDLE pipeWriteEnd, QObject *parent =
nullptr
);
33
~QWindowsPipeWriter();
34
35
void
setHandle(HANDLE hPipeWriteEnd);
36
void
write(
const
QByteArray &ba);
37
void
write(
const
char
*data, qint64 size);
38
void
stop();
39
bool
checkForWrite() {
return
consumePendingAndEmit(
false
); }
40
qint64 bytesToWrite()
const
;
41
bool
isWriteOperationActive()
const
;
42
HANDLE syncEvent()
const
{
return
syncHandle; }
43
44
Q_SIGNALS:
45
void
bytesWritten(qint64 bytes);
46
void
writeFailed();
47
48
protected
:
49
bool
event(QEvent *e) override;
50
51
private
:
52
enum
CompletionState { NoError, ErrorDetected, WriteDisabled };
53
54
template
<
typename
... Args>
55
inline
void
writeImpl(Args... args);
56
57
void
startAsyncWriteHelper(QMutexLocker<QMutex> *locker);
58
void
startAsyncWriteLocked();
59
static
void
CALLBACK waitCallback(PTP_CALLBACK_INSTANCE instance, PVOID context,
60
PTP_WAIT wait, TP_WAIT_RESULT waitResult);
61
bool
writeCompleted(DWORD errorCode, DWORD numberOfBytesWritten);
62
void
notifyCompleted(QMutexLocker<QMutex> *locker);
63
bool
consumePendingAndEmit(
bool
allowWinActPosting);
64
65
HANDLE handle;
66
HANDLE eventHandle;
67
HANDLE syncHandle;
68
PTP_WAIT waitObject;
69
OVERLAPPED overlapped;
70
QRingBuffer writeBuffer;
71
qint64 pendingBytesWrittenValue;
72
mutable
QMutex mutex;
73
DWORD lastError;
74
75
CompletionState completionState;
76
bool
stopped;
77
bool
writeSequenceStarted;
78
bool
bytesWrittenPending;
79
bool
winEventActPosted;
80
};
81
82
QT_END_NAMESPACE
83
84
#
endif
// QWINDOWSPIPEWRITER_P_H
QWindowsPipeReader
\inmodule QtCore
Definition
qwindowspipereader_p.h:29
QWindowsPipeWriter
Definition
qwindowspipewriter_p.h:29
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
KillProcessExitCode
QT_BEGIN_NAMESPACE constexpr UINT KillProcessExitCode
Definition
qprocess_win.cpp:32
qtbase
src
corelib
io
qwindowspipewriter_p.h
Generated on
for Qt by
1.18.0