On Tue, 15 Jan 2002, Angus Leeming wrote: > On Tuesday 15 January 2002 6:37 pm, Angus Leeming wrote: > > Here's a second question. Many of the other controllers (15 in fact) are > > derived from ControlDialog, so again I'll split ControlDialog.h into > > ControlDialog.h and ControlDialog.tmpl > > > > However, there are only two instatiations of ControlDialog: > > ControlDialog<ControlConnectBD> > > ControlDialog<ControlConnectBI> > > > > is there a way therefore of changing something in ControlDialog.tmpl that > > results in only two recompiles? Ie, rather than #include > "ControlDialog.tmpl" > > in all 15 files of the derived classes, I'd like to create > > ControlDialog<ControlConnectBD> and ControlDialog<ControlConnectBI> > > > > Can this be done? If so, how? > > answering my own question: > > file "ControlDialogImpl.h" > class ControlConnectBD; > class ControlConnectBI; > > struct ControlDialogBD : public ControlDialog<ControlConnectBD> > { > ControlDialogBD(); > }; > struct ControlDialogBI : public ControlDialog<ControlConnectBD> > { > ControlDialogBI(); > }; > > file "ControlDialogImpl.C" > #include "ControlDialogImpl.h" > #include "ControlDialog.tmpl" > > ControlDialogBD::ControlDialogBD() > : ControlDialog<ControlConnectBD> > {} > > ControlDialogBI::ControlDialogBI() > : ControlDialog<ControlConnectBD> > {} > > Derive the 15 classes from ControlDialogBD and ControlConnectBI. These, > therefore need #include that .h file. > Create the two instatiations by compiling the ControlDialogImpl.C file. > > Bingo! > > But are you happy with this?
Maybe ControlDialog_impl.[Ch] instead (like a _pimpl only different). Secondly, I think we should wait with this change (the other is probably okay) until after 1.2.0 and we've have time to discuss reorganizing the GUII hierarchy. We may well do something like this then anyway. Take a few minutes to draw out the GUII hierarchy (or work from doxygen) and you'll see it is a great big long thin vine. It is possible to rearrange this into a broad flat tree -- fewer intervening classes needing recompiles. Allan. (ARRae)