Logo ROOT  
Reference Guide
TSortedList.h
Go to the documentation of this file.
1 // @(#)root/cont:$Id$
2 // Author: Fons Rademakers 14/09/95
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TSortedList
13 #define ROOT_TSortedList
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TSortedList //
19 // //
20 // A sorted doubly linked list. All sortable classes inheriting from //
21 // TObject can be inserted in a TSortedList. //
22 // //
23 //////////////////////////////////////////////////////////////////////////
24 
25 #include "TList.h"
26 
27 
28 class TSortedList : public TList {
29 
30 public:
32 
33  void Add(TObject *obj);
34  void Add(TObject *obj, Option_t *opt);
35 
36  Bool_t IsSorted() const { return kTRUE; }
37 
38  //---- the following methods are overridden to preserve sorting order
39  void AddFirst(TObject *obj) { Add(obj); }
40  void AddFirst(TObject *obj, Option_t *opt) { Add(obj, opt); }
41  void AddLast(TObject *obj) { Add(obj); }
42  void AddLast(TObject *obj, Option_t *opt) { Add(obj, opt); }
43  void AddAt(TObject *obj, Int_t) { Add(obj); }
44  void AddAfter(const TObject *, TObject *obj) { Add(obj); }
45  void AddAfter(TObjLink *, TObject *obj) { Add(obj); }
46  void AddBefore(const TObject *, TObject *obj) { Add(obj); }
47  void AddBefore(TObjLink *, TObject *obj) { Add(obj); }
49 
50  ClassDef(TSortedList,0) //A sorted list
51 };
52 
53 #endif
54 
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
Option_t
const char Option_t
Definition: RtypesCore.h:66
TSortedList::AddFirst
void AddFirst(TObject *obj)
Add object at the beginning of the list.
Definition: TSortedList.h:39
TSortedList::AddAfter
void AddAfter(TObjLink *, TObject *obj)
Insert object after the specified ObjLink object.
Definition: TSortedList.h:45
TSortedList::IsSorted
Bool_t IsSorted() const
Definition: TSortedList.h:36
TList.h
TSortedList::AddFirst
void AddFirst(TObject *obj, Option_t *opt)
Add object at the beginning of the list and also store option.
Definition: TSortedList.h:40
bool
TSortedList::Sort
void Sort(Bool_t=kSortAscending)
Sort linked list.
Definition: TSortedList.h:48
TSortedList::AddBefore
void AddBefore(TObjLink *, TObject *obj)
Insert object before the specified ObjLink object.
Definition: TSortedList.h:47
TSortedList::AddBefore
void AddBefore(const TObject *, TObject *obj)
Insert object before object before in the list.
Definition: TSortedList.h:46
TSortedList::TSortedList
TSortedList(Bool_t order=kSortAscending)
Definition: TSortedList.h:31
TSortedList
A sorted doubly linked list.
Definition: TSortedList.h:28
TSortedList::AddLast
void AddLast(TObject *obj)
Add object at the end of the list.
Definition: TSortedList.h:41
TSortedList::AddAt
void AddAt(TObject *obj, Int_t)
Insert object at position idx in the list.
Definition: TSortedList.h:43
TSortedList::AddAfter
void AddAfter(const TObject *, TObject *obj)
Insert object after object after in the list.
Definition: TSortedList.h:44
TSortedList::Add
void Add(TObject *obj)
Add object in sorted list.
Definition: TSortedList.cxx:27
TList::fAscending
Bool_t fAscending
cache to speedup sequential calling of Before() and After() functions
Definition: TList.h:55
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
kSortAscending
const Bool_t kSortAscending
Definition: TList.h:37
TSortedList::AddLast
void AddLast(TObject *obj, Option_t *opt)
Add object at the end of the list and also store option.
Definition: TSortedList.h:42
TList
A doubly linked list.
Definition: TList.h:44
int