C++ design pattern help; Abstract classes with private access?
<p>I have a couple of 'strongly interdependent' class in C++ in a lib I'm writing. The first class is the "DataSet" and like its namesake, manages data. The second class is the "Renderer" and draws the data in DataSet. Both classes are abstract. Here's the 'flow' I want between the two classes:</p>

<ul>
<li><p>An application creates implemented DataSet objects (DataSetImpA,B,C) and passes them to the implemented Renderer (RendererImp). </p></li>
<li><p>The application tells the Renderer where its camera is pointing. </p></li>
<li><p>The Renderer calls a private 'update' method on each DataSet with the camera parameters so that the DataSets prepare all the relavent objects.</p></li>
<li><p>The Renderer calls a private 'get' method to retrieve the newly prepared objects.</p></li>
<li><p>The Renderer occasionally calls a private 'clear' method to destroy the DataSet's objects.</p></li>
</ul>

<p>The 'update', 'get' and 'clear' methods would be pure virtual functions in DataSet. Friend classes don't work here because I want the implementation to be open and extensible for someone using the lib; expecting someone to write "friend class x"  when 'class x' varies based on the implementation to be used is bad.</p>

<p>Could someone suggest a method/design pattern to implement something like the above? Feel free to suggest a different way of doing things as well</p>
