34 static void AddBasesClasses(TList &bases, TClass *cl)
36 TIter nextBaseClass(cl->GetListOfBases());
38 while ((base = (TBaseClass*) nextBaseClass())) {
39 if (!base->GetClassPointer())
continue;
40 if (!(base->Property() & kIsPublic))
continue;
42 bases.Add(base->GetClassPointer());
43 AddBasesClasses(bases,base->GetClassPointer());
50 TViewPubFunctions::TViewPubFunctions(TClass *cl )
54 AddBasesClasses(fClasses,cl);
61 TViewPubFunctions::~TViewPubFunctions()
69 void TViewPubFunctions::Clear(Option_t * )
71 ::Error(
"TViewPubFunctions::Clear",
"Operation not allowed on a view.");
78 void TViewPubFunctions::Delete(Option_t * )
80 ::Error(
"TViewPubFunctions::Delete",
"Operation not allowed on a view.");
88 TObject *TViewPubFunctions::FindObject(
const char * name)
const
90 if (name==0 || name[0]==0)
return 0;
92 TIter next(&fClasses);
93 while (TClass *cl = (TClass*)next()) {
94 THashList *hl =
dynamic_cast<THashList*
>(cl->GetListOfMethods(kFALSE));
95 TIter funcnext(hl->GetListForObject(name));
96 while (TFunction *p = (TFunction*) funcnext())
97 if (p->Property() & kIsPublic
98 && strncmp(p->GetName(),name,strlen(p->GetName())) == 0)
109 TObject *TViewPubFunctions::FindObject(
const TObject * obj)
const
111 TIter next(&fClasses);
112 while (TClass *cl = (TClass*)next()) {
113 TObject *result = cl->GetListOfMethods(kFALSE)->FindObject(obj);
114 if (result)
return result;
122 TIterator *TViewPubFunctions::MakeIterator(Bool_t dir )
const
124 return new TViewPubFunctionsIter(
this, dir);
131 void TViewPubFunctions::AddFirst(TObject * )
133 ::Error(
"TViewPubFunctions::AddFirst",
"Operation not allowed on a view.");
140 void TViewPubFunctions::AddFirst(TObject * , Option_t * )
142 ::Error(
"TViewPubFunctions::AddFirst",
"Operation not allowed on a view.");
149 void TViewPubFunctions::AddLast(TObject * )
151 ::Error(
"TViewPubFunctions::AddLast",
"Operation not allowed on a view.");
158 void TViewPubFunctions::AddLast(TObject * , Option_t * )
160 ::Error(
"TViewPubFunctions::AddLast",
"Operation not allowed on a view.");
167 void TViewPubFunctions::AddAt(TObject * , Int_t )
169 ::Error(
"TViewPubFunctions::AddAt",
"Operation not allowed on a view.");
176 void TViewPubFunctions::AddAfter(
const TObject * , TObject * )
178 ::Error(
"TViewPubFunctions::RemAddLastove",
"Operation not allowed on a view.");
185 void TViewPubFunctions::AddAfter(TObjLink * , TObject * )
187 ::Error(
"TViewPubFunctions::AddAfter",
"Operation not allowed on a view.");
194 void TViewPubFunctions::AddBefore(
const TObject * , TObject * )
196 ::Error(
"TViewPubFunctions::AddBefore",
"Operation not allowed on a view.");
203 void TViewPubFunctions::AddBefore(TObjLink * , TObject * )
205 ::Error(
"TViewPubFunctions::AddBefore",
"Operation not allowed on a view.");
211 TObject *TViewPubFunctions::At(Int_t idx)
const
214 TIter next(&fClasses);
215 while (TClass *cl = (TClass*)next()) {
216 TIter funcnext(cl->GetListOfMethods(kFALSE));
217 while (TFunction *p = (TFunction*) funcnext()) {
218 if (p->Property() & kIsPublic) {
219 if (i == idx)
return p;
231 TObject *TViewPubFunctions::After(
const TObject * )
const
233 ::Error(
"TViewPubFunctions::After",
"Operation not allowed on a view.");
241 TObject *TViewPubFunctions::Before(
const TObject * )
const
243 ::Error(
"TViewPubFunctions::Before",
"Operation not allowed on a view.");
251 TObject *TViewPubFunctions::First()
const
253 ::Error(
"TViewPubFunctions::First",
"Operation not allowed on a view.");
261 TObjLink *TViewPubFunctions::FirstLink()
const
263 ::Error(
"TViewPubFunctions::FirstLink",
"Operation not allowed on a view.");
271 TObject **TViewPubFunctions::GetObjectRef(
const TObject * )
const
273 ::Error(
"TViewPubFunctions::GetObjectRef",
"Operation not yet allowed on a view.");
281 Int_t TViewPubFunctions::GetSize()
const
284 TIter next(&fClasses);
285 while (TClass *cl = (TClass*)next()) {
286 TIter funcnext(cl->GetListOfMethods(kFALSE));
287 while (TFunction *p = (TFunction*) funcnext())
288 if (p->Property() & kIsPublic) ++size;
298 void TViewPubFunctions::Load()
300 TIter next(&fClasses);
301 while (TClass *cl = (TClass*)next()) {
302 cl->GetListOfMethods(kTRUE);
310 TObject *TViewPubFunctions::Last()
const
312 ::Error(
"TViewPubFunctions::Last",
"Operation not allowed on a view.");
320 TObjLink *TViewPubFunctions::LastLink()
const
322 ::Error(
"TViewPubFunctions::LastLink",
"Operation not allowed on a view.");
330 void TViewPubFunctions::RecursiveRemove(TObject * )
332 ::Error(
"TViewPubFunctions::RecursiveRemove",
"Operation not allowed on a view.");
339 TObject *TViewPubFunctions::Remove(TObject * )
341 ::Error(
"TViewPubFunctions::Remove",
"Operation not allowed on a view.");
349 TObject *TViewPubFunctions::Remove(TObjLink * )
351 ::Error(
"TViewPubFunctions::Remove",
"Operation not allowed on a view.");
365 TViewPubFunctionsIter::TViewPubFunctionsIter(
const TViewPubFunctions *l, Bool_t dir)
366 : fView(l),fClassIter(l->GetListOfClasses(),dir), fFuncIter((TCollection *)0),
367 fStarted(kFALSE), fDirection(dir)
374 TViewPubFunctionsIter::TViewPubFunctionsIter(
const TViewPubFunctionsIter &iter) :
375 TIterator(iter), fView(iter.fView),
376 fClassIter(iter.fClassIter), fFuncIter(iter.fFuncIter),
377 fStarted(iter.fStarted), fDirection(iter.fDirection)
384 TIterator &TViewPubFunctionsIter::operator=(
const TIterator &rhs)
386 const TViewPubFunctionsIter *iter =
dynamic_cast<const TViewPubFunctionsIter*
>(&rhs);
387 if (
this != &rhs && iter) {
389 fClassIter = iter->fClassIter;
390 fFuncIter = iter->fFuncIter;
391 fStarted = iter->fStarted;
392 fDirection = iter->fDirection;
400 TViewPubFunctionsIter &TViewPubFunctionsIter::operator=(
const TViewPubFunctionsIter &rhs)
404 fClassIter = rhs.fClassIter;
405 fFuncIter = rhs.fFuncIter;
406 fStarted = rhs.fStarted;
407 fDirection = rhs.fDirection;
415 TObject *TViewPubFunctionsIter::Next()
417 if (!fView)
return 0;
420 TClass *current = (TClass*)fClassIter();
424 new (&(fFuncIter)) TIter(current->GetListOfMethods(kFALSE),fDirection);
432 TFunction *func = (TFunction *)fFuncIter();
435 TClass *current = (TClass*)fClassIter();
438 new (&(fFuncIter)) TIter(current->GetListOfMethods(kFALSE),fDirection);
443 }
else if (func->Property() & kIsPublic) {
456 void TViewPubFunctionsIter::Reset()
465 Bool_t TViewPubFunctionsIter::operator!=(
const TIterator &aIter)
const
467 const TViewPubFunctionsIter *iter =
dynamic_cast<const TViewPubFunctionsIter*
>(&aIter);
469 return (fClassIter != iter->fClassIter || fFuncIter != iter->fFuncIter);
477 Bool_t TViewPubFunctionsIter::operator!=(
const TViewPubFunctionsIter &aIter)
const
479 return (fClassIter != aIter.fClassIter || fFuncIter != aIter.fFuncIter);