On Jan 22, 2014, at 6:44 AM, Derek Atkins <[email protected]> wrote: > John Ralls <[email protected]> writes: > >> One other thing: I’m inclined to write any class that contributes to >> the engine’s public API (which I intend should be much smaller than it >> is now) to use PImpl; the pointer class will be passed as a shared_ptr >> (i.e., reference counted like GObjects are supposed to be but mostly >> aren’t in GnuCash) holding a unique_ptr to the private implementation >> object. Do you have any thoughts about that? > > I'm not 100% sure what "PImpl" is per-se.. But I'm fine with using > shared_ptr<> for all object-passing/storage. I was imaginging that we > would use real C++ class inheritence for the core object classes > themselves. For example I would have implemented a QofQueriable > interface (virtual abstract) class and had all objects inherit from > that.
PImpl, which decomposes as either "Private Implementation" or "Pointer to Implementation" is a basic C++ idiom. Here's Herb Sutter's explanation: http://herbsutter.com/gotw/_100/ Regards, John Ralls _______________________________________________ gnucash-devel mailing list [email protected] https://lists.gnucash.org/mailman/listinfo/gnucash-devel
