76 namespace std {}
using namespace std;
94 if (IsArgNull(
"AddFirst", obj))
return;
118 if (IsArgNull(
"AddFirst", obj))
return;
121 fFirst = NewOptLink(obj, opt);
138 if (IsArgNull(
"AddLast", obj))
return;
144 fLast = NewLink(obj, fLast);
158 if (IsArgNull(
"AddLast", obj))
return;
161 fFirst = NewOptLink(obj, opt);
164 fLast = NewOptLink(obj, opt, fLast);
174 if (IsArgNull(
"AddBefore", obj))
return;
180 TObjLink *t = FindLink(before, idx);
182 Error(
"AddBefore",
"before not found, object not added");
188 NewLink(obj, t->
Prev());
202 if (IsArgNull(
"AddBefore", obj))
return;
210 NewLink(obj, before->
Prev());
222 if (IsArgNull(
"AddAfter", obj))
return;
230 Error(
"AddAfter",
"after not found, object not added");
250 if (IsArgNull(
"AddAfter", obj))
return;
270 if (IsArgNull(
"AddAt", obj))
return;
278 NewLink(obj, lnk->
Prev());
292 if (fCache && fCache->GetObject() && fCache->GetObject()->IsEqual(obj)) {
297 t = FindLink(obj, idx);
298 if (t) ((
TList*)
this)->fCache = t->
Next();
325 if (fCache && fCache->GetObject() && fCache->GetObject()->IsEqual(obj)) {
330 t = FindLink(obj, idx);
331 if (t) ((
TList*)
this)->fCache = t->
Prev();
352 if (!nodel && IsOwner()) {
368 needRegister = needRegister && !
gROOT->GetListOfCleanups()->FindObject(
this);
372 gROOT->GetListOfCleanups()->Add(
this);
392 fFirst = fLast = fCache = 0;
408 TList removeDirectory;
423 needRegister = needRegister && !
gROOT->GetListOfCleanups()->FindObject(
this);
427 gROOT->GetListOfCleanups()->Add(
this);
447 fFirst = fLast = fCache = 0;
453 fFirst = fLast = fCache = 0;
457 first = first->
Next();
472 TIter iRemDir(&removeDirectory);
474 while ((dirRem = iRemDir())) {
475 (*dirRem->IsA()->GetDirectoryAutoAdd())(dirRem, 0);
502 const char *objname = obj->
GetName();
503 if (objname && !strcmp(name, objname))
return obj;
522 if (ob->
IsEqual(obj))
return ob;
543 if (object->
TestBit(kNotDeleted)) {
544 if (object->
IsEqual(obj))
return lnk;
582 if (fLast)
return fLast->GetObject();
593 while (i < idx && lnk) {
643 if (ob->
TestBit(kNotDeleted)) {
652 }
else if (lnk == fLast) {
694 }
else if (lnk == fLast) {
727 }
else if (lnk == fLast) {
776 if (!
fFirst->GetObject()->IsSortable()) {
777 Error(
"Sort",
"objects in list are not sortable");
786 if (lnk) lnk->
fPrev = 0;
806 if ((IsAscending() && cmp <=0) || (!IsAscending() && cmp > 0))
823 return &((*head)->fNext);
826 p2 = (p1 = *head)->fNext;
827 if (LnkCompare(p1, p2))
return &(p2->
fNext);
828 p1->
fNext = (*head =
p2)->fNext;
829 return &((p2->
fNext =
p1)->fNext);
835 t2 = DoSort(h2 = DoSort(head, n), m);
837 if (LnkCompare((p1 = *head), (p2 = *h2))) {
839 if (!--n)
return *h2 =
p2, t2;
840 }
while (LnkCompare((p1 = *(head = &(p1->
fNext))), p2));
846 if (!--m)
return *h2 = *t2, *t2 =
p1, h2;
847 }
while (!LnkCompare(p1, (p2 = *(head = &(p2->
fNext)))));
850 if (!--n)
return *h2 =
p2, t2;
851 }
while (LnkCompare((p1 = *(head = &(p1->
fNext))), p2));
863 : fNext(prev->fNext), fPrev(prev), fObject(obj)
880 : fList(l), fCurCursor(0), fCursor(0), fDirection(dir), fStarted(
kFALSE)
902 if (
this != &rhs && rhs1) {
934 if (!
fList)
return 0;
986 if (
IsA() == aIter.IsA()) {
990 const TListIter &
iter(dynamic_cast<const TListIter &>(aIter));
1007 void TList::Streamer(
TBuffer &b)
1019 TObject::Streamer(b);
1023 for (
Int_t i = 0; i < nobjects; i++) {
1026 if (v > 4 && nch == 255) {
1031 readOption.resize(nbig,
'\0');
1035 Add(obj,readOption.c_str());
1047 TObject::Streamer(b);
1051 for (
Int_t i = 0; i < nobjects; i++) {
1059 TObject::Streamer(b);
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).
TObjLink * LinkAt(Int_t idx) const
sorting order (when calling Sort() or for TSortedList)
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
virtual void DeleteLink(TObjLink *lnk)
Delete a TObjLink object.
virtual void RemoveLast()
Remove the last object of the list.
virtual Option_t * GetOption() const
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
Option_t * GetOption() const
Returns the object option stored in the list.
virtual Option_t * GetAddOption() const
R__EXTERN TVirtualMutex * gROOTMutex
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)=0
virtual Bool_t IsEqual(const TObject *obj) const
Default equal comparison (objects are equal if they have the same address in memory).
TObject * Next()
Return next object in the list. Returns 0 when no more objects in list.
TObject ** GetObjectRef()
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
Iterator abstract base class.
virtual void AddLast(TObject *obj)
Add object at the end of the list.
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 *)
virtual TObject * After(const TObject *obj) const
Returns the object after object obj.
UChar_t mod R__LOCKGUARD2(gSrvAuthenticateMutex)
static Bool_t Initialized()
Return kTRUE if the TROOT object has been initialized.
std::map< std::string, std::string >::const_iterator iter
static double p2(double t, double a, double b, double c)
const Bool_t kIterForward
Bool_t LnkCompare(TObjLink *l1, TObjLink *l2)
Compares the objects stored in the TObjLink objects.
TSeqCollection * GetListOfCleanups() const
void Error(const char *location, const char *msgfmt,...)
virtual TObject * Before(const TObject *obj) const
Returns the object before object obj.
virtual TObject * Remove(TObject *obj)
Remove object from the list.
TObject * GetObject() const
TObjLink * fLast
pointer to first entry in linked list
Bool_t TestBit(UInt_t f) const
virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion=kFALSE)=0
static double p1(double t, double a, double b)
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
static void GarbageCollect(TObject *obj)
Add to the list of things to be cleaned up.
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
virtual Int_t GetSize() const
Bool_t operator!=(const TIterator &aIter) const
This operator compares two TIterator objects.
virtual const char * GetName() const
Returns name of object.
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.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
TObjLink ** DoSort(TObjLink **head, Int_t n)
Sort linked list.
virtual void Add(TObject *obj)
virtual void RecursiveRemove(TObject *obj)
Remove object from this collection and recursively remove the object from all other objects (and coll...
TObjLink * FindLink(const TObject *obj, Int_t &idx) const
Returns the TObjLink object that contains object obj.
virtual TIterator & operator=(const TIterator &)
virtual Int_t Compare(const TObject *obj) const
Compare abstract method.
void Reset()
Reset list iterator.
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const
Return a list iterator.
virtual TObject ** GetObjectRef(const TObject *obj) const
Return address of pointer to obj.
virtual TObjLink * NewLink(TObject *obj, TObjLink *prev=NULL)
Return a new TObjLink.
TIterator & operator=(const TIterator &rhs)
Overridden assignment operator.
ClassImp(TList) TList
Delete the list.
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0