Hi Rooters,
If I have class Aclass used by external application and I do not want to
do ANY changement in this class, but I'd like to make it's memebers and
functions visible to Root system (for storage and analisys purpose)
inheriting new Bclass as following:
class Bclass
:public TObject
,public Aclass
Is it possible?
I investigate that without including macros ClassDef(Aclass,1) into the
body of Aclass rootcint do not generate Streamer() and
ShowMembers() functions. Just mentioning of Aclass in LinkDef.h do not
helps.
So it seems that the answer is NOT: it is not possible to make the members
of classA visible to Root without changements of classA body.
But the same question was asqued at least twice:
http://root.cern.ch/root/roottalk/roottalk98/1986.html
http://root.cern.ch/root/roottalk/roottalk98/0107.html
and in both cases the answers were a bit confusing but positive.
Why do not find the definite answer and add it to FAQ?
I used for tests:
----------------test.h------------
#include "TObject.h"
class Aclass
{
private:
int a_member;
public:
Aclass(){}
virtual ~Aclass(){}
// ClassDef(Aclass,1) // if this line commented - a_member is hidden from root
};
class Bclass
:public TObject
,public Aclass
{
private:
int b_member;
public:
Bclass():Aclass(){}
virtual ~Bclass(){}
ClassDef(Bclass,1)
};
-----------------------------------
---------LinkDef.h----------------------
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class Aclass;
#pragma link C++ class Bclass;
#endif
---------------------------------------
Without the commented line command
> rootcint -f test_h.C -c test.h LinkDef.h
do not care about members of Aclass.
Best regards
Valeri
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:18 MET