|
ROOT
Reference Guide |
|
Go to the documentation of this file.
131 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600
132 #pragma GCC diagnostic push
133 #pragma GCC diagnostic ignored "-Weffc++"
145 public std::iterator<std::bidirectional_iterator_tag,
146 TObject*, std::ptrdiff_t,
147 const TObject**, const TObject*&> {
173 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600
174 #pragma GCC diagnostic pop
Class used by TMap to store (key,value) pairs.
Int_t Capacity() const
Return number of slots in the hashtable.
Using a TBrowser one can browse all ROOT objects.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
const char * GetName() const
Returns name of object.
void Clear(Option_t *option="")
Remove all (key,value) pairs from the map.
const TCollection * GetCollection() const
Int_t Collisions(const char *keyname) const
Returns the number of collisions for a key with a certain name (i.e.
TIterator & operator=(const TIterator &rhs)
Overridden assignment operator.
virtual ~TPair()
TPair destructor.
Bool_t DeleteEntry(TObject *key)
Remove (key,value) pair with key from the map.
TObject * operator()(const char *keyname) const
TObject * GetValue(const char *keyname) const
Returns a pointer to the value associated with keyname as name of the key.
virtual void SetOwnerKeyValue(Bool_t ownkeys=kTRUE, Bool_t ownvals=kTRUE)
Set ownership for keys and values.
Bool_t IsEqual(const TObject *obj) const
Default equal comparison (objects are equal if they have the same address in memory).
virtual ULong_t Hash() const
Return hash value for this object.
virtual const char * GetTitle() const
Returns title of object.
void Add(TObject *obj)
This function may not be used (but we need to provide it since it is a pure virtual in TCollection).
TIterator * MakeIterator(Bool_t dir=kIterForward) const
Create an iterator for TMap.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write all objects in this map.
Iterator abstract base class.
Float_t AverageCollisions() const
Return the ratio of entries vs occupied slots.
void DeleteValues()
Remove all (key,value) pairs from the map AND delete the values when they are allocated on the heap.
Bool_t IsOwnerValue() const
const Bool_t kIterForward
Bool_t operator!=(const TIterator &aIter) const
This operator compares two TIterator objects.
virtual ~TMap()
TMap dtor.
TMap & operator=(const TMap &map)=delete
TObject * Next()
Returns the next key from a map.
virtual const char * GetName() const
Returns name of object.
const THashTable * GetTable() const
THashTable implements a hash table to store TObject's.
void SetValue(TObject *val)
TObject * FindObject(const char *keyname) const
Check if a (key,value) pair exists with keyname as name of the key.
TObject ** GetObjectRef(const TObject *obj) const
Return address of pointer to obj.
TObject * operator()(const TObject *key) const
TObject * Remove(TObject *key)
Remove the (key,value) pair with key from the map.
virtual Bool_t IsEqual(const TObject *obj) const
Default equal comparison (objects are equal if they have the same address in memory).
~TMapIter()
Map iterator dtor.
void DeleteAll()
Remove all (key,value) pairs from the map AND delete the keys AND values when they are allocated on t...
void Rehash(Int_t newCapacity, Bool_t checkObjValidity=kTRUE)
Rehash the underlaying THashTable (see THashTable::Rehash()).
virtual void Browse(TBrowser *b)
Browse the pair.
TMap(const TMap &map)=delete
TPair & operator=(const TPair &)=delete
virtual void SetOwnerValue(Bool_t enable=kTRUE)
Set whether this map is the owner (enable==true) of its 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.
Mother of all ROOT objects.
#define ClassDef(name, id)
const char * GetTitle() const
Returns title of object.
virtual void PrintCollectionEntry(TObject *entry, Option_t *option, Int_t recurse) const
Print the collection entry.
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
TPair(TObject *key, TObject *value)
Collection abstract base class.
ULong_t Hash() const
Return hash value for this object.
void Reset()
Reset the map iterator.
TPair * RemoveEntry(TObject *key)
Remove (key,value) pair with key from the map.
TObject ** GetObjectRef(const TObject *obj) const
TObject * operator*() const
Return pointer to current object (a TPair) or nullptr.
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...