102 memset(fTable, 0, fSize*
sizeof(
TObject*));
126 Printf(
"\nList of all objects");
127 Printf(
"object address class name");
128 Printf(
"================================================================================");
129 for (i = 0; i <
fSize; i++) {
136 Printf(
"================================================================================\n");
149 Error(
"Add",
"op is 0");
175 ::Error(
"TObjectTable::AddObj",
"op is 0");
185 gObjectTable->
Add(gObjectTable);
188 gObjectTable->
Add(op);
196 for (
int i = 0; i <
fSize; i++) {
211 Error(
"Remove",
"remove 0 from TObjectTable");
221 for (
int j = 0; j <
fSize; j++) {
223 Error(
"Remove",
"0x%lx found at %d !!!", (
Long_t)op, j);
251 for (
int j = 0; j <
fSize; j++)
284 for (n = 0; n <
fSize; n++) {
285 if ((slotOp =
fTable[slot]) == 0)
300 Int_t oldIndex, nextIndex;
303 for (oldIndex = index+1; ;oldIndex++) {
304 if (oldIndex >=
fSize)
306 nextObject =
fTable[oldIndex];
310 if (nextIndex != oldIndex) {
311 fTable[nextIndex] = nextObject;
329 for (
int i = 0; i < oldsize; i++)
330 if ((op = oldTable[i]))
340 int n,
h, s, ncum = 0, hcum = 0, scum = 0, tcum = 0, thcum = 0;
347 Printf(
"\nObject statistics");
348 Printf(
"class cnt on heap size total size heap size");
349 Printf(
"================================================================================");
352 while ((cl = (
TClass*) next())) {
354 h = cl->GetHeapInstanceCount();
357 Printf(
"%-24s %8d%11d%9d%14d%13d", cl->GetName(),
n,
h, s, n*s, h*s);
365 Printf(
"--------------------------------------------------------------------------------");
366 Printf(
"Total: %8d%11d%9d%14d%13d", ncum, hcum, scum, tcum, thcum);
367 Printf(
"================================================================================\n");
380 gROOT->GetListOfClasses()->R__FOR_EACH(
TClass,ResetInstanceCount)();
382 for (
int i = 0; i <
fSize; i++)
385 op->IsA()->AddInstance(op->
IsOnHeap());
387 Error(
"UpdateInstCount",
"oops 0x%lx\n", (
Long_t)op);
Int_t FindElement(TObject *obj)
Find an object in the object table.
object has not been deleted
TObjectTable * gObjectTable
Bool_t TestBit(UInt_t f) const
void Expand(Int_t newsize)
Expand the object table.
void RemoveQuietly(TObject *obj)
Remove an object from the object table.
~TObjectTable()
Delete TObjectTable.
void ToLower()
Change string to lower-case.
void UpdateInstCount() const
Histogram all objects according to their classes.
UInt_t Hash(ECaseCompare cmp=kExact) const
Return hash value.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
static Bool_t Initialized()
Return kTRUE if the TROOT object has been initialized.
void Terminate()
Deletes the object table (this static class function calls the dtor).
void * CheckPtrAndWarn(const char *msg, void *vp)
Issue a warning in case an object still appears in the table while it should not. ...
TObjectTable(const TObjectTable &)
UInt_t GetInstanceCount() const
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
The ROOT global object gROOT contains a list of all defined classes.
This class registers all instances of TObject and its derived classes in a hash table.
static void AddObj(TObject *obj)
Add an object to the global object table gObjectTable.
void Add(TObject *obj)
Add an object to the object table.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
void FixCollisions(Int_t index)
Rehash the object table in case an object has been removed.
void InstanceStatistics() const
Print the object table.
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 *opt="")
Delete all objects stored in the TObjectTable.
void Print(Option_t *option="") const
Print the object table.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
void Remove(TObject *obj)
Remove an object from the object table.