16#ifndef ROO_LINKED_LIST
17#define ROO_LINKED_LIST
25#include <unordered_map>
93 void Print(
const char* opt)
const ;
134 template <
bool ascending>
142 std::vector<RooLinkedListElem *>
_at;
#define ClassDef(name, id)
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Implementation of the GenericRooFIter interface for the RooLinkedList.
A one-time forward iterator working on RooLinkedList or RooAbsCollection.
RooLinkedListElem is an link element for the RooLinkedList class.
a chunk of memory in a pool for quick allocation of RooLinkedListElems
Implementation of the actual iterator on RooLinkedLists.
A wrapper around TIterator derivatives.
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
void SetName(const char *name)
RooLinkedListIterImpl rend() const
TObject * At(int index) const
Return object stored in sequential position given by index.
TObject * FindObject(const char *name) const
Return pointer to obejct with given name.
static Pool * _pool
shared memory pool for allocation of RooLinkedListElems
TString _name
Hash table by link pointer.
RooLinkedListIterImpl end() const
RooLinkedListImplDetails::Pool Pool
memory pool for quick allocation of RooLinkedListElems
std::vector< RooLinkedListElem * > _at
const char * GetName() const
Returns name of object.
std::unique_ptr< HashTableByName > _htableName
std::unordered_map< std::string, TObject const * > HashTableByName
Link to last element of list.
RooLinkedListElem * createElement(TObject *obj, RooLinkedListElem *elem=0)
cout << "RooLinkedList::createElem(" << this << ") obj = " << obj << " elem = " << elem << endl ;
std::unique_ptr< HashTableByLink > _htableLink
Hash table by name.
void Sort(Bool_t ascend=kTRUE)
Int_t getHashTableSize() const
RooFIter fwdIterator() const
Create a one-time-use forward iterator for this list.
void deleteElement(RooLinkedListElem *)
RooLinkedListElem * findLink(const TObject *arg) const
Find the element link containing the given object.
std::unordered_map< TObject const *, TObject const * > HashTableByLink
void Print(const char *opt) const
Print contents of list, defers to Print() function of contained objects.
RooLinkedListIterImpl rbegin() const
TIterator * MakeIterator(Bool_t forward=kTRUE) const
Create a TIterator for this list.
virtual TObject * Clone(const char *=0) const
Make a clone of an object using the Streamer facility.
ULong_t Hash() const
Return hash value for this object.
static RooLinkedListElem * mergesort_impl(RooLinkedListElem *l1, const unsigned sz, RooLinkedListElem **tail=0)
length 0, 1 lists are sorted
RooAbsArg * findArg(const RooAbsArg *) const
Return pointer to object with given name in collection.
void Delete(Option_t *o=0)
Remove all elements in collection and delete all elements NB: Collection does not own elements,...
TObject * find(const char *name) const
Return pointer to object with given name in collection.
RooLinkedList & operator=(const RooLinkedList &other)
Assignment operator, copy contents from 'other'.
virtual void RecursiveRemove(TObject *obj)
If one of the TObject we have a referenced to is deleted, remove the reference.
virtual void Add(TObject *arg)
void useNptr(Bool_t flag)
RooLinkedListIterImpl begin() const
RooLinkedListElem * _last
Link to first element of list.
void setHashTableSize(Int_t size)
Change the threshold for hash-table use to given size.
void Clear(Option_t *o=0)
Remove all elements from collection.
Bool_t Replace(const TObject *oldArg, const TObject *newArg)
Replace object 'oldArg' in collection with new object 'newArg'.
RooLinkedListElem * _first
virtual Bool_t Remove(TObject *arg)
Remove object from collection.
Int_t IndexOf(const char *name) const
Return position of given object in list.
virtual ~RooLinkedList()
Destructor.
Iterator abstract base class.
Mother of all ROOT objects.
const char * Data() const
UInt_t Hash(ECaseCompare cmp=kExact) const
Return hash value.