42 if (evtsource==
fxSource)
return kTRUE;
80 gROOT->GetListOfCleanups()->Add(
this);
88 gROOT->GetListOfCleanups()->Add(
this);
99 gROOT->GetListOfCleanups()->Remove(
this);
114 if ((pathname!=0) && (*pathname!=0))
120 if (obj==0)
return 0;
125 if (canrename && (strcmp(obj->GetName(),slot->GetName())!=0)) {
126 TNamed* n =
dynamic_cast<TNamed*
> (obj);
127 if (n!=0) n->SetName(slot->GetName());
138 AddDir(pathname, TFile::Open(filename), kTRUE, kTRUE);
145 for(
int n=slot->
NumChilds()-1;n>=0;n--) {
159 const char* name = (dir->InheritsFrom(TFile::Class())) ?
160 gSystem->BaseName(dir->GetName()) : dir->GetName();
202 TString name(pathname);
203 if (name.Length()>0) name+=
"/root";
207 slot->SetTitle(
"ROOT folders");
229 return slot==0 ? 0 : slot->
GetProxy();
236 if (folder==0)
return 0;
238 return new TGo4Slot(folder, name, title);
244 extraname.Form(
"%s_v%d", name, cycle++);
245 }
while (folder->
FindChild(extraname.Data())!=0);
247 return new TGo4Slot(folder, extraname.Data(), title);
253 if (source==0)
return 0;
262 for(Int_t indx=
fLinks.GetLast(); indx>=0; indx--) {
264 if (link==0)
continue;
266 TString namesrc, nametgt;
281 if (source==0)
return 0;
304 dynamic_cast<TGo4LinkProxy*> (link->
GetProxy());
306 return (linkcont!=0) ? linkcont->
GetLink() : 0;
322 Bool_t docompress = kFALSE;
323 for (Int_t n=0;n<=
fLinks.GetLast();n++) {
337 if (source==0)
return;
339 for(Int_t indx=
fLinks.GetLast(); indx>=0; indx--) {
341 if (link==0)
continue;
347 Info(
"RetranslateEvent",
"src = %p %s tgt = %p %s id = %d", source, source->
GetFullName().Data(), target, target->
GetFullName().Data(), id);
349 target->
Event(source,
id, param);
357 Info(
"Event",
"src %s id %d", source->
GetFullName().Data(), id);
371 Bool_t usefile = (f!=0);
373 TDirectory* olddir = gDirectory;
375 TDirectory* curdir = f;
377 if (startslot==0) startslot =
this;
381 bool isxml = (f!=0) && f->InheritsFrom(
"TXMLFile");
383 while (iter.
next()) {
385 if (usefile && !isxml) {
388 while ((levelchange++<0) && (curdir!=0)) {
389 curdir =
dynamic_cast<TDirectory*
> (curdir->GetMother());
391 if (curdir==0)
break;
394 curdir = curdir->mkdir(iter.
getname(),
"subdirectory");
396 if (curdir==0)
break;
404 if (olddir!=0) olddir->cd();
409 Bool_t usefile = (f!=0);
411 TDirectory* olddir = gDirectory;
413 TDirectory* curdir = f;
417 while (iter.
next()) {
420 while ((levelchange++<0) && (curdir!=0))
421 curdir =
dynamic_cast<TDirectory*
> (curdir->GetMother());
422 if (curdir==0)
break;
424 curdir->GetObject(iter.
getname(), curdir);
425 if (curdir==0)
break;
433 if (olddir!=0) olddir->cd();
440 obj->SetBit(kMustCleanup);
445 Bool_t compress = kFALSE;
446 for(
int indx=
fCleanups.GetLast();indx>=0;indx--) {
448 if (entry->
GetSlot()!=slot)
continue;
449 if ((obj==0) || (entry->
GetObject()==obj)) {
461 if ((obj==0) || (obj==
this))
return;
463 Bool_t compress = kFALSE;
464 for(
int indx=
fCleanups.GetLast();indx>=0;indx--) {
466 if (entry==0)
continue;
485 while (iter.
next()) {
487 printf(
"%*c%s\n", (iter.
level()+1)*2,
' ', iter.
getname());
498 while (iter.
next()) cnt++;
505 if (slot!=0)
delete slot;
514 if (tgtslot==0)
return 0;
517 if (proxy==0)
return 0;
526 if (res<2)
delete proxy;
528 if ((res==2) && (waittime_millisec>0)) {
530 gSystem->ProcessEvents();
532 while ((tgtslot->
GetAssignFlag()<0) && (waittime_millisec>0)) {
534 waittime_millisec-=10;
535 gSystem->ProcessEvents();
548 if (tgtslot!=0) res = tgtslot->
AssignObject(obj, ownership);
549 else if (ownership)
delete obj;
TGo4ObjManCleanup(TObject *obj, TGo4Slot *slot)
Int_t GetAssignFlag() const
void SaveData(TDirectory *dir, Bool_t onlyobjs=kFALSE)
void UnregisterObject(TObject *obj, TGo4Slot *slot)
TObject * GetObject() const
void SetProxy(TGo4Proxy *cont)
virtual ~TGo4ObjectManager()
Int_t RequestObject(const char *source, const char *targetslot, Int_t waittime_millisec=0)
void AddFile(const char *pathname, const char *filename)
void UnregisterLink(TGo4Slot *target)
TGo4Proxy * GetProxy() const
virtual void ProduceFullName(TString &name, TGo4Slot *toparent=0)
void MakeFolder(const char *pathname)
void AddROOTFolder(const char *pathname, const char *foldername)
TGo4Slot * getslot() const
TGo4Slot * GetTarget() const
void RegisterLink(TGo4Slot *source, TGo4Slot *target, Bool_t exapndchilds=kFALSE)
void DeleteChilds(const char *startedwith=0)
void RetranslateEvent(TGo4Slot *source, Int_t id, void *param=0)
virtual TGo4ObjectManager * GetOM() const
void RegisterObjectWith(TObject *obj, TGo4Slot *slot)
virtual void Event(TGo4Slot *source, Int_t id, void *param=0)
void DeleteSlot(const char *pathname)
void AddFolder(const char *pathname, TFolder *folder, Bool_t owner=kFALSE)
virtual void ProduceFullName(TString &name, TGo4Slot *toparent=0)
static TFolder * LocateROOTFolder(const char *rootfolder)
virtual void RecursiveRemove(TObject *obj)
Bool_t IsParent(const TGo4Slot *slot) const
TGo4Slot * FindChild(const char *name)
TGo4Slot * MakeObjSlot(const char *foldername, const char *name=0, const char *title=0)
TGo4ObjManLink(TGo4Slot *source, TGo4Slot *target, Bool_t expandchilds)
virtual TClass * GetObjectClass() const
TGo4Slot * GetSlot(const char *name, Bool_t force=kFALSE)
void AddTree(const char *pathname, TTree *tree, Bool_t owner=kFALSE)
void SaveDataToFile(TFile *f, Bool_t onlyobjs=kFALSE, TGo4Slot *startslot=0)
void AddROOTFolders(const char *pathname, Bool_t selected=kTRUE)
virtual Bool_t AssignObject(const char *path, TObject *obj, Bool_t ownership)
TGo4Slot * GetSlot() const
void AddDir(const char *pathname, TDirectory *dir, Bool_t owner=kFALSE, Bool_t readright=kFALSE)
Bool_t CheckEventSource(const TGo4Slot *evtsource)
virtual Int_t AssignObjectTo(TGo4ObjectManager *rcv, const char *path)
void AddProxy(const char *pathname, TGo4Proxy *cont, const char *name, const char *title="title")
void ReadData(TDirectory *dir)
virtual void Event(TGo4Slot *source, Int_t id, void *param=0)
void CloseFiles(const char *pathname)
virtual void RecursiveRemove(TObject *obj)
TGo4Slot * GetLink() const
void ForwardEvent(TGo4Slot *source, Int_t id, void *param=0)
Int_t levelchange() const
TGo4Slot * GetSource() const
Bool_t AssignObject(TObject *obj, Bool_t owner)
TString GetFullName(TGo4Slot *toparent=0)
TGo4Slot * GetLinked(TGo4Slot *link)
Bool_t DoChildsExpand() const
TGo4Access * ProvideSlotAccess(const char *name)
TGo4Slot * GetChild(Int_t n) const
void RemoveFromLinks(const TGo4Slot *slot)
TObjArray fCleanups
list of links between slots
TGo4Slot * Add(const char *pathname, TObject *obj, Bool_t owner=kFALSE, Bool_t canrename=kFALSE)
void ReadDataFromFile(TFile *f)
TGo4Slot * AddLink(TGo4Slot *source, const char *pathname, const char *linkname, const char *linktitle)
Bool_t next(Bool_t goesinto=kTRUE)