45 Warning(
"THashTable",
"capacity (%d) < 0", capacity);
47 }
else if (capacity == 0)
51 fCont =
new TList* [fSize];
52 memset(fCont, 0, fSize*
sizeof(
TList*));
56 if (rehashlevel < 2) rehashlevel = 0;
57 fRehashLevel = rehashlevel;
151 for (
int i = 0; i <
fSize; i++) {
184 if (
IsArgNull(
"Collisions", obj))
return 0;
196 for (
int i = 0; i <
fSize; i++)
222 if (
IsArgNull(
"FindObject", obj))
return 0;
246 if (
IsArgNull(
"GetListForObject", obj))
return 0;
255 if (
IsArgNull(
"GetObjectRef", obj))
return 0;
288 while ((obj = next()))
291 while ((obj = next()))
337 for (
int i = 0; i <
fSize; i++) {
440 if (slot == -1)
return 0;
460 if (fCursor < fTable->Capacity())
492 const THashTableIter &iter(dynamic_cast<const THashTableIter &>(aIter));
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
virtual void AddAll(const TCollection *col)
Add all objects from collection col to this collection.
void AddBefore(const TObject *before, TObject *obj)
Add object to the hash table.
void Reset()
Reset the hashtable iterator.
TObject ** GetObjectRef(const TObject *obj) const
Return address of pointer to obj.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
Bool_t IsArgNull(const char *where, const TObject *obj) const
Returns true if object is a null pointer.
virtual Int_t GetEntries() const
virtual void AddAll(const TCollection *col)
Add all objects from collection col to this collection.
void Rehash(Int_t newCapacity, Bool_t checkObjValidity=kTRUE)
Rehash the hashtable.
Float_t AverageCollisions() const
const TList * GetListForObject(const char *name) const
Return the TList corresponding to object's name based hash value.
TObject * RemoveSlow(TObject *obj)
Remove object from the hashtable without using the hash value.
TObject * Next()
Return next object in the list. Returns 0 when no more objects in list.
const THashTable * fTable
Iterator abstract base class.
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
THashTable(const THashTable &)
friend class THashTableIter
THashTable implements a hash table to store TObject's.
void Clear(Option_t *option="")
Remove all objects from the table.
const Bool_t kIterForward
Int_t NextSlot()
Returns index of next slot in table containing list to be iterated.
~THashTableIter()
Delete hashtable iterator.
TObject * operator*() const
Return pointer to current object or nullptr.
const TCollection * GetCollection() const
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const =0
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Collection abstract base class.
virtual ~THashTable()
Delete a hashtable.
Bool_t PtrIsValid(TObject *obj)
void Reset(Detail::TBranchProxy *x)
void Warning(const char *location, const char *msgfmt,...)
static Bool_t GetObjectStat()
Get status of object stat flag.
virtual void AddBefore(const TObject *before, TObject *obj)
Insert object before object before in the list.
TIterator * MakeIterator(Bool_t dir=kIterForward) const
Returns a hash table iterator.
R__EXTERN TObjectTable * gObjectTable
Int_t Collisions(const char *name) const
Returns the number of collisions for an object with a certain name (i.e.
TIterator & operator=(const TIterator &rhs)
Overridden assignment operator.
TObject * FindObject(const char *name) const
Find object using its name.
void Add(TObject *obj)
Add object to the hash table.
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Mother of all ROOT objects.
Long_t NextPrime(Long_t x)
TMath Base functionsDefine the functions Min, Max, Abs, Sign, Range for all types.
void Delete(Option_t *option="")
Remove all objects from the table AND delete all heap based objects.
virtual void Add(TObject *obj)
Short_t Max(Short_t a, Short_t b)
Bool_t operator!=(const TIterator &aIter) const
This operator compares two TIterator objects.
TObject * Next()
Return next object in hashtable. Returns 0 when no more objects in table.
virtual Int_t GetSize() const
Int_t GetHashValue(const TObject *obj) const
virtual TObject ** GetObjectRef(const TObject *obj) const
Return address of pointer to obj.
TObject * Remove(TObject *obj)
Remove object from the hashtable.