From 1c0494e63b2750bc4de61ff6f3f07f2d3cab2dbd Mon Sep 17 00:00:00 2001 From: Alex Trotsenko Date: Fri, 24 Apr 2015 19:02:02 +0300 Subject: 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 Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qiodevice.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/corelib/io/qiodevice.h') 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 -- cgit v1.2.3