16 #ifndef ROO_LINKED_LIST
17 #define ROO_LINKED_LIST
26 class RooLinkedListIter ;
31 namespace RooLinkedListImplDetails {
36 class RooLinkedList :
public TObject {
39 RooLinkedList(Int_t htsize=0) ;
42 RooLinkedList(
const RooLinkedList& other) ;
44 virtual TObject* Clone(
const char* =0)
const {
45 return new RooLinkedList(*
this) ;
49 RooLinkedList& operator=(
const RooLinkedList& other) ;
51 Int_t getHashTableSize()
const {
53 return _htableName ? _htableName->size() : 0 ;
56 void setHashTableSize(Int_t size) ;
59 virtual ~RooLinkedList() ;
61 Int_t GetSize()
const {
return _size ; }
63 virtual void Add(TObject* arg) { Add(arg,1) ; }
64 virtual Bool_t Remove(TObject* arg) ;
65 TObject* At(Int_t index)
const ;
66 Bool_t Replace(
const TObject* oldArg,
const TObject* newArg) ;
67 TIterator* MakeIterator(Bool_t forward = kTRUE)
const ;
68 RooLinkedListIter iterator(Bool_t forward = kTRUE)
const ;
69 RooFIter fwdIterator()
const ;
71 void Clear(Option_t *o=0) ;
72 void Delete(Option_t *o=0) ;
73 TObject* find(
const char* name)
const ;
74 RooAbsArg* findArg(
const RooAbsArg*)
const ;
75 TObject* FindObject(
const char* name)
const ;
76 TObject* FindObject(
const TObject* obj)
const ;
77 Int_t IndexOf(
const char* name)
const ;
78 Int_t IndexOf(
const TObject* arg)
const ;
79 TObject* First()
const {
80 return _first?_first->_arg:0 ;
83 virtual void RecursiveRemove(TObject *obj);
85 void Print(
const char* opt)
const ;
86 void Sort(Bool_t ascend=kTRUE) ;
90 const char* GetName()
const {
return _name.Data() ; }
91 void SetName(
const char* name) { _name = name ; }
93 void useNptr(Bool_t flag) { _useNptr = flag ; }
96 ULong_t Hash()
const {
return _name.Hash(); }
101 RooLinkedListElem* createElement(TObject* obj, RooLinkedListElem* elem=0) ;
102 void deleteElement(RooLinkedListElem*) ;
105 friend class RooLinkedListIterImpl ;
106 friend class RooFIterForLinkedList ;
108 virtual void Add(TObject* arg, Int_t refCount) ;
110 RooLinkedListElem* findLink(
const TObject* arg)
const ;
114 RooLinkedListElem* _first ;
115 RooLinkedListElem* _last ;
116 RooHashTable* _htableName ;
117 RooHashTable* _htableLink ;
123 template <
bool ascending>
124 static RooLinkedListElem* mergesort_impl(RooLinkedListElem* l1,
125 const unsigned sz, RooLinkedListElem** tail = 0);
127 typedef RooLinkedListImplDetails::Pool Pool;
131 std::vector<RooLinkedListElem *> _at;
133 ClassDef(RooLinkedList,3)