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())
virtual Int_t GetEntries() const
Int_t Collisions(const char *name) const
Returns the number of collisions for an object with a certain name (i.e.
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.
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
void Reset()
Reset the hashtable iterator.
const TList * GetListForObject(const char *name) const
Return the TList corresponding to object's name based hash value.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
TObject * operator*() const
Return pointer to current object or nullptr.
void Rehash(Int_t newCapacity, Bool_t checkObjValidity=kTRUE)
Rehash the hashtable.
TIterator * MakeIterator(Bool_t dir=kIterForward) const
Returns a hash table iterator.
TObject * RemoveSlow(TObject *obj)
Remove object from the hashtable without using the hash value.
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
TObject * Next()
Return next object in the list. Returns 0 when no more objects in list.
Int_t GetHashValue(const TObject *obj) const
const THashTable * fTable
Iterator abstract base class.
Bool_t operator!=(const TIterator &aIter) const
This operator compares two TIterator objects.
THashTable(const THashTable &)
Bool_t IsArgNull(const char *where, const TObject *obj) const
Returns true if object is a null pointer.
friend class THashTableIter
THashTable implements a hash table to store TObject's.
void Clear(Option_t *option="")
Remove all objects from the table.
std::map< std::string, std::string >::const_iterator iter
virtual void AddAll(const TCollection *col)
const Bool_t kIterForward
Int_t NextSlot()
Returns index of next slot in table containing list to be iterated.
const TCollection * GetCollection() const
~THashTableIter()
Delete hashtable iterator.
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.
Float_t AverageCollisions() const
R__EXTERN TObjectTable * gObjectTable
Long_t NextPrime(Long_t x)
TMath Base functions.
TIterator & operator=(const TIterator &rhs)
Overridden assignment operator.
virtual Int_t GetSize() const
TObject ** GetObjectRef(const TObject *obj) const
Return address of pointer to obj.
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.
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)
TObject * FindObject(const char *name) const
Find object using its name.
TObject * Next()
Return next object in hashtable. Returns 0 when no more objects in table.
virtual TObject ** GetObjectRef(const TObject *obj) const
Return address of pointer to obj.
ClassImp(THashTable) THashTable
Create a THashTable object.
TObject * Remove(TObject *obj)
Remove object from the hashtable.