Hello!
I have a dilemma when creating cross-platform library for Qt.
Library combines pieces of code from different OS (eg, Windows, Linux).
The implementation and structure of classes in a library made in the "Qt Pimpl" style.
BUT! This style can also be implemented in two variants:
1. This is a "simple", without hiding the scope of the platform-dependent data types and constants
(eg, HANDLE, termious, etc.).
An example of this approach is Qt: QSettings.
2. This is a "complex", with hiding the scope of a private helper class such as "engine".
An example of this in Qt are: QFile, QAbstractSocket.
I attached the enclosure to test projects (currently only for Windows)
"scope_bad" and "scope_ok" which showcased two of these approaches:
scope_bad - no hidden type HANDLE in the base class implementation.
scope_ok - with a hidden type HANDLE in the base class implementation.
Please Voice your opinion on the feasibility of these two approaches.
PS: I'm more inclined to approach through the hide of scope.
Bookmarks