From: Christian Holm Christensen (cholm@hehi03.nbi.dk)
Date: Wed Mar 26 2003 - 15:25:39 EST
Hi Claus, "Claus O. E. Jorgensen" <ekman@nbi.dk> wrote concerning RICH in brag [Wed, 26 Mar 2003 20:32:53 +0100 (MET)] ---------------------------------------------------------------------- > The next step is to write the dig module, but that should be easy > since most of the methods are very similar to what's in the C1 dig > module. The definition and reflection on the mirror will be > identically to the code in BrRichPidModule. I think a rearrangement > of the method is needed to avoid duplicates of code. I'll think > about how to do this. That's easy: Make a common base class, say BrRichTracking _that_does_not_inherit_from_TObject_ (directly or indirectly), and put the common code into members (data _and_ function) of that class, and let both the Dig and Rdo classes derive from that class, along with the derivation from BrModule: class BrRichTracking { private: // Common data members ... public: // Common function members ... void CommonFunction() }; class BrRichDigModule : public BrModule, public BrRichTracking { ... void Event(BrEventNode* in, BrEventNode* out) { ... CommonFunction(); ... } } class BrRichRdoModule : public BrModule, public BrRichTracking { ... void Event(BrEventNode* in, BrEventNode* out) { ... CommonFunction(); ... } } Take a look at the BrMult[Si|Tile]RdoModule for an example of this. BTW. If template support was better in CINT, this should really be done using a Policy pattern. Yours, ___ | Christian Holm Christensen |_| | ------------------------------------------------------------- | | Address: Sankt Hansgade 23, 1. th. Phone: (+45) 35 35 96 91 _| DK-2200 Copenhagen N Cell: (+45) 24 61 85 91 _| Denmark Office: (+45) 353 25 305 ____| Email: cholm@nbi.dk Web: www.nbi.dk/~cholm | |
This archive was generated by hypermail 2.1.5 : Wed Mar 26 2003 - 15:26:32 EST