#include "TFriendProxy.h"
#include "TTree.h"
#include "TList.h"
#include "TFriendElement.h"
ClassImp(ROOT::TFriendProxy);
namespace ROOT {
TFriendProxy::TFriendProxy() : fDirector(0,-1), fIndex(-1)
{
}
TFriendProxy::TFriendProxy(TBranchProxyDirector *director, TTree *main, Int_t index) :
fDirector(0,-1), fIndex(index)
{
if (main) {
TObject *obj = main->GetListOfFriends()->At(fIndex);
TFriendElement *element = dynamic_cast<TFriendElement*>( obj );
if (element) fDirector.SetTree(element->GetTree());
}
director->Attach(this);
}
Long64_t TFriendProxy::GetReadEntry() const
{
return fDirector.GetReadEntry();
}
void TFriendProxy::ResetReadEntry()
{
if (fDirector.GetTree()) fDirector.SetReadEntry(fDirector.GetTree()->GetReadEntry());
}
void TFriendProxy::Update(TTree *newmain)
{
if (newmain) {
TObject *obj = newmain->GetListOfFriends()->At(fIndex);
TFriendElement *element = dynamic_cast<TFriendElement*>( obj );
if (element) fDirector.SetTree(element->GetTree());
else fDirector.SetTree(0);
} else {
fDirector.SetTree(0);
}
}
}
Last change: Wed Jun 25 08:31:04 2008
Last generated: 2008-06-25 08:31
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.