Hi Pat, Yes it should work as long as you generated the dictionary for MyC++Class and all its dependencies (base class, content) with the '+' options as in: #pragma link C++ class MyClass+; Actually (unless you want to store them in a TClonesArray) you can store objects of type MyC++Class directly in a tree. Cheers, Philippe. -----Original Message----- From: owner-roottalk@pcroot.cern.ch [mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Patrick Murray Sent: Tuesday, April 22, 2003 5:24 PM To: roottalk@pcroot.cern.ch Subject: Re: [ROOT] Pure C++ into root. Hello Rooter, Will something like this work? I tried it and my tree did not get filled with the inherited data members. Cheers, Pat On Mon, 21 Apr 2003, Patrick Murray wrote: > If I have a class made of a hierarchy of classes in pure C++ (ie no > ClassDef stuff) and I want to put this class into a root tree without > changing the orginal class, can it be done the with inheritance into a > root class (ie with ClassDef). Something like: > > #include "TObject.h" > #include <vector> > #include "MyC++Class.h" > > class RootClass : public MyC++Class > { > public: > RootClas(); > virtual ~RootClass(); > ClassDef(RootClass,1) > }; >
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:11 MET