user defined class type data member

From: Chiara Zampolli <Chiara.Zampolli_at_bo.infn.it>
Date: Thu, 24 Nov 2005 16:58:12 +0100


Dear rooters,  

    I do not know if this is possible or not, but I would like to create a class where the type of a data member is "user defined". In other words, let AliTOFClass be a class with a data member which should be first an array of AliTOFCalChannel elements, and then an array of AliTOFCalSimul elements,  

class AliTOFClass: public TObject{  

..
..
 

private:  

XXX *fArray; \\fsize  

ClassDef(AliTOFClass,1);
}  

where XXX should once be AliTOFCalChannel, and then AliTOFCalSimul. How can I do that? It is very similar to what you do with TClonesArray, where you define the type of elements of the TClonesArray while creating it. I've had a look at the code of the TClonesArray, but it seems too much complicated for my case.
This is just to avoid duplicating the class AliTOFClass (the features of which I want to be kept) with first the data member fArray being of type AliTOFCalChannel, and then of type AliTOFCalSimul. I could do that, but, I don't know, perhaps it is not the ideal solution.  

Thank you in advance.
Chiara Received on Thu Nov 24 2005 - 16:55:07 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:13 MET