35 fTable =
new THashTable(capacity, rehashlevel);
226 if (
IsArgNull(
"FindObject", key))
return 0;
237 if (a)
return a->
Value();
246 if (
IsArgNull(
"GetValue", key))
return 0;
249 if (a)
return a->
Value();
275 coll->
Print(option, recurse);
359 void TMap::Streamer(
TBuffer &b)
370 TObject::Streamer(b);
374 for (
Int_t i = 0; i < nobjects; i++) {
377 if (obj)
Add(obj, value);
382 TObject::Streamer(b);
408 option &= ~kSingleKey;
414 nbytes += a->
Key()->
Write(name, option, bsize);
416 nbytes += a->
Value()->
Write(name, option, bsize);
432 return ((
const TMap*)
this)->Write(name,option,bsize);
537 if (a)
return a->
Key();
555 const TMapIter &
iter(dynamic_cast<const TMapIter &>(aIter));
void Add(TObject *obj, const char *name=0, Int_t check=-1)
Add object with name to browser.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
Int_t Collisions(const char *name) const
Returns the number of collisions for an object with a certain name (i.e.
TPair * RemoveEntry(TObject *key)
Remove (key,value) pair with key from the map.
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
virtual void Browse(TBrowser *b)
Browse the pair.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
void MayNotUse(const char *method) const
Use this method to signal that a method (defined in a base class) may not be called in a derived clas...
Buffer base class used for serializing objects.
void Rehash(Int_t newCapacity, Bool_t checkObjValidity=kTRUE)
Rehash the hashtable.
void Add(TObject *obj)
This function may not be used (but we need to provide it since it is a pure virtual in TCollection)...
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
TObject * operator*() const
Return pointer to current object (a TPair) or nullptr.
virtual void Browse(TBrowser *b)
Browse object. May be overridden for another default action.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write all objects in this map.
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)=0
virtual ~TMap()
TMap dtor.
Iterator abstract base class.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Bool_t IsArgNull(const char *where, const TObject *obj) const
Returns true if object is a null pointer.
THashTable implements a hash table to store TObject's.
void DeleteAll()
Remove all (key,value) pairs from the map AND delete the keys AND values when they are allocated on t...
std::map< std::string, std::string >::const_iterator iter
TObject * GetValue(const char *keyname) const
Returns a pointer to the value associated with keyname as name of the key.
Int_t Capacity() const
Return number of slots in the hashtable.
Float_t AverageCollisions() const
Return the ratio of entries vs occupied slots.
TObject * FindObject(const char *keyname) const
Check if a (key,value) pair exists with keyname as name of the key.
virtual void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
virtual void SetOwnerValue(Bool_t enable=kTRUE)
Set whether this map is the owner (enable==true) of its values.
const TCollection * GetCollection() const
Using a TBrowser one can browse all ROOT objects.
virtual void SetOwnerKeyValue(Bool_t ownkeys=kTRUE, Bool_t ownvals=kTRUE)
Set ownership for keys and values.
void Delete(Option_t *option="")
Remove all (key,value) pairs from the map AND delete the keys when they are allocated on the heap...
TObject * Remove(TObject *key)
Remove the (key,value) pair with key from the map.
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const =0
TIterator * MakeIterator(Bool_t dir=kIterForward) const
Create an iterator for TMap.
Bool_t DeleteEntry(TObject *key)
Remove (key,value) pair with key from the map.
Collection abstract base class.
~TMapIter()
Map iterator dtor.
virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion=kFALSE)=0
ClassImp(TMap) TMap
TMap ctor. See THashTable for a description of the arguments.
Float_t AverageCollisions() const
void DeleteValues()
Remove all (key,value) pairs from the map AND delete the values when they are allocated on the heap...
void Rehash(Int_t newCapacity, Bool_t checkObjValidity=kTRUE)
Rehash the underlaying THashTable (see THashTable::Rehash()).
virtual void Print(Option_t *option="") const
Default print for collections, calls Print(option, 1).
static void GarbageCollect(TObject *obj)
Add to the list of things to be cleaned up.
Class used by TMap to store (key,value) pairs.
virtual Int_t GetSize() const
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
void Add(TObject *obj)
Add object to the hash table.
virtual void PrintCollectionEntry(TObject *entry, Option_t *option, Int_t recurse) const
Print the collection entry.
TIterator & operator=(const TIterator &rhs)
Overridden assignment operator.
Mother of all ROOT objects.
Bool_t IsOwnerValue() const
void Delete(Option_t *option="")
Remove all objects from the table AND delete all heap based objects.
TObject * Next()
Returns the next key from a map.
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.
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
void Reset()
Reset the map iterator.
Bool_t operator!=(const TIterator &aIter) const
This operator compares two TIterator objects.
void Clear(Option_t *option="")
Remove all (key,value) pairs from the map.
Int_t Collisions(const char *keyname) const
Returns the number of collisions for a key with a certain name (i.e.
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
TObject * Remove(TObject *obj)
Remove object from the hashtable.