46 Warning(
"THashTable",
"capacity (%d) < 0", capacity);
48 }
else if (capacity == 0)
57 if (rehashlevel < 2) rehashlevel = 0;
171 for (
int i = 0; i <
fSize; i++) {
207 if (
IsArgNull(
"Collisions", obj))
return 0;
224 for (
int i = 0; i <
fSize; i++)
253 if (
IsArgNull(
"FindObject", obj))
return nullptr;
284 if (
IsArgNull(
"GetListForObject", obj))
return nullptr;
298 if (
IsArgNull(
"GetObjectRef", obj))
return nullptr;
330 if (strstr(
option,
"details")==
nullptr) {
342 printf(
"Slot #%d:\n",
cursor);
377 while ((obj = next()))
381 while ((obj = next()))
392 "During the rehash of %p one or more element was added or removed. The initalize size was %d and now it is %d",
447 for (
int i = 0; i <
fSize; i++) {
556 if (slot == -1)
return nullptr;
578 if (fCursor < fTable->Capacity())
#define R__COLLECTION_READ_LOCKGUARD(mutex)
const Bool_t kIterForward
#define R__COLLECTION_WRITE_LOCKGUARD(mutex)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t cursor
R__EXTERN TObjectTable * gObjectTable
Collection abstract base class.
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const =0
Bool_t IsArgNull(const char *where, const TObject *obj) const
Returns true if object is a null pointer.
virtual void AddAll(const TCollection *col)
Add all objects from collection col to this collection.
virtual Int_t GetEntries() const
virtual void PrintCollectionHeader(Option_t *option) const
Print the collection header.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
void Print(Option_t *option="") const override
Default print for collections, calls Print(option, 1).
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Bool_t operator!=(const TIterator &aIter) const override
This operator compares two TIterator objects.
const THashTable * fTable
~THashTableIter()
Delete hashtable iterator.
void Reset() override
Reset the hashtable iterator.
TObject * operator*() const override
Return pointer to current object or nullptr.
TObject * Next() override
Return next object in hashtable. Returns 0 when no more objects in table.
TIterator & operator=(const TIterator &rhs) override
Overridden assignment operator.
Int_t NextSlot()
Returns index of next slot in table containing list to be iterated.
THashTable implements a hash table to store TObject's.
Float_t AverageCollisions() const
void Add(TObject *obj) override
Add object to the hash table.
friend class THashTableIter
const TList * GetListForObject(const char *name) const
Return the TList corresponding to object's name based hash value.
void AddImpl(Int_t slot, TObject *object)
Helper function doing the actual add to the table give a slot and object.
TObject * Remove(TObject *obj) override
Remove object from the hashtable.
void Rehash(Int_t newCapacity, Bool_t checkObjValidity=kTRUE)
Rehash the hashtable.
TObject * RemoveSlow(TObject *obj)
Remove object from the hashtable without using the hash value.
TIterator * MakeIterator(Bool_t dir=kIterForward) const override
Returns a hash table iterator.
TObject ** GetObjectRef(const TObject *obj) const override
Return address of pointer to obj.
THashTable(const THashTable &)=delete
void AddBefore(const TObject *before, TObject *obj)
Add object to the hash table.
void AddAll(const TCollection *col) override
Add all objects from collection col to this collection.
TObject * FindObject(const char *name) const override
Find object using its name.
Int_t GetSize() const override
Return the capacity of the collection, i.e.
void Clear(Option_t *option="") override
Remove all objects from the table.
Int_t Collisions(const char *name) const
Returns the number of collisions for an object with a certain name (i.e.
void Print(Option_t *option, Int_t recurse) const override
Print the collection header and its elements.
void Delete(Option_t *option="") override
Remove all objects from the table AND delete all heap based objects.
virtual ~THashTable()
Delete a hashtable.
Int_t GetCheckedHashValue(TObject *obj) const
Int_t GetHashValue(const TObject *obj) const
Iterator abstract base class.
virtual TClass * IsA() const
const TCollection * GetCollection() const override
TObject * Next() override
Return next object in the list. Returns 0 when no more objects in list.
void Clear(Option_t *option="") override
Remove all objects from the list.
TObject ** GetObjectRef(const TObject *obj) const override
Return address of pointer to obj.
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
void Add(TObject *obj) override
TObject * Remove(TObject *obj) override
Remove object from the list.
void AddBefore(const TObject *before, TObject *obj) override
Insert object before object before in the list.
void Delete(Option_t *option="") override
Remove all objects from the list AND delete all heap based objects.
Bool_t PtrIsValid(TObject *obj)
Mother of all ROOT objects.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
static Bool_t GetObjectStat()
Get status of object stat flag.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
static Int_t IncreaseDirLevel()
Increase the indentation level for ls().
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
static Int_t DecreaseDirLevel()
Decrease the indentation level for ls().
R__EXTERN TVirtualRWMutex * gCoreMutex
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Long_t NextPrime(Long_t x)