Hello rooters,
I want to order some objects in a list, like:
TList *list = new TList;
TEllipse *ell = new TEllipse;
TLine *lin = new TLine;
list->Add(ell);
list->Add(lin);
Now I want to write this list of objects to a root file, like:
TFile f1("test.root", "RECREATE");
TTree *t = new TTree("List", "My List");
t->Branch("TList", "TList", &list, 32000, 9);
t->Fill();
f1.Write();
f1.Close();
And read the list again, like:
TFile f2("test.root", "READ");
t = (TTree*)f2.Get("List");
t->GetBranch("TList")->SetAddress(&list);
t->GetEntry(0);
list->Print();
But this fails (as I understand, because of ClassDef(TSeqCollection,
0)). Is there a way to write such a list and get it back as one entry?
The idea is to have a list which stores several objects describing a
program setup (like the gui elements above, which are describing a
graphical setup). I want to be able to store and read this setup with a
single expression.
Thanks alot,
Thomas.
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:08 MET