46 Warning(
"THashTable",
"capacity (%d) < 0", capacity);
48 }
else if (capacity == 0)
57 if (rehashlevel < 2) rehashlevel = 0;
160 for (
int i = 0; i <
fSize; i++) {
196 if (
IsArgNull(
"Collisions", obj))
return 0;
213 for (
int i = 0; i <
fSize; i++)
242 if (
IsArgNull(
"FindObject", obj))
return 0;
270 if (
IsArgNull(
"GetListForObject", obj))
return 0;
284 if (
IsArgNull(
"GetObjectRef", obj))
return 0;
316 if (strstr(option,
"details")==
nullptr) {
328 printf(
"Slot #%d:\n",cursor);
363 while ((obj = next()))
366 while ((obj = next()))
377 "During the rehash of %p one or more element was added or removed. The initalize size was %d and now it is %d",
432 for (
int i = 0; i <
fSize; i++) {
541 if (slot == -1)
return 0;
563 if (fCursor < fTable->Capacity())
595 const THashTableIter &iter(dynamic_cast<const THashTableIter &>(aIter));
static Int_t DecreaseDirLevel()
Decrease the indentation level for ls().
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
Delete a TObjLink object.
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.
#define R__COLLECTION_READ_LOCKGUARD(mutex)
R__EXTERN TVirtualRWMutex * gCoreMutex
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)
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
void Reset(Detail::TBranchProxy *x)
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.
void Print(Option_t *option, Int_t recurse) const
Print the collection header and its elements.
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.
static Int_t IncreaseDirLevel()
Increase the indentation level for ls().
Int_t GetCheckedHashValue(TObject *obj) const
virtual void PrintCollectionHeader(Option_t *option) const
Print the collection header.
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.
#define R__COLLECTION_WRITE_LOCKGUARD(mutex)
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
virtual void Print(Option_t *option="") const
Default print for collections, calls Print(option, 1).
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.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
TObject * Remove(TObject *obj)
Remove object from the hashtable.