------=_NextPart_000_000B_01BD5E54.AC7EB210
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hello,
Is is possible to have a class (say X) inherit TDirectory and still be =
accessible as its class type (X) with TDirectory functionality when =
written to a TFile? I'm finding that once I close and reopen the file, =
the Class X object is gone and only the TDirectory portion remains. How =
should I approach this problem?
// example
//___________________
class X : public TDirectory
{
public:
X() : TDirectory();
X(Text_t *name, Text_t *title) : TDirectory(name, title);
virtual ~X();
void Hi();
ClassDef(X,1);
} =20
//____________________
void X::Hi() { printf("hello to you too\n"); }
//___________________
the current keyboard layout is 437
*******************************************
* *
* W E L C O M E to R O O T *
* *
* Version 1.03/09 16 December 1997 *
* *
* You are welcome to visit our Web site *
* http://root.cern.ch *
* *
*******************************************
CINT/ROOT C/C++ Interpreter version 5.13.36, Nov 30 1997
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] f =3D new TFile("e:/data/g2trace;3.root","recreate");
root[1] X *x =3D new X("myx","my X class");
root[2] f.ls()
TFile** e:/data/g2trace;3.root
TFile* e:/data/g2trace;3.root
X* myx my X class
KEY: TDirectory myx;1 myx
root[3] x.Write();
root[4] f.Write();
TFile Writing Name=3De:/data/g2trace;3.root Title=3D
root[5] .q
//__________________________________
the current keyboard layout is 437
*******************************************
* *
* W E L C O M E to R O O T *
* *
* Version 1.03/09 16 December 1997 *
* *
* You are welcome to visit our Web site *
* http://root.cern.ch *
* *
*******************************************
=20
CINT/ROOT C/C++ Interpreter version 5.13.36, Nov 30 1997
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] f =3D new TFile("e:/data/g2trace;3.root","update");
root[1] f.ls();
TFile** e:/data/g2trace;3.root
TFile* e:/data/g2trace;3.root
KEY: TDirectory myx;1 myx
root[2] myx.Hi();
Error: No symbol myx.Hi() in current scope FILE:D:\TEMP\466 LINE:1
*** Interpreter error recovered ***
William J Deninger
deninger@uiuc.edu
------=_NextPart_000_000B_01BD5E54.AC7EB210
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">