ROOT  6.06/09
Reference Guide
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
TMap.cxx
Go to the documentation of this file.
1 // @(#)root/cont:$Id$
2 // Author: Fons Rademakers 12/11/95
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 /** \class TMap
13 TMap implements an associative array of (key,value) pairs using a
14 THashTable for efficient retrieval (therefore TMap does not conserve
15 the order of the entries). The hash value is calculated
16 using the value returned by the keys Hash() function and the
17 key comparison is done via the IsEqual() function.
18 Both key and value must inherit from TObject.
19 */
20 
21 #include "TMap.h"
22 #include "THashTable.h"
23 #include "TROOT.h"
24 #include "TBrowser.h"
25 #include "TRegexp.h"
26 
28 
29 ////////////////////////////////////////////////////////////////////////////////
30 /// TMap ctor. See THashTable for a description of the arguments.
31 
32 TMap::TMap(Int_t capacity, Int_t rehashlevel)
33 {
34  fSize = 0;
35  fTable = new THashTable(capacity, rehashlevel);
36 }
37 
38 ////////////////////////////////////////////////////////////////////////////////
39 /// TMap dtor. Objects are not deleted unless the TMap is the
40 /// owner (set via SetOwner()).
41 
43 {
44  Clear();
45  delete fTable;
46 }
47 
48 ////////////////////////////////////////////////////////////////////////////////
49 /// This function may not be used (but we need to provide it since it is
50 /// a pure virtual in TCollection). Use Add(key,value) instead.
51 
53 {
54  MayNotUse("Add(TObject *obj)");
55 }
56 
57 ////////////////////////////////////////////////////////////////////////////////
58 /// Add a (key,value) pair to the map.
59 
60 void TMap::Add(TObject *key, TObject *value)
61 {
62  if (IsArgNull("Add", key)) return;
63 
64  fTable->Add(new TPair(key, value));
65  fSize++;
66 }
67 
68 ////////////////////////////////////////////////////////////////////////////////
69 /// Return the ratio of entries vs occupied slots.
70 
72 {
73  return fTable->AverageCollisions();
74 }
75 
76 ////////////////////////////////////////////////////////////////////////////////
77 /// Return number of slots in the hashtable. Use GetSize() to get the
78 /// number of objects stored in the TMap.
79 
81 {
82  return fTable->Capacity();
83 }
84 
85 ////////////////////////////////////////////////////////////////////////////////
86 /// Remove all (key,value) pairs from the map. The keys/values are
87 /// deleted depending on the state of key-ownership (SetOwner()) and
88 /// value-ownership (SetOwnerValue()).
89 ///
90 /// To delete these objects regardless of the ownership state use:
91 /// - Delete() to delete only keys;
92 /// - DeleteValues() to delete only values;
93 /// - DeleteAll() to delete both keys and values.
94 
95 void TMap::Clear(Option_t *option)
96 {
97  if (IsOwner() && IsOwnerValue())
98  DeleteAll();
99  else if (IsOwner())
100  Delete();
101  else if (IsOwnerValue())
102  DeleteValues();
103  else {
104  fTable->Delete(option); // delete the TPair's
105  fSize = 0;
106  }
107 }
108 
109 ////////////////////////////////////////////////////////////////////////////////
110 /// Returns the number of collisions for a key with a certain name
111 /// (i.e. number of objects in same slot in the hash table, i.e. length
112 /// of linked list).
113 
114 Int_t TMap::Collisions(const char *keyname) const
115 {
116  return fTable->Collisions(keyname);
117 }
118 
119 ////////////////////////////////////////////////////////////////////////////////
120 /// Returns the number of collisions for a key (i.e. number of objects
121 /// in same slot in the hash table, i.e. length of linked list).
122 
124 {
125  return fTable->Collisions(key);
126 }
127 
128 ////////////////////////////////////////////////////////////////////////////////
129 /// Remove all (key,value) pairs from the map AND delete the keys
130 /// when they are allocated on the heap.
131 
132 void TMap::Delete(Option_t *option)
133 {
134  TIter next(fTable);
135  TPair *a;
136 
137  while ((a = (TPair *)next()))
138  if (a->Key() && a->Key()->IsOnHeap())
140 
141  fTable->Delete(option); // delete the TPair's
142  fSize = 0;
143 }
144 
145 ////////////////////////////////////////////////////////////////////////////////
146 /// Remove all (key,value) pairs from the map AND delete the values
147 /// when they are allocated on the heap.
148 
150 {
151  TIter next(fTable);
152  TPair *a;
153 
154  while ((a = (TPair *)next()))
155  if (a->Value() && a->Value()->IsOnHeap())
157 
158  fTable->Delete(); // delete the TPair's
159  fSize = 0;
160 }
161 
162 ////////////////////////////////////////////////////////////////////////////////
163 /// Remove all (key,value) pairs from the map AND delete the keys AND
164 /// values when they are allocated on the heap.
165 
167 {
168  TIter next(fTable);
169  TPair *a;
170 
171  while ((a = (TPair *)next())) {
172  if (a->Key() && a->Key()->IsOnHeap())
174  if (a->Value() && a->Value()->IsOnHeap())
176  }
177 
178  fTable->Delete(); // delete the TPair's
179  fSize = 0;
180 }
181 
182 ////////////////////////////////////////////////////////////////////////////////
183 /// Remove (key,value) pair with key from the map. Returns true
184 /// if the key was found and removed, false otherwise.
185 /// The key and value objects are deleted if map is the owner
186 /// of keys and values respectively.
187 
189 {
190  if (!key) return kFALSE;
191 
192  TPair *a;
193  if ((a = (TPair *)fTable->FindObject(key))) {
194  if (fTable->Remove(key)) {
195  if (IsOwner() && a->Key() && a->Key()->IsOnHeap())
197  if (IsOwnerValue() && a->Value() && a->Value()->IsOnHeap())
199  delete a;
200  fSize--;
201  return kTRUE;
202  }
203  }
204  return kFALSE;
205 }
206 
207 ////////////////////////////////////////////////////////////////////////////////
208 /// Check if a (key,value) pair exists with keyname as name of the key.
209 /// Returns a TPair* (need to downcast from TObject). Use Key() and
210 /// Value() to get the pointers to the key and value, respectively.
211 /// Returns 0 if not found.
212 
213 TObject *TMap::FindObject(const char *keyname) const
214 {
215  return fTable->FindObject(keyname);
216 }
217 
218 ////////////////////////////////////////////////////////////////////////////////
219 /// Check if a (key,value) pair exists with key as key.
220 /// Returns a TPair* (need to downcast from TObject). Use Key() and
221 /// Value() to get the pointers to the key and value, respectively.
222 /// Returns 0 if not found.
223 
224 TObject *TMap::FindObject(const TObject *key) const
225 {
226  if (IsArgNull("FindObject", key)) return 0;
227 
228  return fTable->FindObject(key);
229 }
230 
231 ////////////////////////////////////////////////////////////////////////////////
232 /// Returns a pointer to the value associated with keyname as name of the key.
233 
234 TObject *TMap::GetValue(const char *keyname) const
235 {
236  TPair *a = (TPair *)fTable->FindObject(keyname);
237  if (a) return a->Value();
238  return 0;
239 }
240 
241 ////////////////////////////////////////////////////////////////////////////////
242 /// Returns a pointer to the value associated with key.
243 
244 TObject *TMap::GetValue(const TObject *key) const
245 {
246  if (IsArgNull("GetValue", key)) return 0;
247 
248  TPair *a = (TPair *)fTable->FindObject(key);
249  if (a) return a->Value();
250  return 0;
251 }
252 
253 ////////////////////////////////////////////////////////////////////////////////
254 /// Create an iterator for TMap.
255 
257 {
258  return new TMapIter(this, dir);
259 }
260 
261 ////////////////////////////////////////////////////////////////////////////////
262 /// Print the collection entry.
263 
264 void TMap::PrintCollectionEntry(TObject* entry, Option_t* option, Int_t recurse) const
265 {
266  TObject* val = GetValue(entry);
267 
269  printf("Key: ");
270  entry->Print();
272  printf("Value: ");
273  TCollection* coll = dynamic_cast<TCollection*>(val);
274  if (coll) {
275  coll->Print(option, recurse);
276  } else {
277  val->Print(option);
278  }
279 }
280 
281 ////////////////////////////////////////////////////////////////////////////////
282 /// Rehash the underlaying THashTable (see THashTable::Rehash()).
283 
284 void TMap::Rehash(Int_t newCapacity, Bool_t checkObjValidity)
285 {
286  fTable->Rehash(newCapacity, checkObjValidity);
287 }
288 
289 ////////////////////////////////////////////////////////////////////////////////
290 /// Remove the (key,value) pair with key from the map. Returns the
291 /// key object or 0 in case key was not found. If map is the owner
292 /// of values, the value is deleted.
293 
295 {
296  if (!key) return 0;
297 
298  TPair *a;
299  if ((a = (TPair *)fTable->FindObject(key))) {
300  if (fTable->Remove(key)) {
301  if (IsOwnerValue() && a->Value() && a->Value()->IsOnHeap())
303  TObject *kobj = a->Key();
304  delete a;
305  fSize--;
306  return kobj;
307  }
308  }
309  return 0;
310 }
311 
312 ////////////////////////////////////////////////////////////////////////////////
313 /// Remove (key,value) pair with key from the map. Returns the
314 /// pair object or 0 in case the key was not found.
315 /// It is caller's responsibility to delete the pair and, eventually,
316 /// the key and value objects.
317 
319 {
320  if (!key) return 0;
321 
322  TPair *a;
323  if ((a = (TPair *)fTable->FindObject(key))) {
324  if (fTable->Remove(key)) {
325  fSize--;
326  return a;
327  }
328  }
329  return 0;
330 }
331 
332 ////////////////////////////////////////////////////////////////////////////////
333 /// Set whether this map is the owner (enable==true)
334 /// of its values. If it is the owner of its contents,
335 /// these objects will be deleted whenever the collection itself
336 /// is deleted. The objects might also be deleted or destructed when Clear
337 /// is called (depending on the collection).
338 
340 {
341  if (enable)
343  else
345 }
346 
347 ////////////////////////////////////////////////////////////////////////////////
348 /// Set ownership for keys and values.
349 
350 void TMap::SetOwnerKeyValue(Bool_t ownkeys, Bool_t ownvals)
351 {
352  SetOwner(ownkeys);
353  SetOwnerValue(ownvals);
354 }
355 
356 ////////////////////////////////////////////////////////////////////////////////
357 /// Stream all key/value pairs in the map to or from the I/O buffer.
358 
359 void TMap::Streamer(TBuffer &b)
360 {
361  TObject *obj=0;
362  UInt_t R__s, R__c;
363 
364  if (b.IsReading()) {
365  Int_t nobjects;
366  TObject *value=0;
367 
368  Version_t v = b.ReadVersion(&R__s, &R__c);
369  if (v > 2)
370  TObject::Streamer(b);
371  if (v > 1)
372  fName.Streamer(b);
373  b >> nobjects;
374  for (Int_t i = 0; i < nobjects; i++) {
375  b >> obj;
376  b >> value;
377  if (obj) Add(obj, value);
378  }
379  b.CheckByteCount(R__s, R__c,TMap::IsA());
380  } else {
381  R__c = b.WriteVersion(TMap::IsA(), kTRUE);
382  TObject::Streamer(b);
383  fName.Streamer(b);
384  b << GetSize();
385  TIter next(fTable);
386  TPair *a;
387  while ((a = (TPair*) next())) {
388  b << a->Key();
389  b << a->Value();
390  }
391  b.SetByteCount(R__c, kTRUE);
392  }
393 }
394 
395 ////////////////////////////////////////////////////////////////////////////////
396 /// Write all objects in this map. By default all objects in
397 /// the collection are written individually (each object gets its
398 /// own key). Note, this is recursive, i.e. objects in collections
399 /// in the collection are also written individually. To write all
400 /// objects using a single key specify a name and set option to
401 /// TObject::kSingleKey (i.e. 1).
402 
403 Int_t TMap::Write(const char *name, Int_t option, Int_t bsize) const
404 {
405  if ((option & kSingleKey)) {
406  return TObject::Write(name, option, bsize);
407  } else {
408  option &= ~kSingleKey;
409  Int_t nbytes = 0;
410  TIter next(fTable);
411  TPair *a;
412  while ((a = (TPair*) next())) {
413  if (a->Key())
414  nbytes += a->Key()->Write(name, option, bsize);
415  if (a->Value())
416  nbytes += a->Value()->Write(name, option, bsize);
417  }
418  return nbytes;
419  }
420 }
421 
422 ////////////////////////////////////////////////////////////////////////////////
423 /// Write all objects in this map. By default all objects in
424 /// the collection are written individually (each object gets its
425 /// own key). Note, this is recursive, i.e. objects in collections
426 /// in the collection are also written individually. To write all
427 /// objects using a single key specify a name and set option to
428 /// TObject::kSingleKey (i.e. 1).
429 
430 Int_t TMap::Write(const char *name, Int_t option, Int_t bsize)
431 {
432  return ((const TMap*)this)->Write(name,option,bsize);
433 }
434 
435 /** \class TPair
436 Class used by TMap to store (key,value) pairs.
437 */
438 
439 ////////////////////////////////////////////////////////////////////////////////
440 /// Browse the pair.
441 
443 {
444  if (b) {
445  if (fKey) b->Add(fKey);
446  if (fValue) b->Add(fValue);
447  } else {
448  if (fKey) fKey->Browse(b);
449  if (fValue) fValue->Browse(b);
450  }
451 }
452 
453 /** \class TMapIter
454 Iterator of map.
455 */
456 
458 
459 ////////////////////////////////////////////////////////////////////////////////
460 /// Create a map iterator. Use dir to specify the desired iteration direction.
461 
462 TMapIter::TMapIter(const TMap *m, Bool_t dir)
463 {
464  fMap = m;
465  fDirection = dir;
466  fCursor = 0;
467 }
468 
469 ////////////////////////////////////////////////////////////////////////////////
470 /// Copy ctor.
471 
473 {
474  fMap = iter.fMap;
475  fDirection = iter.fDirection;
476  fCursor = 0;
477  if (iter.fCursor) {
479  if (fCursor)
480  fCursor->operator=(*iter.fCursor);
481  }
482 }
483 
484 ////////////////////////////////////////////////////////////////////////////////
485 /// Overridden assignment operator.
486 
488 {
489  if (this != &rhs && rhs.IsA() == TMapIter::Class()) {
490  const TMapIter &rhs1 = (const TMapIter &)rhs;
491  fMap = rhs1.fMap;
492  fDirection = rhs1.fDirection;
493  if (rhs1.fCursor) {
495  if (fCursor)
496  fCursor->operator=(*rhs1.fCursor);
497  }
498  }
499  return *this;
500 }
501 
502 ////////////////////////////////////////////////////////////////////////////////
503 /// Overloaded assignment operator.
504 
506 {
507  if (this != &rhs) {
508  fMap = rhs.fMap;
509  fDirection = rhs.fDirection;
510  if (rhs.fCursor) {
512  if (fCursor)
513  fCursor->operator=(*rhs.fCursor);
514  }
515  }
516  return *this;
517 }
518 
519 ////////////////////////////////////////////////////////////////////////////////
520 /// Map iterator dtor.
521 
523 {
524  Reset();
525 }
526 
527 ////////////////////////////////////////////////////////////////////////////////
528 /// Returns the next key from a map. Use TMap::GetValue() to get the value
529 /// associated with the key. Returns 0 when no more items in map.
530 
532 {
533  if (!fCursor)
535 
536  TPair *a = (TPair *)fCursor->Next();
537  if (a) return a->Key();
538  return 0;
539 }
540 
541 ////////////////////////////////////////////////////////////////////////////////
542 /// Reset the map iterator.
543 
545 {
547 }
548 
549 ////////////////////////////////////////////////////////////////////////////////
550 /// This operator compares two TIterator objects.
551 
553 {
554  if (aIter.IsA() == TMapIter::Class()) {
555  const TMapIter &iter(dynamic_cast<const TMapIter &>(aIter));
556  return (fCursor->operator*() != iter.fCursor->operator*());
557  }
558  return false; // for base class we don't implement a comparison
559 }
560 
561 ////////////////////////////////////////////////////////////////////////////////
562 /// This operator compares two TMapIter objects.
563 
565 {
566  return (fCursor->operator*() != aIter.fCursor->operator*());
567 }
568 
569 ////////////////////////////////////////////////////////////////////////////////
570 /// Return pointer to current object (a TPair) or nullptr.
571 
573 {
574  return (fCursor ? fCursor->operator*() : nullptr);
575 }
void Add(TObject *obj, const char *name=0, Int_t check=-1)
Add object with name to browser.
Definition: TBrowser.cxx:259
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
Definition: TObject.cxx:823
Int_t Collisions(const char *name) const
Returns the number of collisions for an object with a certain name (i.e.
Definition: THashTable.cxx:170
TObject * fValue
Definition: TMap.h:110
Bool_t IsOnHeap() const
Definition: TObject.h:140
TPair * RemoveEntry(TObject *key)
Remove (key,value) pair with key from the map.
Definition: TMap.cxx:318
Bool_t IsReading() const
Definition: TBuffer.h:81
short Version_t
Definition: RtypesCore.h:61
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
Int_t Capacity() const
Definition: TCollection.h:80
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
virtual void Browse(TBrowser *b)
Browse the pair.
Definition: TMap.cxx:442
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...
Definition: TObject.cxx:971
TMapIter()
Definition: TMap.h:158
Buffer base class used for serializing objects.
Definition: TBuffer.h:40
void Rehash(Int_t newCapacity, Bool_t checkObjValidity=kTRUE)
Rehash the hashtable.
Definition: THashTable.cxx:279
void Add(TObject *obj)
This function may not be used (but we need to provide it since it is a pure virtual in TCollection)...
Definition: TMap.cxx:52
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.
Definition: TMap.cxx:572
virtual void Browse(TBrowser *b)
Browse object. May be overridden for another default action.
Definition: TObject.cxx:178
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TArc * a
Definition: textangle.C:12
const Bool_t kFALSE
Definition: Rtypes.h:92
TString fName
Definition: TCollection.h:62
THashTableIter * fCursor
Definition: TMap.h:155
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write all objects in this map.
Definition: TMap.cxx:430
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)=0
virtual ~TMap()
TMap dtor.
Definition: TMap.cxx:42
Iterator abstract base class.
Definition: TIterator.h:32
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:732
const TMap * fMap
Definition: TMap.h:154
Bool_t IsArgNull(const char *where, const TObject *obj) const
Returns true if object is a null pointer.
#define SafeDelete(p)
Definition: RConfig.h:436
Iterator of hash table.
Definition: THashTable.h:106
THashTable implements a hash table to store TObject's.
Definition: THashTable.h:39
Bool_t fDirection
Definition: TMap.h:156
void Class()
Definition: Class.C:29
Int_t bsize[]
Definition: SparseFit4.cxx:31
void DeleteAll()
Remove all (key,value) pairs from the map AND delete the keys AND values when they are allocated on t...
Definition: TMap.cxx:166
std::map< std::string, std::string >::const_iterator iter
Definition: TAlienJob.cxx:54
TObject * GetValue(const char *keyname) const
Returns a pointer to the value associated with keyname as name of the key.
Definition: TMap.cxx:234
Int_t Capacity() const
Return number of slots in the hashtable.
Definition: TMap.cxx:80
Float_t AverageCollisions() const
Return the ratio of entries vs occupied slots.
Definition: TMap.cxx:71
TObject * FindObject(const char *keyname) const
Check if a (key,value) pair exists with keyname as name of the key.
Definition: TMap.cxx:213
virtual void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
Definition: TObject.cxx:594
friend class TMapIter
Definition: TMap.h:46
Iterator of map.
Definition: TMap.h:148
virtual void SetOwnerValue(Bool_t enable=kTRUE)
Set whether this map is the owner (enable==true) of its values.
Definition: TMap.cxx:339
const TCollection * GetCollection() const
Definition: THashTable.h:124
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
virtual void SetOwnerKeyValue(Bool_t ownkeys=kTRUE, Bool_t ownvals=kTRUE)
Set ownership for keys and values.
Definition: TMap.cxx:350
void Delete(Option_t *option="")
Remove all (key,value) pairs from the map AND delete the keys when they are allocated on the heap...
Definition: TMap.cxx:132
Bool_t IsOwner() const
Definition: TCollection.h:101
TObject * Remove(TObject *key)
Remove the (key,value) pair with key from the map.
Definition: TMap.cxx:294
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const =0
TIterator * MakeIterator(Bool_t dir=kIterForward) const
Create an iterator for TMap.
Definition: TMap.cxx:256
Bool_t DeleteEntry(TObject *key)
Remove (key,value) pair with key from the map.
Definition: TMap.cxx:188
Collection abstract base class.
Definition: TCollection.h:48
TClass * IsA() const
TObject * Value() const
Definition: TMap.h:125
unsigned int UInt_t
Definition: RtypesCore.h:42
TMarker * m
Definition: textangle.C:8
~TMapIter()
Map iterator dtor.
Definition: TMap.cxx:522
Int_t fSize
Definition: TCollection.h:63
virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion=kFALSE)=0
ClassImp(TMap) TMap
TMap ctor. See THashTable for a description of the arguments.
Definition: TMap.cxx:27
Long64_t entry
Float_t AverageCollisions() const
Definition: THashTable.h:83
void DeleteValues()
Remove all (key,value) pairs from the map AND delete the values when they are allocated on the heap...
Definition: TMap.cxx:149
void Rehash(Int_t newCapacity, Bool_t checkObjValidity=kTRUE)
Rehash the underlaying THashTable (see THashTable::Rehash()).
Definition: TMap.cxx:284
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.
Definition: TMap.h:106
virtual Int_t GetSize() const
Definition: TCollection.h:95
TObject * Key() const
Definition: TMap.h:124
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
Definition: TMap.h:44
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.
Definition: THashTable.cxx:75
THashTable * fTable
Definition: TMap.h:49
virtual void PrintCollectionEntry(TObject *entry, Option_t *option, Int_t recurse) const
Print the collection entry.
Definition: TMap.cxx:264
TIterator & operator=(const TIterator &rhs)
Overridden assignment operator.
Definition: TMap.cxx:487
#define name(a, b)
Definition: linkTestLib0.cpp:5
Mother of all ROOT objects.
Definition: TObject.h:58
Bool_t IsOwnerValue() const
Definition: TMap.h:82
void Delete(Option_t *option="")
Remove all objects from the table AND delete all heap based objects.
Definition: THashTable.cxx:193
TObject * Next()
Returns the next key from a map.
Definition: TMap.cxx:531
TObject * FindObject(const char *name) const
Find object using its name.
Definition: THashTable.cxx:209
TObject * Next()
Return next object in hashtable. Returns 0 when no more objects in table.
Definition: THashTable.cxx:434
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
Definition: TROOT.cxx:2461
void ResetBit(UInt_t f)
Definition: TObject.h:172
const Bool_t kTRUE
Definition: Rtypes.h:91
void Reset()
Reset the map iterator.
Definition: TMap.cxx:544
TObject * obj
float value
Definition: math.cpp:443
TObject * fKey
Definition: TMap.h:109
Bool_t operator!=(const TIterator &aIter) const
This operator compares two TIterator objects.
Definition: TMap.cxx:552
void Clear(Option_t *option="")
Remove all (key,value) pairs from the map.
Definition: TMap.cxx:95
Int_t Collisions(const char *keyname) const
Returns the number of collisions for a key with a certain name (i.e.
Definition: TMap.cxx:114
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.
Definition: THashTable.cxx:314