[webkit-efl] Use of pimpl idiom for Ewk classes
mikhail.pozdnyakov at intel.com
Thu Oct 18 11:04:05 PDT 2012
Pimpl has its advantages, however think we should come up to the solution where all the object functionality is encapsulated
in one C++ class exposing both private and public interfaces and C API functions are just
wrapping around class methods. Think it is simpler and looks more natural.
So approach #2 I guess..
From: webkit-efl-bounces at lists.webkit.org [webkit-efl-bounces at lists.webkit.org] on behalf of Dumez, Christophe [christophe.dumez at intel.com]
Sent: Thursday, October 18, 2012 7:27 PM
To: Thiago Marcos P. Santos
Cc: webkit-efl at lists.webkit.org; Christiansen, Kenneth R
Subject: Re: [webkit-efl] Use of pimpl idiom for Ewk classes
I have updated the Ewk_Download class based on the alternative mentioned by Thiago and updated a patch here for comparison:
(pimpl patch is still at https://bugs.webkit.org/attachment.cgi?id=169402&action=prettypatch)
One possible issue that I noticed with this approach is that we need to use "const char*" instead of "String" type in our C++ methods API due to Eina string sharing. This is a bit unfortunate since C++ code uses String type in WebKit.
As I said in my previous email, we also need to write a lot more C++ methods than with the pimpl approach. It will be a lot more work to refactor all Ewk classes.
This approach however has the benefit of being of simpler design (no macros, C++ methods can access members directly without dereferencing a pointer).
I'm personally open to both approaches so I'd like to hear others' opinion.
Linux Software Engineer, PhD
Intel Finland Oy - Open Source Technology Center
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki
Business Identity Code: 0357606 - 4
Domiciled in Helsinki
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
More information about the webkit-efl