41 if (evtsource==
fxSource)
return kTRUE;
79 gROOT->GetListOfCleanups()->Add(
this);
87 gROOT->GetListOfCleanups()->Add(
this);
98 gROOT->GetListOfCleanups()->Remove(
this);
113 if ((pathname!=0) && (*pathname!=0))
119 if (obj==0)
return 0;
124 if (canrename && (strcmp(obj->GetName(),slot->GetName())!=0)) {
125 TNamed* n =
dynamic_cast<TNamed*
> (obj);
126 if (n!=0) n->SetName(slot->GetName());
137 AddDir(pathname, TFile::Open(filename), kTRUE, kTRUE);
144 for(
int n=slot->
NumChilds()-1;n>=0;n--) {
158 const char* name = (dir->InheritsFrom(TFile::Class())) ?
159 gSystem->BaseName(dir->GetName()) : dir->GetName();
201 TString name(pathname);
202 if (name.Length()>0) name+=
"/root";
206 slot->SetTitle(
"ROOT folders");
228 return slot==0 ? 0 : slot->
GetProxy();
235 if (folder==0)
return 0;
237 return new TGo4Slot(folder, name, title);
243 extraname.Form(
"%s_v%d", name, cycle++);
244 }
while (folder->
FindChild(extraname.Data())!=0);
246 return new TGo4Slot(folder, extraname.Data(), title);
252 if (source==0)
return 0;
261 for(Int_t indx=
fLinks.GetLast(); indx>=0; indx--) {
263 if (link==0)
continue;
265 TString namesrc, nametgt;
280 if (source==0)
return 0;
303 dynamic_cast<TGo4LinkProxy*> (link->
GetProxy());
305 return (linkcont!=0) ? linkcont->
GetLink() : 0;
321 Bool_t docompress = kFALSE;
322 for (Int_t n=0;n<=
fLinks.GetLast();n++) {
336 if (source==0)
return;
338 for(Int_t indx=
fLinks.GetLast(); indx>=0; indx--) {
340 if (link==0)
continue;
346 Info(
"RetranslateEvent",
"src = %p %s tgt = %p %s id = %d", source, source->
GetFullName().Data(), target, target->
GetFullName().Data(), id);
348 target->
Event(source,
id, param);
356 Info(
"Event",
"src %s id %d", source->
GetFullName().Data(), id);
370 Bool_t usefile = (f!=0);
372 TDirectory* olddir = gDirectory;
374 TDirectory* curdir = f;
376 if (startslot==0) startslot =
this;
380 bool isxml = (f!=0) && f->InheritsFrom(
"TXMLFile");
382 while (iter.
next()) {
384 if (usefile && !isxml) {
387 while ((levelchange++<0) && (curdir!=0)) {
388 curdir =
dynamic_cast<TDirectory*
> (curdir->GetMother());
390 if (curdir==0)
break;
393 curdir = curdir->mkdir(iter.
getname(),
"subdirectory");
395 if (curdir==0)
break;
403 if (olddir!=0) olddir->cd();
408 Bool_t usefile = (f!=0);
410 TDirectory* olddir = gDirectory;
412 TDirectory* curdir = f;
416 while (iter.
next()) {
419 while ((levelchange++<0) && (curdir!=0))
420 curdir =
dynamic_cast<TDirectory*
> (curdir->GetMother());
421 if (curdir==0)
break;
423 curdir->GetObject(iter.
getname(), curdir);
424 if (curdir==0)
break;
432 if (olddir!=0) olddir->cd();
439 obj->SetBit(kMustCleanup);
444 Bool_t compress = kFALSE;
445 for(
int indx=
fCleanups.GetLast();indx>=0;indx--) {
447 if (entry->
GetSlot()!=slot)
continue;
448 if ((obj==0) || (entry->
GetObject()==obj)) {
460 if ((obj==0) || (obj==
this))
return;
462 Bool_t compress = kFALSE;
463 for(
int indx=
fCleanups.GetLast();indx>=0;indx--) {
465 if (entry==0)
continue;
484 while (iter.
next()) {
486 printf(
"%*c%s\n", (iter.
level()+1)*2,
' ', iter.
getname());
497 while (iter.
next()) cnt++;
504 if (slot!=0)
delete slot;
513 if (tgtslot==0)
return 0;
516 if (proxy==0)
return 0;
525 if (res<2)
delete proxy;
527 if ((res==2) && (waittime_millisec>0)) {
529 gSystem->ProcessEvents();
531 while ((tgtslot->
GetAssignFlag()<0) && (waittime_millisec>0)) {
533 waittime_millisec-=10;
534 gSystem->ProcessEvents();
547 if (tgtslot!=0) res = tgtslot->
AssignObject(obj, ownership);
548 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)