Re: [ROOT] Deleting friend tree links?

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Sep 16 2002 - 12:19:58 MEST


Hi Ole,

You can remove all friends with:
Base.GetListOfFriends()->Delete();

Rene Brun

On Mon, 16 Sep 2002, Ole Streicher wrote:

> Hi!
> 
> How it is possible to delete a "Friend Tree" from a tree, or to
> disable the storage of the connection between the tree and its
> friends? I use "AddFriend" to enable the share of information between
> independent part of my program
> 
> // This is done in the main frame:
> TFile *BaseFile = new TFile("base.root", "create");
> TTree *Base = new TTree("Base", "The Base");
> 
> TFile *FriendFile = new TFile("friend.root", "create");
> TTree *Friend = new TTree("Friend", "A friend");
> 
> MyClass *MyObj = new MyClass();
> Friend->Branch("MyObj", "MyClass", &MyObj);
> Base.AddFriend(Friend, "Friend");
> 
> // ...
> // this is done somewhere else to retrieve the object MyObj:
> MyClass *MyObj = new MyClass();
> Friend->GetBranch("Friend")->SetAddr(&MyObj);
> 
> // ...
> // Back to main. Write and finish.
> BaseFile.Write(); // Here it writes also the link base->friend.
> FriendFile.Write();
> 
> How can I do that without having that depency in the base file?
> 
> Ole
> 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:09 MET