summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qiodevice.h
diff options
context:
space:
mode:
authorAlex Trotsenko <alex1973tr@gmail.com>2015-04-24 19:02:02 +0300
committerAlex Trotsenko <alex1973tr@gmail.com>2016-01-27 06:32:30 +0000
commit1c0494e63b2750bc4de61ff6f3f07f2d3cab2dbd (patch)
treef0c83d153e17a29f682fc7372fdfc3b9acc160ea /src/corelib/io/qiodevice.h
parentacbd79996d7dedd65cda98bd1b0f15690f0271e4 (diff)
QIODevice: add infrastructure for multistreaming
Some sequential devices allow data to be partitioned into several channels that have the property of independently sequenced delivery. Supporting such devices uniformly requires a unified API which provides the user with a uniform concept of multistreaming. This patch is based on QProcess's multiplexing model and introduces the following features: - ability to get the number of channels; - multiple internal read/write buffers; - channel selection functions; - notification signals on channel activity. To keep the source code compatible with single-channel implementations, introduce a private class that references the current read buffer and hides multistreaming internals from the user. Bump the TypeInformationVersion field in qtHookData, to notify the Qt Creator developers that the offset of QFilePrivate::fileName was changed and dumpers should be adapted. [ChangeLog][QtCore] Added multistreaming to QIODevice. Change-Id: Idcaa6a618927c101c4c7284d2a633913be6a6ee2 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'src/corelib/io/qiodevice.h')
-rw-r--r--src/corelib/io/qiodevice.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/corelib/io/qiodevice.h b/src/corelib/io/qiodevice.h
index 7840b8500c..162480d22f 100644
--- a/src/corelib/io/qiodevice.h
+++ b/src/corelib/io/qiodevice.h
@@ -96,6 +96,13 @@ public:
bool isWritable() const;
virtual bool isSequential() const;
+ int readChannelCount() const;
+ int writeChannelCount() const;
+ int currentReadChannel() const;
+ void setCurrentReadChannel(int channel);
+ int currentWriteChannel() const;
+ void setCurrentWriteChannel(int channel);
+
virtual bool open(OpenMode mode);
virtual void close();
@@ -142,7 +149,9 @@ public:
#ifndef QT_NO_QOBJECT
Q_SIGNALS:
void readyRead();
+ void channelReadyRead(int channel);
void bytesWritten(qint64 bytes);
+ void channelBytesWritten(int channel, qint64 bytes);
void aboutToClose();
void readChannelFinished();
#endif