77 namespace std {}
using namespace std;
95 if (IsArgNull(
"AddFirst", obj))
return;
119 if (IsArgNull(
"AddFirst", obj))
return;
122 fFirst = NewOptLink(obj, opt);
139 if (IsArgNull(
"AddLast", obj))
return;
145 fLast = NewLink(obj, fLast);
159 if (IsArgNull(
"AddLast", obj))
return;
162 fFirst = NewOptLink(obj, opt);
165 fLast = NewOptLink(obj, opt, fLast);
175 if (IsArgNull(
"AddBefore", obj))
return;
181 TObjLink *t = FindLink(before, idx);
183 Error(
"AddBefore",
"before not found, object not added");
189 NewLink(obj, t->
Prev());
203 if (IsArgNull(
"AddBefore", obj))
return;
211 NewLink(obj, before->
Prev());
223 if (IsArgNull(
"AddAfter", obj))
return;
231 Error(
"AddAfter",
"after not found, object not added");
251 if (IsArgNull(
"AddAfter", obj))
return;
271 if (IsArgNull(
"AddAt", obj))
return;
279 NewLink(obj, lnk->
Prev());
293 if (fCache && fCache->GetObject() && fCache->GetObject()->IsEqual(obj)) {
298 t = FindLink(obj, idx);
299 if (t) ((
TList*)
this)->fCache = t->
Next();
326 if (fCache && fCache->GetObject() && fCache->GetObject()->IsEqual(obj)) {
331 t = FindLink(obj, idx);
332 if (t) ((
TList*)
this)->fCache = t->
Prev();
353 if (!nodel && IsOwner()) {
369 needRegister = needRegister && !
gROOT->GetListOfCleanups()->FindObject(
this);
373 gROOT->GetListOfCleanups()->Add(
this);
393 fFirst = fLast = fCache = 0;
409 TList removeDirectory;
424 needRegister = needRegister && !
gROOT->GetListOfCleanups()->FindObject(
this);
428 gROOT->GetListOfCleanups()->Add(
this);
448 fFirst = fLast = fCache = 0;
454 fFirst = fLast = fCache = 0;
458 first = first->
Next();
473 TIter iRemDir(&removeDirectory);
475 while ((dirRem = iRemDir())) {
476 (*dirRem->IsA()->GetDirectoryAutoAdd())(dirRem, 0);
503 const char *objname = obj->
GetName();
504 if (objname && !strcmp(name, objname))
return obj;
523 if (ob->
IsEqual(obj))
return ob;
544 if (object->
TestBit(kNotDeleted)) {
545 if (object->
IsEqual(obj))
return lnk;
583 if (fLast)
return fLast->GetObject();
594 while (i < idx && lnk) {
644 if (ob->
TestBit(kNotDeleted)) {
653 }
else if (lnk == fLast) {
695 }
else if (lnk == fLast) {
728 }
else if (lnk == fLast) {
777 if (!
fFirst->GetObject()->IsSortable()) {
778 Error(
"Sort",
"objects in list are not sortable");
787 if (lnk) lnk->
fPrev = 0;
807 if ((IsAscending() && cmp <=0) || (!IsAscending() && cmp > 0))
824 return &((*head)->fNext);
827 p2 = (p1 = *head)->fNext;
828 if (LnkCompare(p1, p2))
return &(p2->
fNext);
829 p1->
fNext = (*head =
p2)->fNext;
830 return &((p2->
fNext =
p1)->fNext);
836 t2 = DoSort(h2 = DoSort(head, n), m);
838 if (LnkCompare((p1 = *head), (p2 = *h2))) {
840 if (!--n)
return *h2 =
p2, t2;
841 }
while (LnkCompare((p1 = *(head = &(p1->
fNext))), p2));
847 if (!--m)
return *h2 = *t2, *t2 =
p1, h2;
848 }
while (!LnkCompare(p1, (p2 = *(head = &(p2->
fNext)))));
851 if (!--n)
return *h2 =
p2, t2;
852 }
while (LnkCompare((p1 = *(head = &(p1->
fNext))), p2));
864 : fNext(prev->fNext), fPrev(prev), fObject(obj)
881 : fList(
l), fCurCursor(0), fCursor(0), fDirection(dir), fStarted(
kFALSE)
903 if (
this != &rhs && rhs1) {
935 if (!
fList)
return 0;
987 if (IsA() == aIter.IsA()) {
991 const TListIter &iter(dynamic_cast<const TListIter &>(aIter));
1020 TObject::Streamer(b);
1024 for (
Int_t i = 0; i < nobjects; i++) {
1027 if (v > 4 && nch == 255) {
1032 readOption.resize(nbig,
'\0');
1036 Add(obj,readOption.c_str());
1048 TObject::Streamer(b);
1052 for (
Int_t i = 0; i < nobjects; i++) {
1060 TObject::Streamer(b);
1062 nobjects = GetSize();
virtual TObject * Remove(TObject *obj)=0
virtual void AddAt(TObject *obj, Int_t idx)
Insert object at position idx in the list.
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
virtual TObjLink * NewOptLink(TObject *obj, Option_t *opt, TObjLink *prev=NULL)
Return a new TObjOptLink (a TObjLink that also stores the option).
TSeqCollection * GetListOfCleanups() const
virtual void DeleteLink(TObjLink *lnk)
Delete a TObjLink object.
virtual void RemoveLast()
Remove the last object of the list.
TObjLink * LinkAt(Int_t idx) const
sorting order (when calling Sort() or for TSortedList)
Bool_t TestBit(UInt_t f) const
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
virtual void AddFirst(TObject *obj)
Add object at the beginning of the list.
Buffer base class used for serializing objects.
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
R__EXTERN TVirtualMutex * gROOTMutex
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)=0
TObject * Next()
Return next object in the list. Returns 0 when no more objects in list.
TObject ** GetObjectRef()
Iterator abstract base class.
virtual void AddLast(TObject *obj)
Add object at the end of the list.
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
virtual void RecursiveRemove(TObject *obj)
Recursively remove this object from a list.
virtual void Sort(Bool_t order=kSortAscending)
Sort linked list.
virtual void SetOption(Option_t *)
static Bool_t Initialized()
Return kTRUE if the TROOT object has been initialized.
static double p2(double t, double a, double b, double c)
void Add(THist< DIMENSIONS, PRECISION_TO, STAT_TO... > &to, THist< DIMENSIONS, PRECISION_FROM, STAT_FROM... > &from)
Add two histograms.
const Bool_t kIterForward
Bool_t LnkCompare(TObjLink *l1, TObjLink *l2)
Compares the objects stored in the TObjLink objects.
void Error(const char *location, const char *msgfmt,...)
virtual Bool_t IsEqual(const TObject *obj) const
Default equal comparison (objects are equal if they have the same address in memory).
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const
Return a list iterator.
virtual Option_t * GetOption() const
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
virtual TObject * Remove(TObject *obj)
Remove object from the list.
virtual TObject * Before(const TObject *obj) const
Returns the object before object obj.
TObjLink * fLast
pointer to first entry in linked list
virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion=kFALSE)=0
virtual TObject * After(const TObject *obj) const
Returns the object after object obj.
virtual Int_t Compare(const TObject *obj) const
Compare abstract method.
static double p1(double t, double a, double b)
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
virtual void AddBefore(const TObject *before, TObject *obj)
Insert object before object before in the list.
virtual void ReadFastArray(Bool_t *b, Int_t n)=0
virtual void WriteFastArray(const Bool_t *b, Int_t n)=0
#define R__LOCKGUARD2(mutex)
static void GarbageCollect(TObject *obj)
Add to the list of things to be cleaned up.
Wrapper around a TObject so it can be stored in a TList.
virtual void Clear(Option_t *option="")
Remove all objects from the list.
void SetOption(Option_t *option)
Sets the object option stored in the list.
virtual void AddAfter(const TObject *after, TObject *obj)
Insert object after object after in the list.
Mother of all ROOT objects.
TObject * GetObject() const
TObjLink ** DoSort(TObjLink **head, Int_t n)
Sort linked list.
virtual void RecursiveRemove(TObject *obj)
Remove object from this collection and recursively remove the object from all other objects (and coll...
virtual TIterator & operator=(const TIterator &)
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Bool_t operator!=(const TIterator &aIter) const
This operator compares two TIterator objects.
void Reset()
Reset list iterator.
virtual TObjLink * NewLink(TObject *obj, TObjLink *prev=NULL)
Return a new TObjLink.
virtual const char * GetName() const
Returns name of object.
TIterator & operator=(const TIterator &rhs)
Overridden assignment operator.
virtual TObject ** GetObjectRef(const TObject *obj) const
Return address of pointer to obj.
Option_t * GetOption() const
Returns the object option stored in the list.
virtual Option_t * GetAddOption() const
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
TObjLink * FindLink(const TObject *obj, Int_t &idx) const
Returns the TObjLink object that contains object obj.