[Interest] Advice on QSharedPointer versus QExplicitlySharedDataPointer

Michael Jackson imikejackson at gmail.com
Fri Jul 19 21:01:42 CEST 2013


Hello List.
   We have a code based that I would like to rewrite parts of in order to get rid of some historical code that does not really help much any more but which may be holding us back in development. The basics of our code base is that we create "Filters", put the into a "Pipeline" container then execute the pipeline. Currently each Filter subclasses from one of our base classes and we implement some typedefs and static functions so that we are always working with a boost/shared_ptr<Filter>. That way we always know that we are dealing with the same instance of the object since we are passing the pointer around all the time. And those pointers are reference counted so they automatically clean themselves up during execution. This all works really well but during our latest design meetings we would like to get rid of some home built base libraries and replace them with QtCore instead. We only use Qt for the GUI side of the program and I think we are really losing out not using Qt for everything from bottom to top.

  In the design meetings we also started exploring the idea of whether we should just replace the Boost/SharedPointer with QSharedPointer or possibly move to the design pattern that Qt uses with its implicitly and explicitly shared data pointers for each class. I like the idea that the private implementation could be changed out if needed for different circumstances. I have been reading up on the PIMPL design pattern to get a better idea of the pros and cons of both of the approaches we are considering. 

I would be interested in the "Qt Pros" thoughts on either pattern, both good and bad.

Thanks
--
Mike Jackson
imikejackson & gmail * com




More information about the Interest mailing list