99 if (gDebug>1) Info(
"~TGo4Slot",
"%p Starting name = %s",
this,
GetFullName().Data());
103 if (gDebug>1) Info(
"~TGo4Slot",
"%p CleanProxy()",
this);
106 if (gDebug>1) Info(
"~TGo4Slot",
"%p Event(this, evDelete)",
this);
109 if (gDebug>1) Info(
"~TGo4Slot",
"%p DeleteChilds()",
this);
112 if (gDebug>1) Info(
"~TGo4Slot",
"%p Detach from parent",
this);
118 if (gDebug>1) Info(
"~TGo4Slot",
"%p fPars.Delete()",
this);
122 if (gDebug>1) Info(
"~TGo4Slot",
"%p Detach rest children",
this);
123 for (Int_t n = 0; n <=
fChilds->GetLast(); n++) {
125 if (!child)
continue;
134 if (gDebug>1) Info(
"~TGo4Slot",
"%p Finish",
this);
182 if (parent==slot)
return kTRUE;
204 UInt_t len = !startedwith ? 0 : strlen(startedwith);
206 for (Int_t n =
NumChilds() - 1; n >= 0; n--) {
208 if (!child)
continue;
210 Bool_t flag = (len == 0) ||
211 ((len<strlen(child->GetName())) &&
212 (strncmp(child->GetName(), startedwith, len) == 0));
228 if (!child)
return -1;
238 if (!child)
return nullptr;
239 for (
int n = 0; n <
NumChilds() - 1; n++)
247 if (!name || !*name)
return nullptr;
249 for (Int_t n = 0; n < num; n++) {
251 if (strcmp(slot->GetName(), name) == 0)
268 if (name.Length() > 0) name +=
"/";
302 const char *contclass =
fProxy ?
fProxy->ClassName() :
nullptr;
304 SetPar(
"::ProxyClass", contclass);
314 const char *info =
nullptr;
316 info =
fProxy->GetContainedObjectInfo();
317 if (!info) info = GetTitle();
325 sz =
fProxy->GetObjectSizeInfo();
336 return fProxy ?
fProxy->GetContainedClassName() :
nullptr;
364 fProxy->Update(
this, strong);
398 return fProxy->ProvideAccess(name);
401 return std::make_unique<TGo4ObjectAccess>(
this);
403 const char *subname =
nullptr;
413 fProxy->WriteData(
this, dir, onlyobjs);
420 const char *contclass =
GetPar(
"::ProxyClass");
421 TClass *cl = !contclass ? nullptr : gROOT->GetClass(contclass);
435 const char *spos = strchr(name,
'/');
437 if (!spos) { len = strlen(name); subname =
nullptr; }
438 else { len = spos-name; subname = spos+1; }
439 UInt_t ulen = (UInt_t) len;
442 for (
int n = 0; n < num; n++) {
444 const char *slotname = slot->GetName();
445 if ((strlen(slotname)==ulen) && (strncmp(slotname, name, len) == 0))
return slot;
453 if (!name || !*name)
return this;
455 const char *subname =
nullptr;
459 if (!subslot && force) {
461 if (!subname) newname = name;
462 else newname.Append(name, subname-name-1);
463 subslot =
new TGo4Slot(
this, newname.Data(),
"folder");
466 return !subslot ? nullptr : subslot->
GetSlot(subname, force);
472 while (fullpath && (strlen(fullpath) > 2)) {
474 if (strncmp(fullpath,
"./", 2) == 0) { fullpath += 2;
continue; }
477 if ((strncmp(fullpath,
"../", 3) == 0) &&
GetParent())
485 if (subname) *subname =
nullptr;
489 const char *curname = fullpath;
493 const char *nextname =
nullptr;
495 if (!nextslot)
break;
500 if (subname) *subname = curname;
508 Int_t indx1 = !before ? -1 :
fChilds->IndexOf(before);
509 Int_t indx2 = !slot ? -1 :
fChilds->IndexOf(slot);
510 if ((indx1 < 0) || (indx2 < 0) || (indx1 > indx2))
return kFALSE;
511 if (indx1 == indx2)
return kTRUE;
513 for (
int n = indx2; n > indx1; n--)
514 (*
fChilds)[n] = (*fChilds)[n - 1];
516 (*fChilds)[indx1] = slot;
524 Int_t indx1 = !slot ? -1 :
fChilds->IndexOf(slot);
525 Int_t indx2 = !after ? -1 :
fChilds->IndexOf(after);
526 if ((indx1<0) || (indx2<0) || (indx1>indx2))
return kFALSE;
528 if (indx1==indx2)
return kTRUE;
530 for (
int n=indx1;n<indx2;n++)
531 (*
fChilds)[n] = (*fChilds)[n+1];
532 (*fChilds)[indx2] = slot;
546 if (!child || !
fChilds)
return;
557 Bool_t doforward = kTRUE;
560 doforward =
fProxy->ProcessEvent(
this, source,
id, param);
574 if (
fProxy->RemoveRegisteredObject(obj))
581 while (iter.
next()) {
588 if (!name || !*name)
return;
591 TNamed *par = (TNamed*)
fPars.FindObject(name);
593 par->SetTitle(value);
595 fPars.Add(
new TNamed(name,value));
602 TNamed *par = (TNamed*)
fPars.FindObject(name);
603 return par ? par->GetTitle() :
nullptr;
608 if (!name || !*name)
return;
609 TNamed *par = (TNamed*)
fPars.FindObject(name);
620 buf.Form(
"%d",value);
626 const char *strvalue =
GetPar(name);
627 if (!strvalue)
return kFALSE;
628 value = atoi(strvalue);
634 for (
int n = 0; n <=
fPars.GetLast(); n++) {
635 TNamed *par = (TNamed*)
fPars.At(n);
637 printf(
"%*c%s = %s\n", level,
' ', par->GetName(), par->GetTitle());
643 return !name ? nullptr : strrchr(name,
'/');
652 objectname = fullname;
654 foldername.Append(fullname, rslash-fullname);
655 objectname = (rslash+1);
Bool_t next(Bool_t goesinto=kTRUE)
virtual void ReadData(TGo4Slot *, TDirectory *)
TGo4Slot * curSlot() const
const char * GetClassName() override
const char * name() override
Bool_t isfolder() override
const char * info() override
TGo4Slot * getslot() override
TGo4SlotIter(const TGo4Slot *slot)
Int_t sizeinfo() override
Bool_t isslotsfolder() override
TGo4LevelIter * subiterator() override
TGo4Slot * GetParent() const
TGo4Slot * DefineSubSlot(const char *name, const char *&subname) const
TString GetFullName(TGo4Slot *toparent=nullptr)
virtual TGo4ObjectManager * GetOM() const
virtual void Update(Bool_t strong=kFALSE)
Bool_t GetIntPar(const char *name, Int_t &value) const
TGo4Slot * FindSlot(const char *fullpath, const char **subname=nullptr)
Bool_t IsParent(const TGo4Slot *slot) const
const char * GetSlotClassName() const
Int_t fAssignCnt
! counts number of object assignment
void RemoveChild(TGo4Slot *child)
Int_t fAssignFlag
! use in object manager to poll until object is assigned
void AddChild(TGo4Slot *child)
Bool_t DoingDelete() const
Int_t GetSlotKind() const
void SetProxy(TGo4Proxy *cont)
TGo4Slot * GetSlot(const char *name, Bool_t force=kFALSE)
void SaveData(TDirectory *dir, Bool_t onlyobjs=kFALSE)
TGo4Slot * FindChild(const char *name) const
TGo4Slot * GetNextChild(const TGo4Slot *child) const
void ForwardEvent(TGo4Slot *source, Int_t id, void *param=nullptr)
void RecursiveRemove(TObject *obj) override
std::unique_ptr< TGo4Access > ProvideSlotAccess(const char *name)
static void ProduceFolderAndName(const char *fullname, TString &foldername, TString &objectname)
static const char * FindFolderSeparator(const char *name)
virtual void ProduceFullName(TString &name, TGo4Slot *toparent=nullptr)
Bool_t AssignObject(TObject *obj, Bool_t owner)
Bool_t ShiftSlotBefore(TGo4Slot *slot, TGo4Slot *before)
void DeleteChilds(const char *startedwith=nullptr)
void SetPar(const char *name, const char *value)
void RemovePar(const char *name)
void SetIntPar(const char *name, Int_t value)
TObject * GetAssignedObject()
const char * GetPar(const char *name) const
TGo4LevelIter * MakeLevelIter() const
void PrintPars(Int_t level=3)
Bool_t HasSlotsSubLevels() const
void ReadData(TDirectory *dir)
Bool_t ShiftSlotAfter(TGo4Slot *slot, TGo4Slot *after)
void Delete(Option_t *opt="") override
TGo4Slot * GetChild(Int_t n) const
virtual void Event(TGo4Slot *source, Int_t id, void *param=nullptr)
void DeleteChild(const char *name)
Bool_t HasSubLevels() const
Bool_t IsAcceptObject(TClass *cl) const
TGo4Slot * GetNext() const
void Print(Option_t *opt="") const override
Int_t GetIndexOf(const TGo4Slot *child) const