9 int StMkDeb::fgCurr = -2003;
10 int StMkDeb::fgStage = 0;
11 TObjArray *StMkDeb::fgArr=0;
14 int StMkDeb::Register (
const TObject *mk)
16 if (!fgArr) fgArr =
new TObjArray(100);
17 fgArr->Add((TObject*)mk);
18 return fgArr->GetLast();
22 int StMkDeb::Register (
StMaker *mk)
24 int id = Register ((TObject*)mk);
25 ((TObject*)mk)->TObject::SetUniqueID(
id+1);
30 void StMkDeb::Cancel(
const TObject *mk)
34 int i = fgArr->IndexOf(mk);
38 void StMkDeb::Cancel(
StMaker *mk)
42 int id = int(((TObject*)mk)->TObject::GetUniqueID())-1;
44 ((TObject*)mk)->TObject::SetUniqueID(0);
45 TObject *to = fgArr->At(
id);
46 TObject *tmk= (TObject *) mk;
47 if (to != tmk)
delete to;
51 int StMkDeb::SetCurrent(
const TObject *mk,
int kind)
53 if (fgCurr<-1) Ready();
54 fgCurr = kind+100*(fgArr->IndexOf(mk));
59 int StMkDeb::SetCurrent(
const StMaker *mk,
int kind)
61 if (fgCurr<-1) Ready();
62 fgCurr = int(((TObject*)mk)->TObject::GetUniqueID())-1;
64 fgCurr = fgCurr*100+kind;
69 int StMkDeb::SetCurrent(
int curr)
71 if (fgCurr<-1) Ready();
72 if (curr>=0) fgCurr = curr;
76 void StMkDeb::SetStage(
int stage)
83 if (fgCurr>-2003)
return;
86 int lst = fgArr->GetLast();
87 for (
int i=0;i<=lst; i++) {
88 TObject *to = fgArr->At(i);
90 if (!to->TObject::TestBit(TObject::kNotDeleted)) {fgArr->AddAt(0,i);
continue;}
91 if (to->IsA() == TNamed::Class())
continue;
92 TString ts(to->ClassName());
97 TNamed *tn =
new TNamed(ts.Data(),
"");
102 const char *StMkDeb::GetName(
int id)
104 if (!fgArr)
return 0;
106 int lst = fgArr->GetLast();
107 if (
id < 0 )
return "";
108 int stage =
id%100;
id/=100;
109 int kind =
id%100;
id/=100;
110 if (
id > lst)
return "";
111 ts = fgArr->At(
id)->GetName();
112 ts +=
" kind=" ;ts += kind ;
113 ts +=
" stage=";ts += stage;
117 int StMkDeb::SetUser(TObject *us)
119 if (!fgArr)
return 0;
120 us->TObject::SetUniqueID(fgCurr*100+fgStage+1);
124 const char *StMkDeb::GetUser(
const TObject *us)
126 return GetName(us->TObject::GetUniqueID()-1);
129 void StMkDeb::Pause(
const char *tit)
131 if (tit && *tit) printf(
"Pause %s\n",tit);
134 int StMkDeb::GetCurrent(){
return fgCurr;}