summaryrefslogtreecommitdiff
path: root/src/serialport/doc
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2013-11-18 19:45:16 +0400
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-18 19:57:52 +0100
commit4e15aa6d7c4f9a03f4ae57b3ba04ade3400cccf1 (patch)
tree3d64db9afdb46c9e5ee54a3ff8ca98bdd7127ab8 /src/serialport/doc
parentd9725b249de5a2a6bb45e4f4e1a1b316d91ed102 (diff)
downloadqtserialport-4e15aa6d7c4f9a03f4ae57b3ba04ade3400cccf1.tar.gz
Use the signals/slots for internal events handling on Windows
The principal idea of this patch - to simplify a code and to minimize risks of UB in operation with the notifiers. Details are below: 1) Use a separate instances for the each notifier. It allows to get rid from an lookupXX() methods because now we always know which of notifiers was triggered. 2) Now each notifier is created once and used during serial port life. Moreover now in the open() and the close() methods are carried out a simply enabling and disabling of the notifiers. It allows to simplify code and to reduce overhead costs of check of a validity of the notifier pointers. 3) Use the signals/slots mechanism for the internal events handling. Use a slots excludes any UB in the notifier handlers because now isn't present a deep callbacks and so on. Even if some notifier will be deleted, we never got a crash at processing of triggered handle, we can just got an some error code and handle it. 4) There is no more need for existence of separate classes of notifiers which were inherited from the QWinEventNotifier. Now, the objects of QWinEventNotifier are use directly, only for delivery a triggered events to the appropriate slots. All logic of a events handling are in the _q_xx() slots. 5) The overlappedPointer() methods aren't necessary to us anymore. Now we know each OVERLAPPAD structure instance. It gives us to pass a pointers of these structures directly to the ReadFile/WriteFile/WaitCommEvent functions and have direct access to the hEvent field for the waitForXXX() methods. 6) The errors handling inside of the _q_xx() handlers are simplified. Now is not used a dptr-pointer to the QSerialPortPrivate class. So, earlier entered additional method QSerialPortPrivate::setError() is removed. This patch with using of slots is a strategic step because in the future in case of fix of a bug QTBUG-34946 instead of the QWinEventNotifier it is necessary to use the QWinOverlappedIoNotifier which provides only the signal/slot API. Note: Also this patch implicitly fix a bug QTBUG-33938. Task-number: QTBUG-33938 Change-Id: Iba9137e13e0bd6001c665434698b8cd965bc36e5 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'src/serialport/doc')
0 files changed, 0 insertions, 0 deletions